abstract
- 麦克劳林公式及其近似表示的应用
- 误差估计和分析
Lagrange型泰勒公式的估计误差
- 由Lagrange型余项泰勒公式可知,多项式 p n ( x ) p_n(x) pn(x)近似表达函数 f ( x ) f(x) f(x)时,其误差为 ∣ R n ( x ) ∣ |R_{n}(x)| ∣Rn(x)∣
- R n ( x ) R_{n}(x) Rn(x)= f ( n + 1 ) ( ξ ) ( n + 1 ) ! ( x − x 0 ) n + 1 \frac{f^{(n+1)}(\xi)}{(n+1)!}(x-x_0)^{n+1} (n+1)!f(n+1)(ξ)(x−x0)n+1,( ξ \xi ξ在 x 0 x_0 x0和 x x x之间)
(R1)
- R n ( x ) R_{n}(x) Rn(x)= f ( n + 1 ) ( ξ ) ( n + 1 ) ! ( x − x 0 ) n + 1 \frac{f^{(n+1)}(\xi)}{(n+1)!}(x-x_0)^{n+1} (n+1)!f(n+1)(ξ)(x−x0)n+1,( ξ \xi ξ在 x 0 x_0 x0和 x x x之间)
误差估计式
- 若对于某个固定的 n n n,当 x ∈ U ( x 0 ) x\in{U(x_0)} x∈U(x0)邻域时, ∣ f ( n + 1 ) ( x ) ∣ ⩽ M |f^{(n+1)}(x)|\leqslant{M} ∣f(n+1)(x)∣⩽M(函数 f ( n + 1 ) ( x ) f^{(n+1)}(x) f(n+1)(x)在邻域 U ( x 0 ) U(x_0) U(x0)内局部有界),则可以估计误差的上限(记为 R M R_{M} RM):
- M M M不一定是常数,可能是函数 M ( x ) M(x) M(x)
- 例如 f ( x ) = e x f(x)=e^{x} f(x)=ex,其 ∣ f ( n + 1 ) ( x ) ∣ |f^{(n+1)}(x)| ∣f(n+1)(x)∣= ∣ e x ∣ ⩽ e ∣ x ∣ |e^{x}|\leqslant{e^{|x|}} ∣ex∣⩽e∣x∣
- 进行不等式放大: ∣ R n ( x ) ∣ ⩽ M ( n + 1 ) ! ∣ x − x 0 ∣ n + 1 |R_n(x)|\leqslant{\frac{M}{(n+1)!}|x-x_0|^{n+1}} ∣Rn(x)∣⩽(n+1)!M∣x−x0∣n+1= R M R_{M} RM
(0)
; - 该公式给出了估计误差的一个上限
- M M M不一定是常数,可能是函数 M ( x ) M(x) M(x)
麦克劳林(Maclaurin)公式
-
在Peano型泰勒公式中,
- f ( x ) f(x) f(x)= p n ( x ) + R n ( x ) p_n(x)+R_n(x) pn(x)+Rn(x)
(1)
- = f ( x 0 ) + f ′ ( x 0 ) ( x − x 0 ) + 1 2 ! f ′ ′ ( x 0 ) ( x − x 0 ) 2 + ⋯ f(x_0)+f'(x_0)(x-x_0)+\frac{1}{2!}f''(x_0)(x-x_0)^2+\cdots f(x0)+f′(x0)(x−x0)+2!1f′′(x0)(x−x0)2+⋯+ 1 n ! f ( n ) ( x 0 ) ( x − x 0 ) n \frac{1}{n!}f^{(n)}(x_0)(x-x_0)^{n} n!1f(n)(x0)(x−x0)n+ R n ( x ) R_n(x) Rn(x)
- = ∑ k = 0 n 1 k ! f ( k ) ( x 0 ) ( x − x 0 ) k \sum_{k=0}^{n}\frac{1}{k!}f^{(k)}(x_0)(x-x_0)^{k} ∑k=0nk!1f(k)(x0)(x−x0)k+ R n ( x ) R_n(x) Rn(x)
(2)
- f ( x ) f(x) f(x)= p n ( x ) + R n ( x ) p_n(x)+R_n(x) pn(x)+Rn(x)
-
若取 x 0 = 0 x_0=0 x0=0则
-
带有Peano余项的Taylor公式表示为
- f ( x ) f(x) f(x)= ∑ k = 0 n 1 k ! f ( k ) ( 0 ) ( x ) k \sum_{k=0}^{n}\frac{1}{k!}f^{(k)}(0)(x)^{k} ∑k=0nk!1f(k)(0)(x)k+ o ( ( x ) n ) o((x)^{n}) o((x)n)
- = f ( 0 ) + f ′ ( 0 ) x + 1 2 ! f ′ ′ ( 0 ) x 2 f(0)+f'(0)x+\frac{1}{2!}f''(0)x^2 f(0)+f′(0)x+2!1f′′(0)x2+ ⋯ \cdots ⋯+ 1 n ! f ( n ) ( 0 ) x n \frac{1}{n!}f^{(n)}(0)x^n n!1f(n)(0)xn+ o ( x n ) o(x^{n}) o(xn)
(3)
- = f ( 0 ) + f ′ ( 0 ) x + 1 2 ! f ′ ′ ( 0 ) x 2 f(0)+f'(0)x+\frac{1}{2!}f''(0)x^2 f(0)+f′(0)x+2!1f′′(0)x2+ ⋯ \cdots ⋯+ 1 n ! f ( n ) ( 0 ) x n \frac{1}{n!}f^{(n)}(0)x^n n!1f(n)(0)xn+ o ( x n ) o(x^{n}) o(xn)
- 此时公式也称为:带有Peano余项的Maclaurin公式,
- f ( x ) f(x) f(x)= ∑ k = 0 n 1 k ! f ( k ) ( 0 ) ( x ) k \sum_{k=0}^{n}\frac{1}{k!}f^{(k)}(0)(x)^{k} ∑k=0nk!1f(k)(0)(x)k+ o ( ( x ) n ) o((x)^{n}) o((x)n)
-
带有Lagrange余项的Taylor公式
- R n ( x ) ∣ x 0 = 0 R_{n}(x)|_{x_0=0} Rn(x)∣x0=0= f ( n + 1 ) ( ξ ) ( n + 1 ) ! x n + 1 \frac{f^{(n+1)}(\xi)}{(n+1)!}x^{n+1} (n+1)!f(n+1)(ξ)xn+1,( ξ \xi ξ在 x 0 x_0 x0和 x x x之间)
- 若令 ξ = θ x \xi=\theta{x} ξ=θx, ( θ ∈ ( 0 , 1 ) ) (\theta\in(0,1)) (θ∈(0,1)),则 R n ( x ) ∣ x 0 = 0 R_{n}(x)|_{x_0=0} Rn(x)∣x0=0= f ( n + 1 ) ( θ x ) ( n + 1 ) ! x n + 1 \frac{f^{(n+1)}(\theta x)}{(n+1)!}x^{n+1} (n+1)!f(n+1)(θx)xn+1, ( θ ∈ ( 0 , 1 ) ) (\theta\in(0,1)) (θ∈(0,1))
(R2)
- f ( x ) f(x) f(x)= ∑ k = 0 n 1 k ! f ( k ) ( 0 ) ( x ) k \sum_{k=0}^{n}\frac{1}{k!}f^{(k)}(0)(x)^{k} ∑k=0nk!1f(k)(0)(x)k+ f ( n + 1 ) ( θ x ) ( n + 1 ) ! x n + 1 \frac{f^{(n+1)}(\theta x)}{(n+1)!}x^{n+1} (n+1)!f(n+1)(θx)xn+1
- 即 f ( x ) f(x) f(x)= f ( 0 ) + f ′ ( 0 ) x + 1 2 ! f ′ ′ ( 0 ) x 2 f(0)+f'(0)x+\frac{1}{2!}f''(0)x^2 f(0)+f′(0)x+2!1f′′(0)x2+ ⋯ \cdots ⋯+ 1 n ! f ( n ) ( 0 ) x n \frac{1}{n!}f^{(n)}(0)x^n n!1f(n)(0)xn+ f ( n + 1 ) ( θ x ) ( n + 1 ) ! x n + 1 \frac{f^{(n+1)}(\theta x)}{(n+1)!}x^{n+1} (n+1)!f(n+1)(θx)xn+1
(4)
- 即 f ( x ) f(x) f(x)= f ( 0 ) + f ′ ( 0 ) x + 1 2 ! f ′ ′ ( 0 ) x 2 f(0)+f'(0)x+\frac{1}{2!}f''(0)x^2 f(0)+f′(0)x+2!1f′′(0)x2+ ⋯ \cdots ⋯+ 1 n ! f ( n ) ( 0 ) x n \frac{1}{n!}f^{(n)}(0)x^n n!1f(n)(0)xn+ f ( n + 1 ) ( θ x ) ( n + 1 ) ! x n + 1 \frac{f^{(n+1)}(\theta x)}{(n+1)!}x^{n+1} (n+1)!f(n+1)(θx)xn+1
-
麦克劳林近似公式
- Maclaurin多项式: p n ( x ) ∣ x 0 = 0 p_{n}(x)|{x_0=0} pn(x)∣x0=0= ∑ k = 0 n 1 k ! f ( k ) ( 0 ) ( x ) k \sum{k=0}^{n}\frac{1}{k!}f^{(k)}(0)(x)^{k} ∑k=0nk!1f(k)(0)(x)k= f ( 0 ) + f ′ ( 0 ) x + 1 2 ! f ′ ′ ( 0 ) x 2 f(0)+f'(0)x+\frac{1}{2!}f''(0)x^2 f(0)+f′(0)x+2!1f′′(0)x2+ ⋯ \cdots ⋯+ 1 n ! f ( n ) ( 0 ) x n \frac{1}{n!}f^{(n)}(0)x^n n!1f(n)(0)xn
- Maclaurin近似公式: f ( x ) ≈ p n ( x ) ∣ x 0 = 0 f(x)\approx{p_{n}(x)|_{x_0=0}} f(x)≈pn(x)∣x0=0
- 此时,误差估计式 写成 ∣ R n ( x ) ∣ ⩽ M ( n + 1 ) ! ∣ x ∣ n + 1 |R_{n}(x)|\leqslant{\frac{M}{(n+1)!}|x|^{n+1}} ∣Rn(x)∣⩽(n+1)!M∣x∣n+1
小结
-
被逼近函数=逼近函数+误差
-
被逼近函数可以用逼近函数 p n ( x ) p_n(x) pn(x)来估计,该估计的误差 可以用 R n ( x ) R_n(x) Rn(x)来估计
-
从余项和误差估计式可以看出,对于给定的泰勒公式 f ( x ) = p n ( x ) + R n ( x ) f(x)=p_{n}(x)+R_{n}(x) f(x)=pn(x)+Rn(x)
- 为了体现近似源 x 0 x_0 x0,可写成 f ( x , x 0 ) = p n ( x , x 0 ) + R n ( x , x 0 ) f(x,x_0)=p_{n}(x,x_0)+R_{n}(x,x_0) f(x,x0)=pn(x,x0)+Rn(x,x0),用该公式中的 p n ( x , x 0 ) p_n(x,x_0) pn(x,x0)来估计 f ( x ) f(x) f(x)的取值
- 当 x x x离 x 0 x_0 x0越远,( ∣ x − x 0 ∣ |x-x_0| ∣x−x0∣越大),则估计误差 ∣ R n ( x ) ∣ |R_n(x)| ∣Rn(x)∣越大: ∣ f ( n + 1 ) ( ξ ) ( n + 1 ) ! ( x − x 0 ) n + 1 ∣ |\frac{f^{(n+1)}(\xi)}{(n+1)!}(x-x_0)^{n+1}| ∣(n+1)!f(n+1)(ξ)(x−x0)n+1∣
- 为了提高精度,可以提高 n n n的大小
- 因为误差式中有一个分母 ( n + 1 ) ! (n+1)! (n+1)!阶乘的增长速度快于指数 ( x − x 0 ) n + 1 (x-x_0)^{n+1} (x−x0)n+1(通过求极限可以证明,即使 x − x 0 x-x_0 x−x0不变,只要使得, n → ∞ n\to{\infin} n→∞时,就有 R M → 0 R_{M}\to{0} RM→0,从而 ∣ R n ( x ) ∣ → 0 |R_n(x)|\to{0} ∣Rn(x)∣→0)
- 泰勒公式 n n n阶逼近的方法和一般的逼近手段不同,例如一阶微分逼近 f ( x ) ≈ f ′ ( x 0 ) + f ′ ( x 0 ) ( x − x 0 ) f(x)\approx{f'(x_0)+f'(x_0)(x-x_0)} f(x)≈f′(x0)+f′(x0)(x−x0)需要靠 x → x 0 x\to{x_0} x→x0来提高精度,而泰勒公式除了可通过 x → x 0 x\to{x_0} x→x0提高精度,还可以选择提高逼近阶数 n n n来实现
-
通过对一般的泰勒公式中的 x 0 x_0 x0取定为 0 0 0,得到Maclaurin公式,该公式形式上和计算上比一般形式的泰勒公式更加简单,而且同样可以通过提高逼近阶数 n n n来提高逼近精度
-
只要阶数够高(存在足够高阶的导数),Maclaurin公式做到任意精度的逼近( n → ∞ n\to{\infin} n→∞,时误差的极限为0)
逼近公式的截断应用
- 方便起见,通常使用Maclaurin近似公式来作函数的近似表示和高精度估计,一般形式的Taylor公式比较少直接用来估计,Maclaurin公式简单
- 通常 n n n不需要太大就有比较高的精度了,例如 n = 2 n=2 n=2
例
-
f ( x ) = e x f(x)=e^{x} f(x)=ex的带有Lagrange余项的 n n n阶Maclaurin公式
n f ( n ) ( x ) f^{(n)}(x) f(n)(x) f ( n ) ( 0 ) f^{(n)}(0) f(n)(0) 0 e x e^{x} ex 1 1 e x e^{x} ex 1 2 e x e^{x} ex 1 ⋯ \cdots ⋯ ⋯ \cdots ⋯ ⋯ \cdots ⋯ n n n e x e^{x} ex 1 n + 1 n+1 n+1 e x e^{x} ex f ( n + 1 ) ( θ x ) f^{(n+1)}(\theta{x}) f(n+1)(θx)= e θ x e^{\theta{x}} eθx -
e x e^{x} ex= f ( 0 ) + f ′ ( 0 ) x + 1 2 ! f ′ ′ ( 0 ) x 2 f(0)+f'(0)x+\frac{1}{2!}f''(0)x^2 f(0)+f′(0)x+2!1f′′(0)x2+ ⋯ \cdots ⋯+ 1 n ! f ( n ) ( 0 ) x n \frac{1}{n!}f^{(n)}(0)x^n n!1f(n)(0)xn+ f ( n + 1 ) ( θ x ) ( n + 1 ) ! x n + 1 \frac{f^{(n+1)}(\theta x)}{(n+1)!}x^{n+1} (n+1)!f(n+1)(θx)xn+1
- = 1 + x + 1 2 ! x 2 + ⋯ + 1 n ! x n 1+x+\frac{1}{2!}x^2+\cdots+\frac{1}{n!}x^{n} 1+x+2!1x2+⋯+n!1xn+ e θ x ( n + 1 ) ! x n + 1 \frac{e^{\theta{x}}}{(n+1)!}x^{n+1} (n+1)!eθxxn+1, θ ∈ ( 0 , 1 ) \theta\in(0,1) θ∈(0,1)
(1)
- = 1 + x + 1 2 ! x 2 + ⋯ + 1 n ! x n 1+x+\frac{1}{2!}x^2+\cdots+\frac{1}{n!}x^{n} 1+x+2!1x2+⋯+n!1xn+ e θ x ( n + 1 ) ! x n + 1 \frac{e^{\theta{x}}}{(n+1)!}x^{n+1} (n+1)!eθxxn+1, θ ∈ ( 0 , 1 ) \theta\in(0,1) θ∈(0,1)
-
误差: ∣ R n ( x ) ∣ |R_{n}(x)| ∣Rn(x)∣= ∣ e θ x ( n + 1 ) ! x n + 1 ∣ |\frac{e^{\theta{x}}}{(n+1)!}x^{n+1}| ∣(n+1)!eθxxn+1∣< e ∣ x ∣ ( n + 1 ) ! ∣ x ∣ n + 1 \frac{e^{{|x|}}}{(n+1)!}|x|^{n+1} (n+1)!e∣x∣∣x∣n+1
- 例如估算 x = 1 x=1 x=1,即 f ( 1 ) f(1) f(1),由公式 e 1 ≈ 1 + 1 + 1 2 ! + ⋯ + 1 n ! e^{1}\approx 1+1+\frac{1}{2!}+\cdots+\frac{1}{n!} e1≈1+1+2!1+⋯+n!1
- 此时误差为 ∣ R n ∣ < e 1 ( n + 1 ) ! |R_n|<\frac{e^1}{(n+1)!} ∣Rn∣<(n+1)!e1,也可以更加保守,进一步放大误差上界 3 ( n + 1 ) ! \frac{3}{(n+1)!} (n+1)!3,当
- n = 10 n=10 n=10时,可以得 e ≈ 2.718282 e\approx{2.718282} e≈2.718282,且保证其误差不超过 1 0 − 6 10^{-6} 10−6
-