泰勒定理

泰勒展开是一个很有趣的方法。应该大部分人都看过下面这么一条定理:

泰勒定理:若函数f(x)在闭区间[a,b]上存在直至n阶的连续导函数,在开区间(a,b)内存在(n+1)阶导函数,则对任意给定的 x,x0[a,b] x , x 0 ∈ [ a , b ] <script type="math/tex" id="MathJax-Element-2217">x,x_0\in [a,b]</script>,至少存在一点 ξ(a,b) ξ ∈ ( a , b ) <script type="math/tex" id="MathJax-Element-2218">\xi \in (a,b)</script>,使得

f(x)=+f(x0)+f (x0)(xx0)+f ′′(x0)2!(xx0)2+f(n)(x0)n!(xx0)n+f(n+1)(ξ)(n+1)!(xx0)n+1 f ( x ) = f ( x 0 ) + f   ′ ( x 0 ) ( x − x 0 ) + f   ″ ( x 0 ) 2 ! ( x − x 0 ) 2 + ⋯ + f ( n ) ( x 0 ) n ! ( x − x 0 ) n + f ( n + 1 ) ( ξ ) ( n + 1 ) ! ( x − x 0 ) n + 1
<script type="math/tex; mode=display" id="MathJax-Element-2219"> \begin{aligned} f( x) = & f(x_{0} )+f\ '(x_{0} )(x-x_{0} )+\frac{f\ ''(x_{0} )}{2!} (x-x_{0} )^{2} +\cdots \\ + & \frac{f^{( n)} (x_{0} )}{n!} (x-x_{0} )^{n} +\frac{f^{( n+1)} (\xi )}{( n+1) !} (x-x_{0} )^{n+1} \end{aligned} </script>

他的原理也很简单,那就是,当两个函数接近的时候,那么他们在某个点的值肯定相等: f(0)=g(0) f ( 0 ) = g ( 0 ) <script type="math/tex" id="MathJax-Element-2220">f(0)=g(0)</script>,
他们的一阶导数在一点上也应该相等 f(0)=g(0) f ′ ( 0 ) = g ′ ( 0 ) <script type="math/tex" id="MathJax-Element-2221">f'(0)=g'(0)</script>,
二阶导数也应该相等 f′′(0)=g′′(0) f ″ ( 0 ) = g ″ ( 0 ) <script type="math/tex" id="MathJax-Element-2222">f''(0)=g''(0)</script>,如此类推。。
那么我们能不能用一个多项式函数去逼近这么一个函数呢?而答案正是泰勒展开。

举个例子,假设f(x)是你想逼近的函数,g(x)则是它的二阶泰勒逼近,即: g(x)=f(0)+f(0)(x0)+f′′(0)2(x0)2 g ( x ) = f ( 0 ) + f ′ ( 0 ) ( x − 0 ) + f ″ ( 0 ) 2 ( x − 0 ) 2 <script type="math/tex" id="MathJax-Element-2223">g(x)=f(0)+f'(0)(x-0)+\frac{f''(0)}{2}(x-0)^2</script>,
于是显然有: g(0)=f(0)。g(x)对x求导:

g(x)g′′(x)=f(0)+f′′(0)(x0)=f′′(0)(185)(186) (185) g ′ ( x ) = f ′ ( 0 ) + f ″ ( 0 ) ( x − 0 ) (186) g ″ ( x ) = f ″ ( 0 )
<script type="math/tex; mode=display" id="MathJax-Element-2224"> \begin{align} g'(x)&=f'(0)+f''(0)(x-0)\\ g''(x)&=f''(0) \end{align} </script>
因此 g(0)=f(0) g ′ ( 0 ) = f ′ ( 0 ) <script type="math/tex" id="MathJax-Element-2225">g'(0)=f'(0)</script>, g′′(0)=f′′(0) g ″ ( 0 ) = f ″ ( 0 ) <script type="math/tex" id="MathJax-Element-2226">g''(0)=f''(0)</script>
当级数趋于无穷的时候就能近似任意的函数了。
盗个图:
这里写图片描述

