爱的深处不正涌流着企图和对方分毫不差的这种不可能实现的热望吗?这种热望不正驱使着人们将不可能由另一极端变成可能,从而引导他们走向那种悲剧性的叛离之路吗?既然相爱的人不可能完全相似,那么不如干脆使他们致力于相互之间毫不相似,使这样的叛离完整地作用于媚态。
# 第一章 相关基础数学知识
Theorem : If the function f f f is differentiable at x 0 x_0 x 0 , then f f f is continuous at x 0 x_0 x 0 .
Notation : C [ a , b ] C[a,b] C [ a , b ] stands for the set of continuous function defined in [ a , b ] [a,b] [ a , b ] .
Theorem (Generalized Rolle’s Theorem): Suppose f ∈ C [ a , b ] f\in C[a,b] f ∈ C [ a , b ] is n n n times differentiable on ( a , b ) (a,b) ( a , b ) . If f ( x ) f(x) f ( x ) is zero at the n + 1 n+1 n + 1 distinct numbers x 0 , x 1 , . . . , x n x_0,x_1,...,x_n x 0 , x 1 , . . . , x n in the [ a , b ] [a,b] [ a , b ] , then a number c c c in the ( a , b ) (a,b) ( a , b ) exists with f ( n ) ( c ) = 0 f^{(n)}(c)=0 f ( n ) ( c ) = 0
Theorem (Taylor’s Theorem): f ( x ) = P n ( x ) + R n ( x ) f(x)=P_n(x)+R_n(x) f ( x ) = P n ( x ) + R n ( x ) , P n ( x ) = ∑ k = 0 n f ( k ) ( x ) k ! ( x − x 0 ) k P_n(x)=\sum_{k=0}^n\frac{f^{(k)}(x)}{k!}(x-x_0)^{k} P n ( x ) = ∑ k = 0 n k ! f ( k ) ( x ) ( x − x 0 ) k , R n ( x ) = f ( n + 1 ) ( ξ ( x ) ) ( n + 1 ) ! ( x − x 0 ) n + 1 R_n(x)=\frac{f^{(n+1)(\xi(x))}}{(n+1)!}(x-x_0)^{n+1} R n ( x ) = ( n + 1 ) ! f ( n + 1 ) ( ξ ( x ) ) ( x − x 0 ) n + 1 . ξ ( x ) \xi(x) ξ ( x ) is between x x x and x 0 x_0 x 0 .
Definition : If p ∗ p^* p ∗ is an approximation to p p p , the absolute error is ∣ p − p ∗ ∣ |p-p^*| ∣ p − p ∗ ∣ , and the relative error is ∣ p − p ∗ ∣ ∣ p ∣ \frac{|p-p^*|}{|p|} ∣ p ∣ ∣ p − p ∗ ∣ , provided that p ≠ 0 p\neq 0 p = 0 .
Definition : The number p ∗ p^* p ∗ is said to approximate p p p to t t t significant digit if t t t is the largest nonnegative integer for which ∣ p − p ∗ ∣ ∣ p ∣ < 5 × 1 0 − t \frac{|p-p^*|}{|p|}<5\times 10^{-t} ∣ p ∣ ∣ p − p ∗ ∣ < 5 × 1 0 − t .
Definition : An algorithm is said to be stable when small changes in the initial data can produce correspondingly small changes in final results. Some algorithm are stable only for certain choices of initial data, these cases are called conditionally stable.
Definition : Suppose that E 0 E_0 E 0 denotes an initial error and E n E_n E n represents the magnitude of an error after n n n subsequent operations.
If E n ≈ n C E 0 E_n\approx nCE_0 E n ≈ n C E 0 , where C C C is a constant independent of n n n , then the growth of error is said to be linear .
If E n ≈ C n E 0 E_n\approx C^nE_0 E n ≈ C n E 0 , for some C > 1 C>1 C > 1 , then the growth of error is said to be exponential .
Definition : Suppose { β n } n = 1 ∞ \{\beta_n\}^{\infty}_{n=1} { β n } n = 1 ∞ is a sequence known to converge to zero, and { α n } n = 1 ∞ \{\alpha_n\}^{\infty}_{n=1} { α n } n = 1 ∞ converges to a number α \alpha α .
If a positive constant K K K exists with ∣ α n − α ∣ ≤ K ∣ β n ∣ |\alpha_n-\alpha|\leq K|\beta_n| ∣ α n − α ∣ ≤ K ∣ β n ∣ for large n, then we say that { α } n = 1 ∞ \{\alpha\}^\infty_{n=1} { α } n = 1 ∞ converges to α \alpha α with the rate of convergence O ( β n ) O(\beta_n) O ( β n ) , writing α n = α + O ( β n ) \alpha_n=\alpha+O(\beta_n) α n = α + O ( β n ) .
Property (Operator errors):
α n + β n = α + β + O ( ε α + ε β ) \alpha_n+\beta_n=\alpha+\beta+O(\varepsilon_\alpha+\varepsilon_\beta) α n + β n = α + β + O ( ε α + ε β ) .
α n β n = α β + α O ( ε β ) + β O ( ε α ) + O ( ε α ε β ) \alpha_n\beta_n=\alpha\beta+\alpha O(\varepsilon_\beta)+\beta O(\varepsilon_\alpha)+O(\varepsilon_\alpha\varepsilon_\beta) α n β n = α β + α O ( ε β ) + β O ( ε α ) + O ( ε α ε β ) .
Example : α n = n + 1 n 2 , β n = 1 n \alpha_n=\frac{n+1}{n^2},\beta_n=\frac{1}{n} α n = n 2 n + 1 , β n = n 1 . ∣ α n − 0 ∣ < n + n n 2 = 2 × 1 n |\alpha_n-0|<\frac{n+n}{n^2}=2\times\frac{1}{n} ∣ α n − 0 ∣ < n 2 n + n = 2 × n 1 . So α n = 0 + O ( 1 n ) \alpha_n=0+O(\frac{1}{n}) α n = 0 + O ( n 1 ) .
Definition : Suppose
lim x → 0 G ( x ) = 0 , lim x → 0 F ( x ) = L \lim_{x\rightarrow 0}G(x)=0,\lim_{x\rightarrow 0}F(x)=L
x → 0 lim G ( x ) = 0 , x → 0 lim F ( x ) = L
If a positive constant K K K exists with ∣ F ( x ) − L ∣ ≤ K ∣ G ( x ) ∣ |F(x)-L|\leq K|G(x)| ∣ F ( x ) − L ∣ ≤ K ∣ G ( x ) ∣ , then we write F ( x ) = L + O ( G ( x ) ) F(x)=L+O(G(x)) F ( x ) = L + O ( G ( x ) ) .
Example : c o s ( x ) + 1 2 x 2 = 1 + O ( x 4 ) cos(x)+\frac{1}{2}x^2=1+O(x^4) c o s ( x ) + 2 1 x 2 = 1 + O ( x 4 ) .
Definition : A mathematical problem is said to be well-posed if a solution:
exists,
is unique,
depends continuously on input data
Otherwise, the problem is ill-posed .
# 第二章 一元方程的近似解
Definition : The system of m m m nonlinear equations in n n n unknowns can alternatively be represented by defining a function f f f , mapping R n \mathbb{R}^n R n into R m \mathbb{R}^m R m by
f ( x ) = ( f 1 ( x ) , . . . , f m ( x ) ) T \textbf{f}(\textbf{x})=(f_1(\textbf{x}),...,f_m(\textbf{x}))^T
f ( x ) = ( f 1 ( x ) , . . . , f m ( x ) ) T
The function f 1 , f 2 , . . , f m f_1,f_2,..,f_m f 1 , f 2 , . . , f m are the coordinate functions of f .
The function f is continuous at x 0 ∈ D x_0\in D x 0 ∈ D provided lim x → x 0 f ( x ) = f ( x 0 ) \lim_{x\rightarrow x_0}\textbf{f}(\textbf{x})=\textbf{f}(\textbf{x}_0) lim x → x 0 f ( x ) = f ( x 0 ) .
Theorem : Let f f f be a function from D ⊂ R n D\subset \mathbb{R}^n D ⊂ R n into R \mathbb{R} R and x 0 ∈ D x_0\in D x 0 ∈ D . If
∣ ∂ f ( x ) ∂ x j ∣ ≤ K , j = 1 , 2 , . . . , n |\frac{\partial f(\textbf{x})}{\partial x_j}|\leq K,j=1,2,...,n
∣ ∂ x j ∂ f ( x ) ∣ ≤ K , j = 1 , 2 , . . . , n
whenever ∣ x j − x 0 j ∣ ≤ δ |x_j-x_{0j}|\leq\delta ∣ x j − x 0 j ∣ ≤ δ , then f f f is continuous at x 0 \textbf{x}_0 x 0 .
# Bisection (Binary search).
Theorem : Suppose that f ∈ C [ a , b ] f\in C[a,b] f ∈ C [ a , b ] and f ( a ) f ( b ) < 0 f(a)f(b)<0 f ( a ) f ( b ) < 0 . The Bisection method generates a sequence { p n } 1 ∞ \{p_n\}^\infty_1 { p n } 1 ∞ approximating a zero point p p p of f f f (f ( p ) = 0 f(p)=0 f ( p ) = 0 ) with
∣ p n − p ∣ ≤ b − a 2 n |p_n-p|\leq\frac{b-a}{2^ n}
∣ p n − p ∣ ≤ 2 n b − a
So p n = p + O ( 1 2 n ) p_n=p+O(\frac{1}{2^n}) p n = p + O ( 2 n 1 ) .
# Fixed Point Method
Definition : Fixed point of given function g : R → R g:\mathbb{R}\rightarrow\mathbb{R} g : R → R is value x ∗ x^* x ∗ such that x ∗ = g ( x ∗ ) x^*=g(x^*) x ∗ = g ( x ∗ )
For given equation f ( x ) = 0 f(x)=0 f ( x ) = 0 , there may be many equivalent fixed point problems x = g ( x ) x=g(x) x = g ( x ) with different choices for g.
Example : f ( x ) = 0 ⇔ g ( x ) = x f(x)=0\Leftrightarrow g(x)=x f ( x ) = 0 ⇔ g ( x ) = x , we can choose g ( x ) = x − f ( x ) g(x)=x-f(x) g ( x ) = x − f ( x ) or g ( x ) = x + 3 f ( x ) g(x)=x+3f(x) g ( x ) = x + 3 f ( x ) .
To approximate the fixed point of a function g ( x ) g(x) g ( x ) , we choose an initial approximation p 0 p_0 p 0 , and generate the sequence by:
p n = g ( p n − 1 ) , n = 1 , 2 , 3 , . . . p_n=g(p_{n-1}),n=1,2,3,...
p n = g ( p n − 1 ) , n = 1 , 2 , 3 , . . .
If the sequence converges to p p p and g ( x ) g(x) g ( x ) is continuous, then we have
p = lim n → ∞ p n = lim n → ∞ g ( p n ) = g ( lim n → ∞ p n ) = g ( p ) p=\lim_{n\rightarrow\infty}p_n=\lim_{n\rightarrow\infty}g(p_n)=g(\lim_{n\rightarrow \infty}p_n)=g(p)
p = n → ∞ lim p n = n → ∞ lim g ( p n ) = g ( n → ∞ lim p n ) = g ( p )
This technique is called fixed point iteration (or functional iteration).
Theorem : If g ( x ) ∈ C [ a , b ] g(x)\in C[a,b] g ( x ) ∈ C [ a , b ] and g ( x ) ∈ [ a , b ] g(x)\in[a,b] g ( x ) ∈ [ a , b ] for all x ∈ [ a , b ] x\in[a,b] x ∈ [ a , b ] , then g ( x ) g(x) g ( x ) has a fixed point in [ a , b ] [a,b] [ a , b ] . What’s more, if g ′ ( x ) g'(x) g ′ ( x ) exists on ( a , b ) (a,b) ( a , b ) and a positive constant k < 1 k<1 k < 1 exists with ∣ g ′ ( x ) ∣ ≤ k |g'(x)|\leq k ∣ g ′ ( x ) ∣ ≤ k for all x ∈ ( a , b ) x\in(a,b) x ∈ ( a , b ) , then the fixed point is unique.
The proof is easily obtained by proof by contradiction considering the geometric feature.
Corollary : Obviously we have p n − p = ∣ g ( p n − 1 ) − g ( p ) ∣ = ∣ g ′ ( ξ ) ∣ ∣ p n − 1 − p ∣ p_n-p=|g(p_{n-1})-g(p)|=|g'(\xi)||p_{n-1}-p| p n − p = ∣ g ( p n − 1 ) − g ( p ) ∣ = ∣ g ′ ( ξ ) ∣ ∣ p n − 1 − p ∣ where ξ ∈ ( a , b ) \xi\in(a,b) ξ ∈ ( a , b ) . So ∣ p n − p ∣ ≤ k n ∣ p 0 − p ∣ |p_n-p|\leq k^n|p_0-p| ∣ p n − p ∣ ≤ k n ∣ p 0 − p ∣ . If k < 1 k<1 k < 1 , the fixed point is unique and we have p n = p + O ( k n ) p_n=p+O(k^n) p n = p + O ( k n ) .
What’s more, ∣ p n − p ∣ ≤ k n ∣ p 0 − p ∣ ≤ k n m a x ( p 0 − a , b − p 0 ) |p_n-p|\leq k^n|p_0-p|\leq k^nmax(p_0-a,b-p_0) ∣ p n − p ∣ ≤ k n ∣ p 0 − p ∣ ≤ k n m a x ( p 0 − a , b − p 0 ) , and
∣ p n − p 0 ∣ ≤ ∣ p n − p n − 1 ∣ + ∣ p n − 1 − p n − 2 ∣ + . . . + ∣ p 1 − p 0 ∣ ≤ k n 1 − k ∣ p 1 − p 0 ∣ |p_n-p_0|\leq |p_n-p_{n-1}|+|p_{n-1}-p_{n-2}|+...+|p_1-p_0|\leq \frac{k^n}{1-k}|p_1-p_0|
∣ p n − p 0 ∣ ≤ ∣ p n − p n − 1 ∣ + ∣ p n − 1 − p n − 2 ∣ + . . . + ∣ p 1 − p 0 ∣ ≤ 1 − k k n ∣ p 1 − p 0 ∣
# Newton’s Method
Suppose that f ∈ C 2 [ a , b ] f\in C^2[a,b] f ∈ C 2 [ a , b ] and x ∗ x^* x ∗ is a solution for f ( x ) = 0 f(x)=0 f ( x ) = 0 . Let x ˉ ∈ [ a , b ] \bar{x}\in[a,b] x ˉ ∈ [ a , b ] e an approximation to x ∗ x^* x ∗ such that f ′ ( x ˉ ) ≠ 0 f'(\bar{x})\neq 0 f ′ ( x ˉ ) = 0 and ∣ x ˉ − x ∗ ∣ |\bar{x}-x^*| ∣ x ˉ − x ∗ ∣ is very small. Due to the Taylor polynomial:
f ( x ) = f ( x ˉ ) + ( x − x ˉ ) f ′ ( x ˉ ) + ( x − x ˉ ) 2 2 f ′ ′ ( ξ ) f(x)=f(\bar{x})+(x-\bar{x})f'(\bar{x})+\frac{(x-\bar{x})^2}{2}f''(\xi)
f ( x ) = f ( x ˉ ) + ( x − x ˉ ) f ′ ( x ˉ ) + 2 ( x − x ˉ ) 2 f ′ ′ ( ξ )
where ξ \xi ξ lies between x x x and x ˉ \bar{x} x ˉ . So
0 = f ( x ∗ ) ≈ f ( x ˉ ) + ( x ∗ − x ˉ ) f ′ ( x ˉ ) x ∗ ≈ x ˉ − f ( x ˉ ) f ′ ( x ˉ ) 0=f(x^*)\approx f(\bar{x})+(x^*-\bar{x})f'(\bar{x})\\
x^*\approx\bar{x}-\frac{f(\bar{x})}{f'(\bar{x})}
0 = f ( x ∗ ) ≈ f ( x ˉ ) + ( x ∗ − x ˉ ) f ′ ( x ˉ ) x ∗ ≈ x ˉ − f ′ ( x ˉ ) f ( x ˉ )
Theorem : Let f ∈ C 2 [ a , b ] f\in C^2[a,b] f ∈ C 2 [ a , b ] , if p ∈ [ a , b ] p\in[a,b] p ∈ [ a , b ] is such that f ( p ) = 0 f(p)=0 f ( p ) = 0 and f ′ ( p ) ≠ 0 f'(p)\neq 0 f ′ ( p ) = 0 , then there exists a δ > 0 \delta>0 δ > 0 such that for any p 0 ∈ [ p − δ , p + δ ] p_0\in[p-\delta,p+\delta] p 0 ∈ [ p − δ , p + δ ] , p n = p n − 1 − f ( p n − 1 ) f ′ ( p n − 1 ) p_n=p_{n-1}-\frac{f(p_{n-1})}{f'(p_{n-1})} p n = p n − 1 − f ′ ( p n − 1 ) f ( p n − 1 ) converges to p p p .
The proof is based on the fixed point iteration g ( x ) = x − f ( x ) f ′ ( x ) g(x)=x-\frac{f(x)}{f'(x)} g ( x ) = x − f ′ ( x ) f ( x ) .
# Secant Method
Similar to Newton’s method:
p n = p n − 1 − f ( p n − 1 ) f ( p n − 1 ) − f ( p n − 2 ) p n − 1 − p n − 2 p_{n}=p_{n-1}-\frac{f(p_{n-1})}{\frac{f(p_{n-1})-f(p_{n-2})}{p_{n-1}-p_{n-2}}}
p n = p n − 1 − p n − 1 − p n − 2 f ( p n − 1 ) − f ( p n − 2 ) f ( p n − 1 )
# Method of False Position
Improved Secant Method. If f ( p 0 ) f ( p 1 ) < 0 f(p_0)f(p_1)<0 f ( p 0 ) f ( p 1 ) < 0 , we can chose:
p n = { p n − 1 − f ( p n − 1 ) f ( p n − 1 ) − f ( p n − 2 ) p n − 1 − p n − 2 p n − 1 − f ( p n − 1 ) f ( p n − 1 ) − f ( p n − 3 ) p n − 1 − p n − 3 p_n=\begin{cases}
p_{n-1}-\frac{f(p_{n-1})}{\frac{f(p_{n-1})-f(p_{n-2})}{p_{n-1}-p_{n-2}}}\\
p_{n-1}-\frac{f(p_{n-1})}{\frac{f(p_{n-1})-f(p_{n-3})}{p_{n-1}-p_{n-3}}}\\
\end{cases}
p n = ⎩ ⎪ ⎪ ⎨ ⎪ ⎪ ⎧ p n − 1 − p n − 1 − p n − 2 f ( p n − 1 ) − f ( p n − 2 ) f ( p n − 1 ) p n − 1 − p n − 1 − p n − 3 f ( p n − 1 ) − f ( p n − 3 ) f ( p n − 1 )
dependent on f ( p n − 1 ) f ( p n − 2 ) < 0 f(p_{n-1})f(p_{n-2})<0 f ( p n − 1 ) f ( p n − 2 ) < 0 or f ( p n − 1 ) f ( p n − 3 ) < 0 f(p_{n-1})f(p_{n-3})<0 f ( p n − 1 ) f ( p n − 3 ) < 0 .
Line1 across ( p n − 1 , f ( p n − 1 ) ) (p_{n-1},f(p_{n-1})) ( p n − 1 , f ( p n − 1 ) ) , ( p n − 2 , f ( p n − 2 ) ) (p_{n-2},f(p_{n-2})) ( p n − 2 , f ( p n − 2 ) ) .
Line2 across ( p n − 1 , f ( p n − 1 ) ) (p_{n-1},f(p_{n-1})) ( p n − 1 , f ( p n − 1 ) ) , ( p n − 3 , f ( p n − 3 ) ) (p_{n-3},f(p_{n-3})) ( p n − 3 , f ( p n − 3 ) ) .
We can choose which line to use by where zero point locates: [ p n − 2 , p n − 1 ] [p_{n-2},p_{n-1}] [ p n − 2 , p n − 1 ] or [ p n − 1 , p n − 3 ] [p_{n-1},p_{n-3}] [ p n − 1 , p n − 3 ] .
# Error Analysis for Iteration
Definition : If positive constants λ \lambda λ and α \alpha α exists with
lim n → ∞ ∣ p n + 1 − p ∣ ∣ p n − p ∣ α = λ \lim_{n\rightarrow\infty}\frac{|p_{n+1}-p|}{|p_n-p|^{\alpha}}=\lambda
n → ∞ lim ∣ p n − p ∣ α ∣ p n + 1 − p ∣ = λ
then { p n } n = 0 ∞ \{p_n\}^\infty_{n=0} { p n } n = 0 ∞ converges to p p p of order α \alpha α , with asymptotic error constant λ \lambda λ .
Higher the order is, more rapidly the sequence converges.
# Fixed point method
Theorem : If ∣ g ′ ( x ) ∣ ≤ k < 1 |g'(x)|\leq k<1 ∣ g ′ ( x ) ∣ ≤ k < 1 for any x ∈ ( a , b ) x\in(a,b) x ∈ ( a , b ) , then the fixed point iteration converges linearly to the unique fixed point.
lim n → ∞ ∣ p n + 1 − p ∣ ∣ p n − p ∣ 1 = lim n → ∞ ∣ g ( p n ) − g ( p ) ∣ ∣ p n − p ∣ = lim n → ∞ ∣ g ′ ( ξ n ) ∣ = ∣ g ′ ( p ) ∣ = C o n s t a n t ξ n ∈ ( p n , p ) \lim_{n\rightarrow\infty}\frac{|p_{n+1}-p|}{|p_n-p|^1}=\lim_{n\rightarrow\infty}\frac{|g(p_n)-g(p)|}{|p_n-p|}=\lim_{n\rightarrow\infty}|g'(\xi_n)|=|g'(p)|=Constant\\
\xi_n\in(p_n,p)
n → ∞ lim ∣ p n − p ∣ 1 ∣ p n + 1 − p ∣ = n → ∞ lim ∣ p n − p ∣ ∣ g ( p n ) − g ( p ) ∣ = n → ∞ lim ∣ g ′ ( ξ n ) ∣ = ∣ g ′ ( p ) ∣ = C o n s t a n t ξ n ∈ ( p n , p )
So α = 1 \alpha=1 α = 1 。If g ′ ( p ) = 0 g'(p)=0 g ′ ( p ) = 0 , then the order might be higher.
What’s more, if g ′ ( p ) = 0 g'(p)=0 g ′ ( p ) = 0 and ∣ g ′ ′ ( p ) ∣ ≤ M |g''(p)|\leq M ∣ g ′ ′ ( p ) ∣ ≤ M , then we have:
lim n → ∞ ∣ p n + 1 − p ∣ ∣ p n − p ∣ 2 = lim n → ∞ ∣ g ( p n ) − g ( p ) ∣ ∣ p n − p ∣ 2 = lim n → ∞ ∣ g ( p ) + g ′ ( p ) ( p n − p ) + g ′ ′ ( ξ ) 2 ( p n − p ) 2 − g ( p ) ∣ ∣ p n − p ∣ 2 = lim n → ∞ ∣ g ′ ′ ( ξ ) ∣ 2 = M 2 \lim_{n\rightarrow\infty}\frac{|p_{n+1}-p|}{|p_n-p|^2}=\lim_{n\rightarrow\infty}\frac{|g(p_n)-g(p)|}{|p_n-p|^2}\\
=\lim_{n\rightarrow\infty}\frac{|g(p)+g'(p)(p_{n}-p)+\frac{g''(\xi)}{2}(p_n-p)^2-g(p)|}{|p_n-p|^2}\\
=\lim_{n\rightarrow\infty}\frac{|g''(\xi)|}{2}=\frac{M}{2}
n → ∞ lim ∣ p n − p ∣ 2 ∣ p n + 1 − p ∣ = n → ∞ lim ∣ p n − p ∣ 2 ∣ g ( p n ) − g ( p ) ∣ = n → ∞ lim ∣ p n − p ∣ 2 ∣ g ( p ) + g ′ ( p ) ( p n − p ) + 2 g ′ ′ ( ξ ) ( p n − p ) 2 − g ( p ) ∣ = n → ∞ lim 2 ∣ g ′ ′ ( ξ ) ∣ = 2 M
So α = 2 \alpha=2 α = 2 if the g ′ ′ ( x ) g''(x) g ′ ′ ( x ) has a bound.
If ∣ g ′ ( p ) ∣ > 1 |g'(p)|>1 ∣ g ′ ( p ) ∣ > 1 , then the iteration diverges with any starting point other than p.
# From Root to Fix point
For root finding problem f ( x ) = 0 f(x)=0 f ( x ) = 0 , we let g ( x ) g(x) g ( x ) be in the form
g ( x ) = x − ϕ ( x ) f ( x ) , ϕ ( x ) ≠ 0 g(x)=x-\phi(x)f(x),\phi(x)\neq 0
g ( x ) = x − ϕ ( x ) f ( x ) , ϕ ( x ) = 0
so g ( x ) = x ⇒ f ( x ) = 0 g(x)=x\Rightarrow f(x)=0 g ( x ) = x ⇒ f ( x ) = 0 .
Since g ′ ( x ) = 1 − ϕ ′ ( x ) f ( x ) − ϕ ( x ) f ′ ( x ) g'(x)=1-\phi'(x)f(x)-\phi(x)f'(x) g ′ ( x ) = 1 − ϕ ′ ( x ) f ( x ) − ϕ ( x ) f ′ ( x ) , let x = p x=p x = p , g ′ ( p ) = 1 − ϕ ( p ) f ′ ( p ) g'(p)=1-\phi(p)f'(p) g ′ ( p ) = 1 − ϕ ( p ) f ′ ( p ) , and g ′ ( p ) = 0 g'(p)=0 g ′ ( p ) = 0 if and only if ϕ ( x ) = 1 f ′ ( p ) \phi(x)=\frac{1}{f'(p)} ϕ ( x ) = f ′ ( p ) 1 ,
Definition : A solution p p p of f ( x ) = 0 f(x)=0 f ( x ) = 0 is a zero of multiplicity m m m of f ( x ) f(x) f ( x ) if for x ≠ p x\neq p x = p , we can write
f ( x ) = ( x − p ) m q ( x ) lim x → p q ( x ) ≠ 0 f(x)=(x-p)^mq(x)\\
\lim_{x\rightarrow p}q(x)\neq 0
f ( x ) = ( x − p ) m q ( x ) x → p lim q ( x ) = 0
when it comes to Newton’s method, g ( x ) = x − f ( x ) / f ′ ( x ) g(x)=x-f(x)/f'(x) g ( x ) = x − f ( x ) / f ′ ( x ) , we have
g ( x ) = x − ( x − p ) m q ( x ) m ( x − p ) m − 1 q ( x ) + ( x − p ) m q ′ ( x ) = x − ( x − p ) q ( x ) m q ( x ) + ( x − p ) q ′ ( x ) lim x → p g ′ ( x ) = 1 − 1 m ≠ 0 g(x)=x-\frac{(x-p)^mq(x)}{m(x-p)^{m-1}q(x)+(x-p)^mq'(x)}\\
=x-(x-p)\frac{q(x)}{mq(x)+(x-p)q'(x)}\\
\lim_{x\rightarrow p}g'(x)=1-\frac{1}{m}\neq 0
g ( x ) = x − m ( x − p ) m − 1 q ( x ) + ( x − p ) m q ′ ( x ) ( x − p ) m q ( x ) = x − ( x − p ) m q ( x ) + ( x − p ) q ′ ( x ) q ( x ) x → p lim g ′ ( x ) = 1 − m 1 = 0
注:这里我存疑,因为都是极限意义下,x = p x=p x = p 时g ( x ) g(x) g ( x ) 甚至无定义。
但这是数值计算,实际中x x x 和p p p 总有点差值的。
# Aitken’s Δ2 Method
Suppose { p n } n ∞ = 0 \{p_n\}^\infty_n=0 { p n } n ∞ = 0 is a linearly convergent sequence (α = 1 \alpha=1 α = 1 ) with limit p p p :
lim n → ∞ p n + 1 − p p n − p = λ ≠ 0 \lim_{n\rightarrow\infty}\frac{p_{n+1}-p}{p_n-p}=\lambda\neq 0
n → ∞ lim p n − p p n + 1 − p = λ = 0
So when n is large enough:
p n + 1 − p p n − p ≈ p n + 2 − p p n + 1 − p p ≈ p n − ( p n + 1 − p n ) 2 p n + 2 − 2 p n + 1 + p n \frac{p_{n+1}-p}{p_n-p}\approx\frac{p_{n+2}-p}{p_{n+1}-p}\\
p\approx p_n-\frac{(p_{n+1}-p_n)^2}{p_{n+2}-2p_{n+1}+p_n}
p n − p p n + 1 − p ≈ p n + 1 − p p n + 2 − p p ≈ p n − p n + 2 − 2 p n + 1 + p n ( p n + 1 − p n ) 2
Aitken’s Δ 2 \Delta^2 Δ 2 method is to define a new sequence:
q n = p n − ( p n + 1 − p n ) 2 p n + 2 − 2 p n + 1 + p n q_n=p_n-\frac{(p_{n+1}-p_n)^2}{p_{n+2}-2p_{n+1}+p_n}
q n = p n − p n + 2 − 2 p n + 1 + p n ( p n + 1 − p n ) 2
{ q n } n ∞ \{q_n\}^\infty_{n} { q n } n ∞ will converge to p p p more rapidly than { p n } \{p_n\} { p n } 。
Definition : The forward difference Δ p n \Delta p_n Δ p n of a sequence { p n } n ∞ \{p_n\}^\infty_n { p n } n ∞ is defined by:
Δ p n = p n + 1 − p n \Delta p_n=p_{n+1}-p_n
Δ p n = p n + 1 − p n
So q n = p n − ( Δ p n ) 2 Δ 2 p n q_n=p_n-\frac{(\Delta p_n)^2}{\Delta^2p_n} q n = p n − Δ 2 p n ( Δ p n ) 2 .
Theorem : lim n → ∞ q n − p p n − p = 0 \lim_{n\rightarrow\infty}\frac{q_n-p}{p_n-p}=0 lim n → ∞ p n − p q n − p = 0 , so q n q_n q n converges faster than p n p_n p n .
# Steffensen’s Method (Aitken’s Method for fixed point iteration)
Repeat:
{ p 0 p 1 = g ( p 0 ) p 2 = g ( p 1 ) p 3 = p 0 − ( Δ p 0 ) 2 Δ 2 p 0 { p 3 p 4 = g ( p 3 ) p 5 = g ( p 4 ) p 6 = p 3 − ( Δ p 3 ) 2 Δ 2 p 3 { p 6 p 7 = g ( p 6 ) p 8 = g ( p 7 ) p 9 = p 6 − ( Δ p 6 ) 2 Δ 2 p 6 . . . . . . \begin{cases}p_0\\p_1=g(p_0)\\p_2=g(p_1)\\p_3=p_0-\frac{(\Delta p_0)^2}{\Delta^2p_0}\end{cases} \begin{cases}p_3\\p_4=g(p_3)\\p_5=g(p_4)\\p_6=p_3-\frac{(\Delta p_3)^2}{\Delta^2p_3}\end{cases}
\begin{cases}p_6\\p_7=g(p_6)\\p_8=g(p_7)\\p_9=p_6-\frac{(\Delta p_6)^2}{\Delta^2p_6}\end{cases}......
⎩ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎧ p 0 p 1 = g ( p 0 ) p 2 = g ( p 1 ) p 3 = p 0 − Δ 2 p 0 ( Δ p 0 ) 2 ⎩ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎧ p 3 p 4 = g ( p 3 ) p 5 = g ( p 4 ) p 6 = p 3 − Δ 2 p 3 ( Δ p 3 ) 2 ⎩ ⎪ ⎪ ⎪ ⎪ ⎪ ⎨ ⎪ ⎪ ⎪ ⎪ ⎪ ⎧ p 6 p 7 = g ( p 6 ) p 8 = g ( p 7 ) p 9 = p 6 − Δ 2 p 6 ( Δ p 6 ) 2 . . . . . .
Theorem : If g ′ ( p ) ≠ 1 g'(p)\neq 1 g ′ ( p ) = 1 , and there exists a δ > 0 \delta>0 δ > 0 such that g ∈ C 3 [ p − δ , p + δ ] g\in C^3[p-\delta,p+\delta] g ∈ C 3 [ p − δ , p + δ ] , then Steffensen’s method gives a quadratic (α = 2 \alpha=2 α = 2 ) convergence for any p 0 ∈ [ p − δ , p + δ ] p_0\in[p-\delta,p+\delta] p 0 ∈ [ p − δ , p + δ ] .
# Zeros of Polynomials and Muller’s Method
Find the root of given polynomial:
f ( x ) = x n + a 1 x n − 1 + . . . + a n − 1 x + a n f(x)=x^n+a_1x^{n-1}+...+a_{n-1}x+a_n
f ( x ) = x n + a 1 x n − 1 + . . . + a n − 1 x + a n
initially we have three points: ( x 0 , f ( x 0 ) ) , ( x 1 , f ( x 1 ) ) , ( x 2 , f ( x 2 ) ) (x_0,f(x_0)),(x_1,f(x_1)),(x_2,f(x_2)) ( x 0 , f ( x 0 ) ) , ( x 1 , f ( x 1 ) ) , ( x 2 , f ( x 2 ) ) , then we draw a parabola across the three points:
There are two meeting points of x-axis and the parabola, we choose the one which is closer to x 2 x_2 x 2 as x 3 x_3 x 3 , and repeat the iteration to draw parabola across ( x 1 , f ( x 1 ) ) , ( x 2 , f ( x 2 ) ) , ( x 3 , f ( x 3 ) ) (x_1,f(x_1)),(x_2,f(x_2)),(x_3,f(x_3)) ( x 1 , f ( x 1 ) ) , ( x 2 , f ( x 2 ) ) , ( x 3 , f ( x 3 ) ) .
When ∣ x n + 1 − x n ∣ < ε |x_{n+1}-x_n|<\varepsilon ∣ x n + 1 − x n ∣ < ε , the iteration terminates. and we’ve found the root.
# 第三章 差值和多项式拟合
Theorem (Weierstrass Approximation Theorem): Suppose f f f is defined and continuous on [ a , b ] [a,b] [ a , b ] , for each ε > 0 \varepsilon>0 ε > 0 , there exists a polynomial P ( x ) P(x) P ( x ) defined on [ a , b ] [a,b] [ a , b ] , with the property that:
∀ x ∈ [ a , b ] , ∣ f ( x ) − P ( x ) ∣ < ε \forall x\in[a,b],\;|f(x)-P(x)|<\varepsilon
∀ x ∈ [ a , b ] , ∣ f ( x ) − P ( x ) ∣ < ε
# the n-th Lagrange Interpolating Polynomial
L n , k ( x ) = ∏ i = 0 , i ≠ k n x − x i x k − x i L n , k ( x ) = { 0 x ≠ x k 1 x = x k P ( x ) = ∑ k = 0 n f ( x k ) L n , k ( x ) L_{n,k}(x)=\prod_{i=0,i\neq k}^n\frac{x-x_i}{x_k-x_i}\\
L_{n,k}(x)=\begin{cases}0&x\neq x_k\\1&x=x_k\end{cases} \\
P(x)=\sum_{k=0}^nf(x_k)L_{n,k}(x)
L n , k ( x ) = i = 0 , i = k ∏ n x k − x i x − x i L n , k ( x ) = { 0 1 x = x k x = x k P ( x ) = k = 0 ∑ n f ( x k ) L n , k ( x )
Theorem : Suppose x 0 , x 1 , . . , x n x_0,x_1,..,x_n x 0 , x 1 , . . , x n are distinct numbers in the interval [ a , b ] [a,b] [ a , b ] and f ∈ C n + 1 [ a , b ] f\in C^{n+1}[a,b] f ∈ C n + 1 [ a , b ] , then for each x ∈ [ a , b ] x\in[a,b] x ∈ [ a , b ] , a number ξ ( x ) ∈ ( a , b ) \xi(x)\in(a,b) ξ ( x ) ∈ ( a , b ) exists with
f ( x ) = P n ( x ) + f ( n + 1 ) ( ξ ( x ) ) ( n + 1 ) ! ( x − x 0 ) ( x − x 1 ) . . . ( x − x n ) f(x)=P_n(x)+\frac{f^{(n+1)}(\xi(x))}{(n+1)!}(x-x_0)(x-x_1)...(x-x_n)
f ( x ) = P n ( x ) + ( n + 1 ) ! f ( n + 1 ) ( ξ ( x ) ) ( x − x 0 ) ( x − x 1 ) . . . ( x − x n )
Where P n ( x ) P_n(x) P n ( x ) is the Lagrange Interpolating polynomial.
The error is related to h = ∣ b − a ∣ h=|b-a| h = ∣ b − a ∣ . If ∣ f ( n + 1 ) ∣ ≤ M n + 1 |f^{(n+1)}|\leq M_{n+1} ∣ f ( n + 1 ) ∣ ≤ M n + 1 , then:
∣ f ( x ) − P 1 ( x ) ∣ = ∣ f ′ ′ ( ξ ) ∣ 2 ∣ ( x − x 0 ) ( x − x 1 ) ∣ ≤ M 2 h 2 8 ∣ f ( x ) − P n ( x ) ∣ ≤ M n + 1 n ! h n |f(x)-P_1(x)|=\frac{|f''(\xi)|}{2}|(x-x_0)(x-x_1)|\leq\frac{M_2h^2}{8}\\
|f(x)-P_n(x)|\leq \frac{M_{n+1}}{n!}h^n
∣ f ( x ) − P 1 ( x ) ∣ = 2 ∣ f ′ ′ ( ξ ) ∣ ∣ ( x − x 0 ) ( x − x 1 ) ∣ ≤ 8 M 2 h 2 ∣ f ( x ) − P n ( x ) ∣ ≤ n ! M n + 1 h n
Runge Phenomenon : when n n n is bigger, the difference between function and polynomial is larger.
# Data Approximation and Neville’s Method
Theorem : Consider n n n points: x 1 , x 2 , . . . , x n x_1,x_2,...,x_n x 1 , x 2 , . . . , x n , and Lagrange polynomial:
P 1 ( x ) = ∑ k = 0 , k ≠ j n L n , k ( x ) f ( x k ) P 2 ( x ) = ∑ k = 0 , k ≠ i n L n , k ( x ) f ( x k ) P_1(x)=\sum_{k=0,k\neq j}^nL_{n,k}(x)f(x_k)\\
P_2(x)=\sum_{k=0,k\neq i}^nL_{n,k}(x)f(x_k) \\
P 1 ( x ) = k = 0 , k = j ∑ n L n , k ( x ) f ( x k ) P 2 ( x ) = k = 0 , k = i ∑ n L n , k ( x ) f ( x k )
Then P ( x ) = ( x − x j ) P 1 ( x ) − ( x − x i ) P 2 ( x ) x i − x j P(x)=\frac{(x-x_j)P_1(x)-(x-x_i)P_2(x)}{x_i-x_j} P ( x ) = x i − x j ( x − x j ) P 1 ( x ) − ( x − x i ) P 2 ( x ) .
So the Lagrange Polynomial can be generate recursively.
( x 1 , x 2 , x 3 , . . . , x n − 1 , x n ) ⇒ ( x 1 , x 2 , . . , x n − 1 ) + ( x 2 , x 3 , . . . , x n ) ⇒ ( x 1 , x 2 , . . . , x n − 2 ) + 2 ( x 2 , x 3 , . . . , x n − 1 ) + ( x 3 , x 4 , . . . , x n ) ⇒ . . . (x_1,x_2,x_3,...,x_{n-1},x_n)\\
\Rightarrow(x_1,x_2,..,x_{n-1})+(x_2,x_3,...,x_n)\\
\Rightarrow (x_1,x_2,...,x_{n-2})+2(x_2,x_3,...,x_{n-1})+(x_3,x_4,...,x_n)\\
\Rightarrow ...
( x 1 , x 2 , x 3 , . . . , x n − 1 , x n ) ⇒ ( x 1 , x 2 , . . , x n − 1 ) + ( x 2 , x 3 , . . . , x n ) ⇒ ( x 1 , x 2 , . . . , x n − 2 ) + 2 ( x 2 , x 3 , . . . , x n − 1 ) + ( x 3 , x 4 , . . . , x n ) ⇒ . . .
# Divided Difference
Definition : The zeroth divided difference of the function f f f with respect to x i x_i x i , denoted f [ x i ] f[x_i] f [ x i ] , is simply the value of f f f at x i x_i x i :
f [ x i ] = f i = f ( x i ) f[x_i]=f_i=f(x_i)
f [ x i ] = f i = f ( x i )
while the first divided difference of f f f is defined as
f [ x i , x i + 1 ] = f [ x i + 1 ] − f [ x i ] x i + 1 − x i f[x_i,x_{i+1}]=\frac{f[x_{i+1}]-f[x_i]}{x_{i+1}-x_i}
f [ x i , x i + 1 ] = x i + 1 − x i f [ x i + 1 ] − f [ x i ]
the second divided difference is
f [ x i , x i + 1 , x i + 2 ] = f [ x i + 1 , x i + 2 ] − f [ x i , x i + 1 ] x i + 2 − x i f[x_i,x_{i+1},x_{i+2}]=\frac{f[x_{i+1},x_{i+2}]-f[x_{i},x_{i+1}]}{x_{i+2}-x_i}
f [ x i , x i + 1 , x i + 2 ] = x i + 2 − x i f [ x i + 1 , x i + 2 ] − f [ x i , x i + 1 ]
Theorem : P n ( x ) P_n(x) P n ( x ) can be rewritten as
P n ( x ) = f [ x 0 ] + f [ x 0 , x 1 ] ( x − x 0 ) + f [ x 0 , x 1 , x 2 ] ( x − x 0 ) ( x − x 1 ) ( x − x 2 ) + . . . P_n(x)=f[x_0]+f[x_0,x_1](x-x_0)+f[x_0,x_1,x_2](x-x_0)(x-x_1)(x-x_2)+...
P n ( x ) = f [ x 0 ] + f [ x 0 , x 1 ] ( x − x 0 ) + f [ x 0 , x 1 , x 2 ] ( x − x 0 ) ( x − x 1 ) ( x − x 2 ) + . . .
which is known as Newton’s interpolatory divided difference formula .
Theorem : a number ξ \xi ξ exists in ( a , b ) (a,b) ( a , b ) with
f [ x 0 , x 1 , . . . , x n ] = f ( n ) ( ξ ) n ! f[x_0,x_1,...,x_n]=\frac{f^{(n)}(\xi)}{n!}
f [ x 0 , x 1 , . . . , x n ] = n ! f ( n ) ( ξ )
Definition : the forward difference is defined by:
Δ f ( x i ) = f ( x i + 1 ) − f ( x i ) \Delta f(x_i)=f(x_{i+1})-f(x_i)
Δ f ( x i ) = f ( x i + 1 ) − f ( x i )
if ∀ i , x i + 1 − x i ≡ h \forall i,x_{i+1}-x_i\equiv h ∀ i , x i + 1 − x i ≡ h and x = x 0 + s h x=x_0+sh x = x 0 + s h , then
P n ( x ) = f [ x 0 ] + f [ x 0 , x 1 ] s h + f [ x 0 , x 1 , x 2 ] s ( s − 1 ) h 2 + . . . = ∑ k = 0 n f [ x 0 , x 1 , . . . , x k ] C s k k ! h k ∵ f [ x 0 , x 1 , . . , x k ] = 1 k ! h k Δ 2 f ( x 0 ) ∴ P n ( x ) = ∑ k = 0 n C s k Δ k f ( x 0 ) P_n(x)=f[x_0]+f[x_0,x_1]sh+f[x_0,x_1,x_2]s(s-1)h^2+...\\
=\sum_{k=0}^nf[x_0,x_1,...,x_k]C_s^kk!h^k\\
\because f[x_0,x_1,..,x_k]=\frac{1}{k!h^k}\Delta^2f(x_0)\\
\therefore P_n(x)=\sum_{k=0}^nC_s^k\Delta^kf(x_0)
P n ( x ) = f [ x 0 ] + f [ x 0 , x 1 ] s h + f [ x 0 , x 1 , x 2 ] s ( s − 1 ) h 2 + . . . = k = 0 ∑ n f [ x 0 , x 1 , . . . , x k ] C s k k ! h k ∵ f [ x 0 , x 1 , . . , x k ] = k ! h k 1 Δ 2 f ( x 0 ) ∴ P n ( x ) = k = 0 ∑ n C s k Δ k f ( x 0 )
The formula is named as Newton Forward Difference Formula .
Definition : the backward difference is defined by:
▽ f ( x i ) = f ( x i ) − f ( x i − 1 ) \bigtriangledown f(x_i)=f(x_i)-f(x_{i-1})
▽ f ( x i ) = f ( x i ) − f ( x i − 1 )
So we have
f [ x n , x n − 1 ] = 1 h ▽ f ( x n ) f [ x n , x n − 1 , x n − 2 , . . . , x n − k ] = 1 k ! h k ▽ k f ( x n ) P n ( x ) = ∑ k = 0 n ( − 1 ) l C − s k ▽ k f ( x n ) w h e r e C − s k = − s ( − s − 1 ) . . . ( − s − k + 1 ) k ! f[x_n,x_{n-1}]=\frac{1}{h}\bigtriangledown f(x_n)\\
f[x_n,x_{n-1},x_{n-2},...,x_{n-k}]=\frac{1}{k!h^k}\bigtriangledown^kf(x_n)\\
P_n(x)=\sum_{k=0}^n(-1)^lC_{-s}^k\bigtriangledown^k f(x_n)\\
where\;C_{-s}^k=\frac{-s(-s-1)...(-s-k+1)}{k!}
f [ x n , x n − 1 ] = h 1 ▽ f ( x n ) f [ x n , x n − 1 , x n − 2 , . . . , x n − k ] = k ! h k 1 ▽ k f ( x n ) P n ( x ) = k = 0 ∑ n ( − 1 ) l C − s k ▽ k f ( x n ) w h e r e C − s k = k ! − s ( − s − 1 ) . . . ( − s − k + 1 )
The formula is named as Newton Backward Difference Formula .
# Hermite Interpolation
Problem : Given n + 1 n+1 n + 1 distinct numbers x 0 , x 1 , . . . , x n x_0,x_1,...,x_n x 0 , x 1 , . . . , x n and non-negative integers k 0 , k 1 , . . . , k n k_0,k_1,...,k_n k 0 , k 1 , . . . , k n , to construct the osculating polynomial approximating a function f ∈ C m [ a , b ] f\in C^m[a,b] f ∈ C m [ a , b ] where m = m a x ( k 0 , k 1 , . . . , k n ) m=max(k_0,k_1,...,k_n) m = m a x ( k 0 , k 1 , . . . , k n ) .
The osculating polynomial H ( x ) H(x) H ( x ) requires:
f ( x 0 ) = H ( x 0 ) , f ′ ( x 0 ) = H ′ ( x 0 ) , . . . , f ( k 0 ) ( x 0 ) = H ( k 0 ) ( x 0 ) f ( x 1 ) = H ( x 1 ) , f ′ ( x 1 ) = H ′ ( x 1 ) , . . . , f ( k 1 ) ( x 1 ) = H ( k 1 ) ( x 1 ) . . . . . . f ( x n ) = H ( x n ) , f ′ ( x n ) = H ′ ( x n ) , . . . , f ( k n ) ( x n ) = H ( k n ) ( x n ) f(x_0)=H(x_0),f'(x_0)=H'(x_0),...,f^{(k_0)}(x_0)=H^{(k_0)}(x_0)\\
f(x_1)=H(x_1),f'(x_1)=H'(x_1),...,f^{(k_1)}(x_1)=H^{(k_1)}(x_1)\\
......\\
f(x_n)=H(x_n),f'(x_n)=H'(x_n),...,f^{(k_n)}(x_n)=H^{(k_n)}(x_n)\\
f ( x 0 ) = H ( x 0 ) , f ′ ( x 0 ) = H ′ ( x 0 ) , . . . , f ( k 0 ) ( x 0 ) = H ( k 0 ) ( x 0 ) f ( x 1 ) = H ( x 1 ) , f ′ ( x 1 ) = H ′ ( x 1 ) , . . . , f ( k 1 ) ( x 1 ) = H ( k 1 ) ( x 1 ) . . . . . . f ( x n ) = H ( x n ) , f ′ ( x n ) = H ′ ( x n ) , . . . , f ( k n ) ( x n ) = H ( k n ) ( x n )
Obviously the degree of this osculating polynomial is at most K = ∑ i = 1 n k i + n K=\sum_{i=1}^nk_i+n K = ∑ i = 1 n k i + n .
since the number of equation to be satisfied is K + 1 K+1 K + 1 .
if k 0 = k 1 = . . . = k n k_0=k_1=...=k_n k 0 = k 1 = . . . = k n , then the Hermite polynomial is:
H 2 n + 1 ( x ) = ∑ j = 0 n f ( x j ) H n , j ( x ) + ∑ j = 0 n f ′ ( x j ) H ^ n , j ( x ) w h e r e H n , j ( x ) = [ 1 − 2 ( x − x j ) L n , j ′ ( x j ) ] L n , j 2 ( x ) H ^ n , j ( x ) = ( x − x j ) L n , j 2 ( x ) H_{2n+1}(x)=\sum_{j=0}^n f(x_j)H_{n,j}(x)+\sum_{j=0}^nf'(x_j)\hat{H}_{n,j}(x)\\
where\;H_{n,j}(x)=[1-2(x-x_j)L'_{n,j}(x_j)]L^2_{n,j}(x)\\
\hat{H}_{n,j}(x)=(x-x_j)L^2_{n,j}(x)
H 2 n + 1 ( x ) = j = 0 ∑ n f ( x j ) H n , j ( x ) + j = 0 ∑ n f ′ ( x j ) H ^ n , j ( x ) w h e r e H n , j ( x ) = [ 1 − 2 ( x − x j ) L n , j ′ ( x j ) ] L n , j 2 ( x ) H ^ n , j ( x ) = ( x − x j ) L n , j 2 ( x )
the error is
f ( x ) = H 2 n + 1 ( x ) + ∏ k = 0 n ( x − x k ) 2 ( 2 n + 2 ) ! f ( 2 n + 2 ) ( ξ ) f(x)=H_{2n+1}(x)+\frac{\prod_{k=0}^n(x-x_k)^2}{(2n+2)!}f^{(2n+2)}(\xi)
f ( x ) = H 2 n + 1 ( x ) + ( 2 n + 2 ) ! ∏ k = 0 n ( x − x k ) 2 f ( 2 n + 2 ) ( ξ )
# Piecewise Interpolation Linear Polynomial
Instead of constructing a high-degree polynomial to approximate the function, we can construct several segments:
First construct the base function:
l 0 ( x ) = x − x 1 x 0 − x 1 , x 0 ≤ x ≤ x 1 l i ( x ) = { x − x i − 1 x i − x i − 1 x i − 1 ≤ x ≤ x i x − x i + 1 x i − x i + 1 x i ≤ x ≤ x i + 1 l n ( x ) = x − x n − 1 x n − x n − 1 , x n − 1 ≤ x ≤ x n l_0(x)=\frac{x-x_1}{x_0-x_1},x_0\leq x\leq x_1\\
l_i(x)=\begin{cases}\frac{x-x_{i-1}}{x_i-x_{i-1}}&x_{i-1}\leq x\leq x_i\\\frac{x-x_{i+1}}{x_i-x_{i+1}}&x_{i}\leq x\leq x_{i+1}
\end{cases}\\
l_n(x)=\frac{x-x_{n-1}}{x_n-x_{n-1}},x_{n-1}\leq x\leq x_n
l 0 ( x ) = x 0 − x 1 x − x 1 , x 0 ≤ x ≤ x 1 l i ( x ) = { x i − x i − 1 x − x i − 1 x i − x i + 1 x − x i + 1 x i − 1 ≤ x ≤ x i x i ≤ x ≤ x i + 1 l n ( x ) = x n − x n − 1 x − x n − 1 , x n − 1 ≤ x ≤ x n
Then the piecewise interpolation linear polynomial is:
P ( x ) = ∑ i = 0 n l i ( x ) f ( x i ) P(x)=\sum_{i=0}^nl_i(x)f(x_i)
P ( x ) = i = 0 ∑ n l i ( x ) f ( x i )
the error bounds is:
∣ f ( x ) − P ( x ) ∣ ≤ h 2 8 M |f(x)-P(x)|\leq\frac{h^2}{8}M
∣ f ( x ) − P ( x ) ∣ ≤ 8 h 2 M
where h = m a x ( x i + 1 − x i ) h=max(x_{i+1}-x_i) h = m a x ( x i + 1 − x i ) , M = m a x ∣ f ′ ′ ( x ) ∣ M=max|f''(x)| M = m a x ∣ f ′ ′ ( x ) ∣ .
When considering the osculating polynomial and k 0 = k 1 = . . . = k n = 1 k_0=k_1=...=k_n=1 k 0 = k 1 = . . . = k n = 1 , we can construct:
P ( x ) = ∑ i = 0 n H i ( x ) f ( x i ) + H ^ i ( x ) f ′ ( x i ) P(x)=\sum_{i=0}^n H_i(x)f(x_i)+\hat{H}_i(x)f'(x_i)
P ( x ) = i = 0 ∑ n H i ( x ) f ( x i ) + H ^ i ( x ) f ′ ( x i )
where
H i ( x ) = { ( 1 + 2 x − x i x i − 1 − x i ) ( x − x i − 1 x i − x i − 1 ) 2 x i − 1 ≤ x ≤ x i ( 1 + 2 x − x i x i + 1 − x i ) ( x − x i + 1 x i − x i + 1 ) 2 x i ≤ x ≤ x i + 1 H ^ i ( x ) = { ( x − x i ) ( x − x i − 1 x i − x i − 1 ) 2 x i − 1 ≤ x ≤ x i ( x − x i ) ( x − x i + 1 x i − x i + 1 ) 2 x i ≤ x ≤ x i + 1 H_i(x)=\begin{cases}(1+2\frac{x-x_i}{x_{i-1}-x_i})(\frac{x-x_{i-1}}{x_i-x_{i-1}})^2&x_{i-1}\leq x\leq x_i\\
(1+2\frac{x-x_i}{x_{i+1}-x_i})(\frac{x-x_{i+1}}{x_i-x_{i+1}})^2&x_{i}\leq x\leq x_{i+1}
\end{cases}\\
\hat{H}_i(x)=\begin{cases}(x-x_i)(\frac{x-x_{i-1}}{x_i-x_{i-1}})^2&x_{i-1}\leq x\leq x_i\\
(x-x_i)(\frac{x-x_{i+1}}{x_i-x_{i+1}})^2&x_i\leq x\leq x_{i+1}
\end{cases}
H i ( x ) = { ( 1 + 2 x i − 1 − x i x − x i ) ( x i − x i − 1 x − x i − 1 ) 2 ( 1 + 2 x i + 1 − x i x − x i ) ( x i − x i + 1 x − x i + 1 ) 2 x i − 1 ≤ x ≤ x i x i ≤ x ≤ x i + 1 H ^ i ( x ) = { ( x − x i ) ( x i − x i − 1 x − x i − 1 ) 2 ( x − x i ) ( x i − x i + 1 x − x i + 1 ) 2 x i − 1 ≤ x ≤ x i x i ≤ x ≤ x i + 1
# 第四章 数值微分和数值积分
Formula :
f ′ ( x 0 ) ≈ f ( x 0 + h ) − f ( x 0 ) h f ′ ( x 0 ) ≈ f ( x 0 ) − f ( x 0 − h ) h f ′ ( x 0 ) ≈ f ( x 0 + h ) − f ( x 0 − h ) 2 h f'(x_0)\approx \frac{f(x_0+h)-f(x_0)}{h}\\
f'(x_0)\approx \frac{f(x_0)-f(x_0-h)}{h}\\
f'(x_0)\approx \frac{f(x_0+h)-f(x_0-h)}{2h}
f ′ ( x 0 ) ≈ h f ( x 0 + h ) − f ( x 0 ) f ′ ( x 0 ) ≈ h f ( x 0 ) − f ( x 0 − h ) f ′ ( x 0 ) ≈ 2 h f ( x 0 + h ) − f ( x 0 − h )
∵ f ( x ) = ∑ k = 0 n f ( x k ) L n , k ( x ) + ( x − x 0 ) . . . ( x − x n ) ( n + 1 ) ! f ( n + 1 ) ( ξ ) ∴ f ′ ( x j ) = ∑ k = 0 n f ( x k ) L n , k ′ ( x j ) + f ( n + 1 ) ( ξ ) ( n + 1 ) ! ∏ k = 0 , k ≠ j n ( x j − x k ) \because f(x)=\sum_{k=0}^nf(x_k)L_{n,k}(x)+\frac{(x-x_0)...(x-x_n)}{(n+1)!}f^{(n+1)}(\xi)\\
\therefore f'(x_j)=\sum_{k=0}^nf(x_k)L'_{n,k}(x_j)+\frac{f^{(n+1)}(\xi)}{(n+1)!}\prod_{k=0,k\neq j}^n(x_j-x_k)
∵ f ( x ) = k = 0 ∑ n f ( x k ) L n , k ( x ) + ( n + 1 ) ! ( x − x 0 ) . . . ( x − x n ) f ( n + 1 ) ( ξ ) ∴ f ′ ( x j ) = k = 0 ∑ n f ( x k ) L n , k ′ ( x j ) + ( n + 1 ) ! f ( n + 1 ) ( ξ ) k = 0 , k = j ∏ n ( x j − x k )
note that f ′ ( x ) f'(x) f ′ ( x ) is only meaningful when x = x 0 , x 1 , . . . , x n x=x_0,x_1,...,x_n x = x 0 , x 1 , . . . , x n .
when n = 2 n=2 n = 2 and x 1 = x 0 + h , x 2 = x 0 + 2 h x_1=x_0+h,x_2=x_0+2h x 1 = x 0 + h , x 2 = x 0 + 2 h :
f ′ ( x 0 ) = 1 2 h [ − 3 f ( x 0 ) + 4 f ( x 0 + h ) − f ( x 0 + 2 h ) ] + h 2 3 f ( 3 ) ( ξ ) f'(x_0)=\frac{1}{2h}[-3f(x_0)+4f(x_0+h)-f(x_0+2h)]+\frac{h^2}{3}f^{(3)}(\xi)
f ′ ( x 0 ) = 2 h 1 [ − 3 f ( x 0 ) + 4 f ( x 0 + h ) − f ( x 0 + 2 h ) ] + 3 h 2 f ( 3 ) ( ξ )
By Taylor polynomial, we have
f ( x 0 + h ) = f ( x 0 ) + f ′ ( x 0 ) h + 1 2 f ′ ′ ( x 0 ) h 2 + 1 6 f ( 3 ) ( x 0 ) h 3 + 1 24 f ( 4 ) ( ξ 1 ) h 4 f ( x 0 − h ) = f ( x 0 ) − f ′ ( x 0 ) h + 1 2 f ′ ′ ( x 0 ) h 2 − 1 6 f ( 3 ) ( x 0 ) h 3 + 1 24 f ( 4 ) ( ξ − 1 ) h 4 f(x_0+h)=f(x_0)+f'(x_0)h+\frac{1}{2}f''(x_0)h^2+\frac{1}{6}f^{(3)}(x_0)h^3+\frac{1}{24}f^{(4)}(\xi_1)h^4\\
f(x_0-h)=f(x_0)-f'(x_0)h+\frac{1}{2}f''(x_0)h^2-\frac{1}{6}f^{(3)}(x_0)h^3+\frac{1}{24}f^{(4)}(\xi_{-1})h^4\\
f ( x 0 + h ) = f ( x 0 ) + f ′ ( x 0 ) h + 2 1 f ′ ′ ( x 0 ) h 2 + 6 1 f ( 3 ) ( x 0 ) h 3 + 2 4 1 f ( 4 ) ( ξ 1 ) h 4 f ( x 0 − h ) = f ( x 0 ) − f ′ ( x 0 ) h + 2 1 f ′ ′ ( x 0 ) h 2 − 6 1 f ( 3 ) ( x 0 ) h 3 + 2 4 1 f ( 4 ) ( ξ − 1 ) h 4
Therefore:
f ( x 0 + h ) + f ( x 0 − h ) = 2 f ( x 0 ) + f ′ ′ ( x 0 ) h 2 + h 4 24 [ f ( 4 ) ( ξ 1 ) + f ( 4 ) ( ξ − 1 ) ] f(x_0+h)+f(x_0-h)=2f(x_0)+f''(x_0)h^2+\frac{h^4}{24}[f^{(4)}(\xi_1)+f^{(4)}(\xi_{-1})]
f ( x 0 + h ) + f ( x 0 − h ) = 2 f ( x 0 ) + f ′ ′ ( x 0 ) h 2 + 2 4 h 4 [ f ( 4 ) ( ξ 1 ) + f ( 4 ) ( ξ − 1 ) ]
Suppose f ( 4 ) f^{(4)} f ( 4 ) is continuous, then there exists ξ ∈ [ x 0 − h , x 0 + h ] \xi\in[x_0-h,x_0+h] ξ ∈ [ x 0 − h , x 0 + h ] satisfying
f ( 4 ) ( ξ ) = 1 2 [ f ( 4 ) ( ξ 1 ) + f ( 4 ) ( ξ − 1 ) ] f^{(4)}(\xi)=\frac{1}{2}[f^{(4)}(\xi_1)+f^{(4)}(\xi_{-1})]
f ( 4 ) ( ξ ) = 2 1 [ f ( 4 ) ( ξ 1 ) + f ( 4 ) ( ξ − 1 ) ]
So
f ′ ′ ( x 0 ) = 1 h 2 [ f ( x 0 − h ) − 2 f ( x 0 ) + f ( x 0 + h ) ] − h 4 12 f ( 4 ) ( ξ ) f''(x_0)=\frac{1}{h^2}[f(x_0-h)-2f(x_0)+f(x_0+h)]-\frac{h^4}{12}f^{(4)}(\xi)
f ′ ′ ( x 0 ) = h 2 1 [ f ( x 0 − h ) − 2 f ( x 0 ) + f ( x 0 + h ) ] − 1 2 h 4 f ( 4 ) ( ξ )
Suppose that for each number h ≠ 0 h\neq 0 h = 0 we have a formula N ( h ) N(h) N ( h ) that approximates an unknown value M M M and that the truncation error involved with the approximation has the form:
M − N ( h ) = K 1 h + K 2 h 2 + K 3 h 3 + . . . M-N(h)=K_1h+K_2h^2+K_3h^3+...
M − N ( h ) = K 1 h + K 2 h 2 + K 3 h 3 + . . .
Then we have
M = N ( h 2 ) + K 1 h 2 + K 2 h 2 4 + . . . M=N(\frac{h}{2})+K_1\frac{h}{2}+K_2\frac{h^2}{4}+...
M = N ( 2 h ) + K 1 2 h + K 2 4 h 2 + . . .
Therefore
M = [ N ( h 2 ) + N ( h 2 ) − N ( h ) ] + K 2 ( h 2 2 − h 2 ) + . . . = 2 N ( h 2 ) − N ( h ) + O ( h 2 ) M=[N(\frac{h}{2})+N(\frac{h}{2})-N(h)]+K_2(\frac{h^2}{2}-h^2)+...\\
=2N(\frac{h}{2})-N(h)+O(h^2)
M = [ N ( 2 h ) + N ( 2 h ) − N ( h ) ] + K 2 ( 2 h 2 − h 2 ) + . . . = 2 N ( 2 h ) − N ( h ) + O ( h 2 )
let N 2 ( h ) = 2 N ( h 2 ) − N ( h ) N_2(h)=2N(\frac{h}{2})-N(h) N 2 ( h ) = 2 N ( 2 h ) − N ( h ) , then
∵ M = N 2 ( h ) − K 2 2 h 2 − 3 K 3 4 h 3 − . . . ∴ 3 M = 4 N 2 ( h 2 ) − N 2 ( h ) + O ( h 3 ) \because M=N_2(h)-\frac{K_2}{2}h^2-\frac{3K_3}{4}h^3-...\\
\therefore3M=4N_2(\frac{h}{2})-N_2(h)+O(h^3)
∵ M = N 2 ( h ) − 2 K 2 h 2 − 4 3 K 3 h 3 − . . . ∴ 3 M = 4 N 2 ( 2 h ) − N 2 ( h ) + O ( h 3 )
In general, if M M M can be written in the form:
M = N 1 ( h ) + ∑ j = 1 m − 1 K j h j + O ( h m ) M=N_1(h)+\sum_{j=1}^{m-1}K_jh^j+O(h^m)
M = N 1 ( h ) + j = 1 ∑ m − 1 K j h j + O ( h m )
then
N j ( h ) = N j − 1 ( h 2 ) + N j − 1 ( h / 2 ) − N j − 1 ( h ) 2 j − 1 − 1 M = N j ( h ) + O ( h j ) N_j(h)=N_{j-1}(\frac{h}{2})+\frac{N_{j-1}(h/2)-N_{j-1}(h)}{2^{j-1}-1}\\
M=N_j(h)+O(h^j)
N j ( h ) = N j − 1 ( 2 h ) + 2 j − 1 − 1 N j − 1 ( h / 2 ) − N j