f(x+y)f(x)+f(ξ)y f ( x + y ) ≈ f ( x ) + f ′ ( ξ ) y
<script type="math/tex; mode=display" id="MathJax-Element-1959"> f(x+y)\approx f(x)+f'(\xi)y </script>

多元函数的泰勒展开

多元函数的泰勒近似的原理也是类似的,只不过在多元函数中,我们要求的两个函数值相同,变成了有多个点: f(a,b)=g(a,b) f ( a , b ) = g ( a , b ) <script type="math/tex" id="MathJax-Element-1437">f(a,b)=g(a,b)</script>, Df(a,b)=Dg(a,b) D f ( a , b ) = D g ( a , b ) <script type="math/tex" id="MathJax-Element-1438">Df(a,b)=Dg(a,b)</script>, Hf(a,b)=Hg(a,b) H f ( a , b ) = H g ( a , b ) <script type="math/tex" id="MathJax-Element-1439">Hf(a,b)=Hg(a,b)</script>,这里的Df(a,b)是导数矩阵,Hf(a,b)是黑塞矩阵(二阶导),于是多元函数的泰勒展开公式就变成:

f(x)f(a)+Df(a)(xa)+12(xa)THf(a)(xa). f ( x ) ≈ f ( a ) + D f ( a ) ( x − a ) + 1 2 ( x − a ) T H f ( a ) ( x − a ) .
<script type="math/tex; mode=display" id="MathJax-Element-1670"> \begin{align*} f(\textbf{x}) &\approx f(\textbf{a}) + Df(\textbf{a}) (\textbf{x}-\textbf{a}) + \frac{1}{2} (\textbf{x}-\textbf{a})^T Hf(\textbf{a}) (\textbf{x}-\textbf{a}). \end{align*} </script>

其中

Df(a,b)=[fx1(a,b),fx2(a,b)]. D f ( a , b ) = [ ∂ f x 1 ( a , b ) , ∂ f x 2 ( a , b ) ] .
<script type="math/tex; mode=display" id="MathJax-Element-1671"> \begin{align*} Df(a,b) = \left[\frac{\partial f}{x_1}(a,b), \frac{\partial f}{x_2}(a,b)\right]. \end{align*} </script>
Hf=2fx21(a,b)2fx2 x1(a,b)2fx1 x2(a,b)2fx22(a,b) H f = [ ∂ 2 f ∂ x 1 2 ( a , b ) ∂ 2 f ∂ x 1   ∂ x 2 ( a , b ) ∂ 2 f ∂ x 2   ∂ x 1 ( a , b ) ∂ 2 f ∂ x 2 2 ( a , b ) ]
<script type="math/tex; mode=display" id="MathJax-Element-1672"> \mathbf{H} f=\begin{bmatrix} \dfrac{\partial ^{2} f}{\partial x^{2}_{1}}( a,b) & \dfrac{\partial ^{2} f}{\partial x_{1} \ \partial x_{2}}( a,b)\\ \dfrac{\partial ^{2} f}{\partial x_{2} \ \partial x_{1}}( a,b) & \dfrac{\partial ^{2} f}{\partial x^{2}_{2}}( a,b) \end{bmatrix} </script>

举个例子,一个二元函数f(x,y)在点(a,b)上的的泰勒展开式为:

f(x,y)+=++f(a,b)+[fx(a,b),fy(a,b)][xayb]12[xayb]2fx2(a,b)2fy x(a,b)2fx y(a,b)2fy2(a,b)[xayb]f(a,b)+(xa)fx(a,b)+(yb)fy(a,b)12!(xa)2f′′xx(a,b)+12!(xa)(yb)f′′xy(a,b)12!(xa)(yb)f′′yx(a,b)+12!(yb)2f′′yy(a,b) f ( x , y ) ≈ f ( a , b ) + [ ∂ f x ( a , b ) , ∂ f y ( a , b ) ] [ x − a y − b ] + 1 2 [ x − a y − b ] [ ∂ 2 f ∂ x 2 ( a , b ) ∂ 2 f ∂ x   ∂ y ( a , b ) ∂ 2 f ∂ y   ∂ x ( a , b ) ∂ 2 f ∂ y 2 ( a , b ) ] [ x − a y − b ] = f ( a , b ) + ( x − a ) f x ′ ( a , b ) + ( y − b ) f y ′ ( a , b ) + 1 2 ! ( x − a ) 2 f x x ″ ( a , b ) + 1 2 ! ( x − a ) ( y − b ) f x y ″ ( a , b ) + 1 2 ! ( x − a ) ( y − b ) f y x ″ ( a , b ) + 1 2 ! ( y − b ) 2 f y y ″ ( a , b )
<script type="math/tex; mode=display" id="MathJax-Element-1673"> \begin{aligned} f(x,y)\approx & f(a,b)+\left[\frac{\partial f}{x} (a,b),\frac{\partial f}{y} (a,b)\right]\begin{bmatrix} x-a\\ y-b \end{bmatrix}\\ + &\frac{1}{2} \begin{bmatrix} x-a & y-b \end{bmatrix}\begin{bmatrix} \dfrac{\partial ^{2} f}{\partial x^{2}}( a,b) & \dfrac{\partial ^{2} f}{\partial x \ \partial y}( a,b)\\ \dfrac{\partial ^{2} f}{\partial y \ \partial x}( a,b) & \dfrac{\partial ^{2} f}{\partial y^{2}}( a,b) \end{bmatrix}\begin{bmatrix} x-a\\ y-b \end{bmatrix}\\ = & f(a,b)+(x-a)f'_{x} (a,b)+(y-b)f'_{y} (a,b)\\ + & \frac{1}{2!} (x-a)^{2} f''_{xx} (a,b)+\frac{1}{2!} (x-a)(y-b)f''_{xy} (a,b)\\ + & \frac{1}{2!} (x-a)(y-b)f''_{yx} (a,b)+\frac{1}{2!} (y-b)^{2} f''_{yy} (a,b) \end{aligned} </script>

黑塞矩阵更一般的形式可以写成:

Hf(x1,x2,...,xn)=2fx212fx2x12fxnx12fx1x22fx222fxnx22fx1xn2fx2xn2fx2n. H f ( x 1 , x 2 , . . . , x n ) = [ ∂ 2 f ∂ x 1 2 ∂ 2 f ∂ x 1 ∂ x 2 ⋯ ∂ 2 f ∂ x 1 ∂ x n ∂ 2 f ∂ x 2 ∂ x 1 ∂ 2 f ∂ x 2 2 ⋯ ∂ 2 f ∂ x 2 ∂ x n ⋮ ⋮ ⋱ ⋮ ∂ 2 f ∂ x n ∂ x 1 ∂ 2 f ∂ x n ∂ x 2 ⋯ ∂ 2 f ∂ x n 2 ] .
<script type="math/tex; mode=display" id="MathJax-Element-1674"> {\mathbf Hf(x_1,x_2,...,x_n)}={\begin{bmatrix}{\dfrac {\partial ^{2}f}{\partial x_{1}^{2}}}&{\dfrac {\partial ^{2}f}{\partial x_{1}\,\partial x_{2}}}&\cdots &{\dfrac {\partial ^{2}f}{\partial x_{1}\,\partial x_{n}}}\\[2.2ex]{\dfrac {\partial ^{2}f}{\partial x_{2}\,\partial x_{1}}}&{\dfrac {\partial ^{2}f}{\partial x_{2}^{2}}}&\cdots &{\dfrac {\partial ^{2}f}{\partial x_{2}\,\partial x_{n}}}\\[2.2ex]\vdots &\vdots &\ddots &\vdots \\[2.2ex]{\dfrac {\partial ^{2}f}{\partial x_{n}\,\partial x_{1}}}&{\dfrac {\partial ^{2}f}{\partial x_{n}\,\partial x_{2}}}&\cdots &{\dfrac {\partial ^{2}f}{\partial x_{n}^{2}}}\end{bmatrix}}. </script>

参考资料

https://mathinsight.org/taylors_theorem_multivariable_introduction
https://mathinsight.org/derivative_matrix
https://mathinsight.org/taylor_polynomial_multivariable_examples
https://blog.csdn.net/red_stone1/article/details/70260070
怎样更好地理解并记忆泰勒展开式? - 陈二喜的回答 - 知乎

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