Professional Documents
Culture Documents
System of Nonlinear
Equations
Finding the zeros of a given function f , i.e., finding an argument x for which
f (x) = 0 (6.1)
1
2 CHAPTER 6. SYSTEM OF NONLINEAR EQUATIONS
xk+1 := xk + sk (6.5)
The Newton method is best knwon for its quadratic convergence. Toward
this, we first prove a useful lemma.
!1
(pf): By the line integration, f (x) − f (y) = 0 f ! (y + t(x − y))(x − y)dt. So
" 1
f (x) − f (y) − f ! (y)(x − y) = [f ! (y + t(x − y)) − f ! (y)](x − y)dt.
0
It follows that
%f (x) − f (y) − f ! (y)(x − y)%
" 1
≤ %f ! (y + t(x − y)) − f ! (y)%%x − y%dt
0
" 1
γ
≤ γt%x − y%2 dt = %x − y%2 .
0 2
Theorem 6.1.1 Let f : Rn → Rn be continuously differentiable in an open
convex set D ⊂ Rn . Assume that there exist ξ ∈ D and β, γ > 0 such that
(1) f (ξ) = 0,
(2) f ! (ξ)−1 exists,
(3) %f ! (ξ)−1 % ≤ β, and
(4) %f ! (x) − f ! (y)% ≤ γ%x − y% for x, y in a neighborhood of ξ.
Then there exists % > 0 such that for every x0 ∈ N (ξ, %), the sequence {xk }
define by (6.5) and (6.6) is well defined, converges to ξ and satisfies
%xk+1 − ξ% ≤ βγ%xk − ξ%2 . (6.9)
1
(pf): By continuity of f ! , choose % ≤ min{γ, 2βγ } so that f ! (x) is nonsingular
for all x ∈ N (ξ, %). For k = 0, we have already known %x0 − ξ% < %. So
(pf): Let C̃k denote another possible change of Bk such that B̃k+1 := Bk + C̃k
satisfies B̃k+1 sk = ∆fk . Then
1
%Ck % = %Bk+1 − Bk %F = (∆fk − Bk sk )sTk %F
sTk sk
1
= % (B̃k+1 sk − Bk sk )sTk %
sTk sk
sk sTk
≤ %B̃k+1 − Bk %F % %F = %C̃k %F .
sTk sk
xk+1 : = xk − λk dk ,
sk : = xk+1 − xk ,
∆fk : = f (xk+1 ) − f (xk ),
Bk+1 : = Bk + sT1s (∆fk − Bk sk )sTk .
k k
(pf): The proof is parallel to that of (6.1.1). We have, by the line integral,
!1
%f (x) − f (y) − f ! (ξ)(x − y)% = % 0 [f ! (y + t(x − y)) − f ! (ξ)](x − y)dt% ≤ γ%x −
!1 !1
y% 0 %y + t(x − y) − ξ%dt ≤ γ%x − y% 0 {t%x − ξ% + (1 − t)%y − ξ}dt. ⊕
(pf): By definition,
(∆fk − Bk sk )sTk
Bk+1 − f ! (ξ) = Bk − f ! (ξ) +
sTk sk
# $ # $
sk sT sk sT (∆fk − f ! (ξ)sk sTk
= Bk I = T k − f ! (ξ) I − T k + .
sk sk sk sk sTk sk
6 CHAPTER 6. SYSTEM OF NONLINEAR EQUATIONS
1. f (ξ) = 0,
2. f ! (ξ)−1 exists,
3. %f ! (ξ)−1 % ≤ β, and
4. %f ! (x) − f ! (y)% ≤ γ%x − y% for x, y in a neighborhood of ξ.
Then there exist positive constants δ1 , δ2 such that if %x0 − ξ% < δ1 and %B0 −
f ! (ξ)% ≤ δ2 , then the Broyden’s method is well defined, converges to ξ, and
satisfies
%xk+1 − ξ% ≤ ck %xk − ξ% (6.20)
with lim ck = 0. (This behavior is called superlinear convergence.)
k→∞
1 2δ
(pf): Choose δ2 ≤ 6β and δ1 ≤ 5γ . Then %f ! (ξ)−1 B0 − I% ≤ βδ2 ≤ 16 . By
the Banach lemma, B0−1 exists. So x1 can be defined. Furthermore,
By (6.2.2), we know
γ
%B1 − f ! (ξ)% ≤ %B0 − f ! (ξ)% + (%x1 − ξ% + %x0 − ξ%)
# $2 # $
γ 3 γ3 2
≤ δ2 + %e0 % ≤ δ2 1 +
2 2 2 2 5γ
# $
3 3
= 1+ δ2 ≤ δ2 .
10 2
%f ! (ξ)−1 % β 3
%B1−1 % ≤ ≤ ≤ β. (6.22)
1− %f ! (ξ)−1 %%B1 − f ! (ξ)% 1 − 2βδ2 2
We can now estimate
%e2 % : = %x2 − ξ% = %x1 − B1−1 (f (x1 ) − f (ξ)) − ξ%
= % − B1−1 [f (x1 ) − f (ξ) − B1 e1 ]%
= %B1−1 [f (x1 ) − f (ξ) − f ! (ξ)e1 + (f ! (ξ) − B1 )e1 ]%
'γ ( 3β ' γ δ1 (
≤ 3β
2
2 3
2 %e1 % + 2 δ2 %e1 % ≤ 2
3
2 2 + 2 δ2 %e1 %
% &
≤ 3βδ
2
2 γ1 2 3 1 16 1
2 2 5γ + 2 %e1 % ≤ 4 10 %e0 % < 2 %e0 %.
B+ = Bc + uv T (6.23)
Bc = Qc Rc (6.24)
B+ = Q+ R+ . (6.25)
8 CHAPTER 6. SYSTEM OF NONLINEAR EQUATIONS
Definition 6.3.3 Let R(x) be any rational function. The Cauchy index of R(x)
on (a, b), denoted by Iab R(x), is defined to be the difference between the number
of jumps of R(x) from −∞ to +∞ and the number of jumps from +∞ to −∞
as x goes from a to b, excluding the endpoints. That is, at every pole of R(x)
in (a, b) add 1 to the Cauchy index if R(x) → −∞ on the left of the pole and
R(x) → +∞ on the right of the pole, and subtract 1 if vice versa.
f2 (x)
Iab = V (a) − V (b). (6.34)
f1 (x)
(pf): we first claim that the value of V (x) does not change when x passes
through a zero of fk (x), k = 2, . . . , m − 1. To see this, suppose fk (ξ) =
0. Then by (6.33), fk+! (ξ)fk−1 (ξ) < 0. If fk (x) changes sign at x = ξ,
then for a sufficiently small perturbation h > 0, the signs of the polynomi-
als fk−1 (x), fk (x) and fk+1 (x) display the behavior in one of the following four
−−− +++ −−− +++
patterns: −0+, −0+, +0−, +0 − . In each case, V (ξ − h) = V (ξ) =
+++ −−− +++ −−−
V (ξ +h). This is also true if fk (x) does not change sign at x = ξ. Thus V (x) can
change only when f1 (x) goes through 0. If ξ is a zero of f1 (x), it is not a zero of
f2 (x) because of property 2 of Sturm sequences. Therefore, f2 (x) has the same
sign on both sides of ξ. If ξ is a zero of f1 (x) of even multiplicity, when V (x)
does not change as x increases through ξ and there is not contribution to the
Cauchy index. If the zero is of odd multiplicity, then V (x) will increase by 1 if
−0+ +0−
f1 (x) and f2 (x) have the same sign to the left of ξ, (i.e., , or )
−−− +++
−0+
and will decrease by 1 if the signs to the left are different, (i.e., , or
+++
+0−
). Correspondingly for zeros of odd multiplicity, there is a -1 contribu-
−−−
tion to the Cauchy indes if the signs of f1 (x) and f2 (x) are the same to the left
of ξ and +1 contribution if they are different. This establishes the theorem. ⊕
We now apply the Sturm theorem to find the real roots of p(x) in an interval
(a, b). Consider the sequence of functions fk (x), k = 1, . . . , m where
f1 (x) = p(x)
f2 (x) = p! (x)
(6.35)
fj−1 (x) = qj−1 (x)fj (x) − fj+1 (x), j = 2, . . . , m − 1
fm−1 (x) = qm−1 (x)fm (x)
where qj−1 (x) is the quotient and fj+1 (x) is the negative of the remainder
when fj−1 (x) is divided by fj (x). Thus {fk (x)} is a sequence of polyno-
mials of decreasing degree which eventually must terminate in a polynomial
fm (x), m ≤ n + 1, which divides fm−1 (x) (why?). The polynomial fm (x) is the
6.3. STURM SEQUENCES 11
greatest common divisor of f1 (x) and f2 (x) and also of every other member of
the sequence (6.35). (This is the so called the Euclidean algorithm.)
Suppose fm (x) does not vanish in (a, b) so that the first condition of Defini-
tion 6.3.1 is satisfied. If fk (ξ) = 0 for any k, k = 2, . . . , m − 1, then fk−1 (ξ) =
−fk+1 (ξ) by (6.35). Moreover, when fk+1 (ξ) )= 0 since otherwise fm (ξ) would
also be 0 (Why?). Thus the sequence {fk (x)} is a Sturm sequence when fm (x)
does not vanish in (a, b).
Suppose fm (x) is not of constant sign in (a, b), then we use the sequence
{fk (x)/fm (x)}. Then not only is this a Sturm sequence but also both sides of
(6.34) are the same for this sequence and for the sequence {fk (x)}. Therefore,
we can use these two sequences interchangeably in applying Sturm’s theorem.
Now for the sequence {fk (x)} define by (6.35), we write
p
f2 (x) p! (x) 4 nj
= = + R1 (x) (6.36)
f1 (x) p(x) j=1
x − aj
where the aj , j = 1, . . . , p, are the distinct real zeros of p(x), nj is the multiplicity
of the zeros aj , and R1 (x) has no poles on the real axis. Since the nj are all
positive, Iab (p! (x)/p(x)) is equal to the number of distinct real zeros of p(x) in
the interval (a, b). Therefore, we have the following theorem:
Theorem 6.3.2 The number of distinct real zeros of the polynomial p(x) in the
interval (a, b) is equal to V (a) − V (b) if neither f (a) nor f (b) is equal to 0.
Example. Consider the polynomial
p(x) = x6 + 4x5 + 4x4 − x2 4x − 4. (6.37)
Using (6.35), we calculate
f1 (x) = x6 + 4x5 + 4x4 − x2 − 4x − 4
f2 (x) = 6x5 + 20x4 + 16x3 − 2x − 4
f3 (x) = 4x4 + 8x3 + 3x2 + 14x + 16
(6.38)
f4 (x) = x3 + 6x2 + 12x + 8
f 5 (x) = −17x2 − 58x − 48
f6 (x) = −x − 2
where the coefficients have been made integers by multiplying by suitable posi-
tive constants. For some sample values of x the signs of the fk (x) are:
−∞ ∞ 0 -1 +1 -24/17
f1 (x) + + - 0 0 +
f2 (x) - + - - + -
f3 (x) + + + + + -
(6.39)
f4 (x) - + + + + +
f5 (x) - - - - - 0
f6 (x) + - - - - -
# of sign change 4 1 2 2 1 3
12 CHAPTER 6. SYSTEM OF NONLINEAR EQUATIONS
Thus we conclude there are three distinct real zeros, two negative and one posi-
tive. Moreover, there are two distinct zeros in (−∞, −1] and three in (−∞, +1].
d(x) = x2 − rx − q (6.40)
The coefficients of the remainder depends upon r and q. The idea of Bairstow’s
method is to determine r and q so that
A(r, q) = 0 (6.42)
B(r, q) = 0 (6.43)
Assuming the two roots x0 and x1 , of d(x) are distinct, it follows that
∂A ∂B
= Ã, = B̃. (6.51)
∂q ∂q
Form the first equations, we have
∂A ∂B
−Ã(rxi + q) + xi ( − B̃) + = 0. (6.52)
∂r ∂r
Therefore, we know
∂A
= B̃ = Ãr (6.53)
∂r
∂B
= Ãq. (6.54)
∂r
The values of A, B can be obtained without difficulty: Suppose
p(x) = an xn + . . . + a1 x + a0 (6.55)
p1 (x) = bn−2 xn−2 + . . . + b0 . (6.56)
bn−2 = an , (6.57)
bn−3 = bn−2 r + an−1 , (6.58)
bn−k = bn−k+2 q + bn−k+1 r + an−k+2 (6.59)
A = b1 q + b0 r + a1 (6.60)
B = b 0 q + a0 . (6.61)
Approximation Theory
Sometimes, we even further require that, for each i, the first ri derivatives
of φ agree with those of f at xi .
1
2 CHAPTER 7. APPROXIMATION THEORY
Theorem 7.0.1 Let f (x) be a piecewise continuous function over the interval
[a, b]. Then for any $ > 0, there exist an integer n and numbers a0 , . . . , an such
"n
!b
that a {f (x) − ai xi }2 dx < $.
i=0
converges to f (x) as n → ∞.
n
"
(x − xj )
j=1
E(x) := f (x) − p(x) = f (n) (ξ) (7.9)
n!
where min{x1 , . . . , xn , x} < ξ < max{x1 , . . . , xn , x}.
n−1
!
(pf): Suppose p(x) = ak xk where the coefficients ak are to be deter-
k=0
n−1
!
mined. Then p(xi ) = ak xki = f (xi ), i = 1, . . . , n, can be written in the
k=0
form
1, x1 , . . . , xn−1
1 a0 f (x1 )
= . (7.10)
1, xn , . . . , xn−1
n an−1 f (xn )
"
The matrix, known as the van Dermonde matrix, has determinant (xi −
i>j
xj ). Since all xi ’s are distinct, we can uniquely solve (7.10) for the unknowns
4 CHAPTER 7. APPROXIMATION THEORY
n!
f (n) (ξ) − (f (x0 ) − p(x0 )) n = 0.
!
(x0 − xi )
i=1
n
!
(x0 − xi )
i=1
Thus E(x0 ) = f (x0 ) − p(x0 ) = n! f (n) (ξ). Since x0 is arbitrary, the
theorem is proved. ⊕
Definition 7.1.1 The polynomial p(x) defined by (7.7) is called the Lagrange
interpolation polynomial.
1
f (x) = (7.12)
1 + 25x2
7.2. NEWTON’S INTERPOLATION FORMULA 5
in the interval [−1, 1] at equally spaced points. Runge (1901) discovered that as
the degree n of the interpolating polynomial pn (x) tends toward infinity, pn (x)
diverges in the intervals .726 . . . ≤ |x| < 1 while pn (x) works pretty well in the
central portion of the interval.
Let Pi0 i1 ...ik (x) represent the k-th degree polynomial for which
for j = 0, . . . , k.
holds.
(pf): Denote the right-hand side of (7.14) by R(x). Observe that R(x) is a
polynomial of degree ≤ k. By definition, it is easy to see that R(xij ) = f (xij )
for all j = 0, . . . , k. That is, R(x) interpolates the same set of data as does the
polynomial Pi0 i1 ...ik (x). By Theorem 7.1.1 the assertion is proved. ⊕
6 CHAPTER 7. APPROXIMATION THEORY
The difference Pi0 i1 ...ik (x) − Pi0 i1 ...ik−1 (x) is a k-th degree polynomial which
vanishes at xij for j = 0, . . . , k − 1. Thus we may write
Pi0 i1 ...ik (x) = Pi0 i1 ...ik−1 (x) + fi0 ...ik (x − xi0 )(x − xi1 ) . . . (x − xik−1 ). (7.15)
The leading coefficients fi0 ...ik can be determined recursively from the formula
(7.14), i.e.,
where fi1 ...ik and fi0 ...ik−1 are the leading coefficients of the polynomials Pi1 ...ik (x)
and Pi0 ...ik−1 (x), respectively.
Remark. Note that the formula (7.16) starts from fi0 = f (xi0 ).
Remark. The polynomial Pi0 ...ik (x) is uniquely determined by the set of sup-
port data {(xij , fij )}. The polynomial is invariant to any permutation of the
indices i0 , . . . , ik . Therefore, the divided differences (7.16) are invariant to per-
mutation of the indices.
It follows that the k-th degree polynomial that interpolates the set of support
data {(xi , fi )|i = 0, . . . , k} is given by
(0) (r )
Given {xi }, i = 1, . . . k and values ai , . . . , ai i where ri are nonnegative inte-
gers. We want to construct a polynomial P (x) such that
(j)
P (j) (xi ) = ai (7.21)
k
!
Remark. The degree of P (x) is at most (ri + 1) − 1.
i=1
(j)
Theorem 7.3.1 Given the nodes {xi }, i = 1, . . . , k and values {ai }, j = 0, . . . , ri ,
there exists a unique polynomial satisfying (7.21).
Note that R(j) (x2 ) are known for j = 0, . . . , r2 since P (j) (x2 ) are known. Thus
(j)
all c2 , hence q2 (x), may be determined. This procedure can be continued to
determine all qi (x). Suppose Q(x) = P1 (x) − P2 (x) where P1 (x) and P2 (x) are
!k
two polynomials of the theorem. Then Q(x) is of degree ≤ (ri + 1) − 1,
i=1
and has zeros at xi with multiplicity ri + 1. Counting multiplicities, Q(x) has
!k
(ri + 1) zeros. This is possible only if Q(x) ≡ 0.
i=1
8 CHAPTER 7. APPROXIMATION THEORY
(2) Suppose ri = 1 for all i = 1, . . . , k. That is, suppose values of f (xi ) and
f " (xi ) are to be interpolated. Then the resultant (2k − 1)-degree polynomial
is called the Hermite interpolating polynomial. Recall that the (k − 1)-degree
polynomial
" k
x − xj
!i (x) = (7.24)
j=1
xi − xj
j#=i
hi (xj ) = δij ;
gi (xj ) = 0; (7.28)
" " " " 2
hi (xj ) = [1 − 2(x − xi )!i (xi )]2!i (x)!i (x) − 2!i (xi )!i (x)|x=xj = 0;
gi" (xj ) = (x − xi )2!i (x)!"i (x) + !2i (x)|x=xj = δij .
Thus far for a given function f of an interval [a, b], the interpolation has been
to construct a polynomial over the entire interval [a, b]. There are at least two
disadvantages for the global approximation:
7.4. SPLINE INTERPOLATION 9
1. For better accuracy, we need to supply more support data. But then
the degree the resultant polynomial gets higher and such a polynomial is
difficult to work with.
2. Suppose f is not smooth enough. Then the error estimate of an high
degree polynomial is difficult to establish. In fact, it is not clear whether
or not that the accuracy will increase with increasing number of support
data.
Definition 7.4.1 Let the interval [a, b] be partitioned into a = x1 < x2 < . . . <
xn = b. A function p(x) is said to be a cubic plite of f on the partition if
f (xi ) δi Mi
ci = − (7.32)
δi 6
f (xi+1 ) δi Mi+1
di = − . (7.33)
δi 6
Thus
2
3δi−1 Mi f (xi ) − f (xi−1 ) δi−1 (Mi − Mi−1 )
+ −
6δi−1 δi−1 6
−3δi2 Mi f (xi+1 ) − f (xi ) δi (Mi+1 − Mi )
= + − , (7.36)
6δi δi 6
or equivalently,
δi−1 δi + δi−1 δi
Mi−1 + Mi + Mi+1
6 3 6
f (xi+1 ) − f (xi ) f (xi ) − f (xi−1 )
= − . (7.37)
δi δi−1
7.5. TRIGONOMETRIC INTERPOLATION 11
For simplicity, we shall consider equally spaced notes. Without loss of gen-
erality, we shall assume
2πk
xk = , k = 0, . . . , N − 1.
N
Observe that
e−i(hxk ) = e−i(2πhk/N ) = ei2π(N −h)k/N = ei(N −h)xk .
Thus, we may write
eihxk + ei(N −h)xk
cos hxk = ;
2
eihxk − ei(N −h)xk
sin hxk = . (7.44)
2i
2πk
(pf): It only remains to show (7.50). Recall that ωk = eixk = ei N . Thus
ωk = ωjk and ωk−j = ωkj . Observe that ωj−h
j N
= 1. That is, ωj−h is a root of the
N!−1
polynomial ω N − 1 = (ω − 1) ω k . Thus it must be either ωj−h = 1 which is
k=0
N
! −1 N!−1 N
! −1
the case j = h, or k
ωj−h = ωkj−h = ωkj ωk−h = 0. We may therefore
k=0 k=0 k=0
summarize that
N
! −1 "
0, if j=" 0
ωkj ωk−h = (7.51)
N, if j = h.
k=0
Introducing ω (h) := (1, ω1h , . . . , ωN
h
−1 )
T
∈ C N , we may rewrite (7.51) in terms
of the complex inner product
0, if j "= h
$ω (j) , ω (h) % = . (7.52)
N, if j=h
That is, the vectors ω (0) , . . . ω (N −1) form an orthogonal basis of C N . Denote
f := (f0 , . . . , fN −1 )T .
N −1
2 !
bh = fk sin hxk . (7.55)
N
k=0
Theorem 7.5.2 Let p(x) be the phase polynomial that interpolates a given set
of support data (xk , fk ), k = 0, . . . , N −1 with xk = 2πk/N . Then the s-segment
ps (x) of p(x) minimizes the sum
N
! −1
S(q) = |fk − q(xk )|2 (7.57)
k=0
s
!
(pf): Introducing the vectors ps := (ps (x0 ), . . . ps (xN −1 ))T = βj ω (j) and
j=0
s
!
q := (q(x0 ), . . . , q(xN −1 ))T = γj ω (j) in C N , we write S(q) = #f − q, f − q$.
j=0
1 (j)
By theorem 7.5.1, we know βj = N #f, w $. Thus for j ≤ s, we have
1
#f − ps , w(j) $ = βj − βj = 0,
N
and hence
s
!
#f − ps , ps − q$ = #f − ps , (βj − γj )ω (j) $ = 0.
j=1
Remark. (7.5.2) states the important property that the truncated trigono-
metric interpolation polynomial p(x) produces the least-squares trigonometric
approximation ps (x) of all data.
7.6. FAST FOURIER TRANSFORM 15
Suppose that we have a series of sines and cosines which represent a given
function of [−L, L], say,
∞
a0 ! nπx nπx
f (x) = + an cos + bn sin . (7.58)
2 n=1
L L
and
" L
nπx mπx
sin cos dx = 0, (7.61)
−L L L
one can show that
" L
1 nπx
an = f (x) cos dx, n = 0, 1, . . . (7.62)
L −L L
" L
1 nπx
bn = f (x) sin dx, n = 1, 2, . . . (7.63)
L −L L
Definition 7.6.1 The series (7.58), with coefficients defined by (7.62) and
(7.63), is called the fourier series of f (x) on [−L, L].
Given a function f (x), its Fourier series does not necessarily converge to
f (x) at every x. In fact,
Theorem 7.6.1 Suppose f (x) is piecewise continuous on [−L, L]. Then (1) If
# − f (x0 + h) − f (x0 )
x0 ∈ (−L, L) and f # (x+ # ±
0 ) and f (x0 ) both exist (where f (x ) := lim± ),
h→0 h
+ −
f (x0 )+f (x0 )
then the Fourier series converges to 2 . (2) At −L or L, if f # (−L+ )
f (−L+ )+f (L− )
and f # (L− ) exist, then the Fourier series converges to 2 .
16 CHAPTER 7. APPROXIMATION THEORY
Remark. Suppose that f (x) is defined on [0, L]. We may extend f (x) to become
an even function on [−L, L] (simply by defining f (x) := f (−x) for x ∈ [−L, 0]).
In this way, the Fourier coefficients for the extended function become
! L
2 nπx
an = f (x) cos dx (7.64)
L 0 L
bn ≡ 0.
Similarly, we may extend f (x) to become an odd function on [−L, L], in which
case we obtain a pure sine series
∞
" nπx
f (x) = bn sin (7.66)
n=1
L
with
! L
2 nπx
bn = f (x) sin dx. (7.67)
L 0 L
Example.
π 4 cos 3x cos 5x
f (x) = − (cos x + + + . . .).
2 π 32 52
2. If g(x) = x, −π ≤ x ≤ π, then
3. If
#
x(π − x), for 0≤x≤π
h(x) =
x(π + x), for −π ≤ x ≤ 0
then
8 sin 3x sin 5x
h(x) = (sin x + + + . . .).
π 33 53
7.6. FAST FOURIER TRANSFORM 17
N −1
2 "
an ≈ g(yk ) cos(nyk )
N
k=0
N −1
2 " 2πk 2πkn
= (−1)n f( ) cos := ân . (7.69)
N N N
k=0
Remark. The basis of the Fourier analysis method for smoothing data is as
follows: If we think of given numerical data as consisting of the true values of
a function with random errors superposed, the true functions being relatively
smooth and the superposed errors quite unsmooth, then the examples above sug-
gest a way of partially separating functions from error. Since the true function
is smooth, its Fourier coefficients will decrease quickly. But the unsmoothness
of the error suggests that its Fourier coefficients may decrease very slowly, if at
all. The combined series will consist almost entirely of error, therefore, beyond
a certain place. If we simply truncate the series at the right place, then we are
discarding mostly error (although there will be error contribution in the terms
retained).
jπx kπx
Lemma 7.6.1 The functions ei L and ei L are orthogonal in the following
sense:
! L "
i jπx i kπx 0 if k != j
e L e L = . (7.70)
−L 2L, if k = j
kπx
Multiplying both sides of (7.71) by e−i L and integrating brings
! L ∞
# ! L
−i kπx nπx kπx
f (x)e L dx = fn ei L ei L dx. (7.72)
−L n=−∞ −L
It is easy to see that f0 = a20 , fn + f−n = an and fn + f−n = bn . That is, the
series (7.71) is precisely the same as the series (7.58).
∞
#
f (x) = fn einx (7.75)
n=−∞
7.6. FAST FOURIER TRANSFORM 19
where ! 2π
1
fn = f (x)e−inx dx. (7.76)
2π 0
Consider the function g(x) of the form
"
"
g(x) = dj eijx (7.77)
j=−"
The central idea behind the fast Fourier transform (FFT) is that when N is
the product of integers, the numbers dj (or βj ) prove to be closely interdepen-
dent. This interdependence can be exploited to substantially reduce the amount
of computation required to generated these numbers. We demonstrate the idea
as follows:
N −1
1 !
= f (xn )ω j1 n2 +j1 t2 n1 +t1 j2 n2
N n=0
t2 −1 t!
1 −1
1 !
= ( f (xn2 +t2 n1 )ω j1 t2 n1 )ω j1 n2 +t1 j2 n2 . (7.81)
N n =0 n =0
2 1
t2 −1
1 !
βj = F2 (j1 , j2 ) := F1 (j1 , n2 )ω j1 n2 +t1 j2 n2 . (7.83)
N n =0
2
n2
0 1 2
0 0 0 0
j1
1 0 2 2
j2
0 1 2
0 0 0 0
j1 √ √
1 2 3i 0 −2 3i
7.7. UNIFORM APPROXIMATION 21
Suppose N = t1 t2 t3 . Let
j = j1 + t1 j2 + t1 t2 j3
n = n3 + t3 n2 + t3 t2 n1 .
Then in the nine power terms in ω nj , three will contain the product t1 t2 t3 and
hence may be neglected. The remaining six power terms may be grouped into
a three step algorithm:
1 −1
t!
F1 (j1 , n2 , n3 ) := f (xn )ω j1 t3 t2 n1 (7.84)
n1 =0
2 −1
t!
F2 (j1 , j2 , n3 ) := F (j1 , n2 , n3 )ω (j1 +t1 j2 )t3 n2 (7.85)
n2 =0
t3 −1
1 !
βj = F3 (j1 , j2 , j3 ) := F2 (j1 , j2 , n3 )ω (j1 +t1 j2 +t1 t2 j3 )n3 . (7.86)
N n =0
3
3
We note that if N = 10 , then only 3% of the original terms are needed.
(pf): Let
M := {x ∈ [a, b]||f (x) − g(x)| = ρ}. (7.89)
where e(x) := f (x) − g(x). The inequality in (7.90) is possible if and only if the
sign of p(x) is the same as that of e(x). That is, we must have (f (x)−g(x))p(x) >
0 for all x ∈ M . By (7.88), it follows that the polynomial p must change signs
at least n times in [a, b]. That is, p must have at least n zeros. This contradict
with the assumption that p is not identically zero.
Remark. The above theorem asserts only that g is a best approximation when-
ever there are at least n + 1 points satisfying (7.87) and (7.88). In general, there
can be more points where the maximal deviation is achieved.
Remark. The only property of Pn−1 we have used to establish Theorem 7.7.1
is a weaker form of the Fundamental Theorem of Algebra, i.e., any polynomial
of degree n − 1 has at most n − 1 distinct zeros in [a, b]. This property is in fact
shared by a larger class of functions.
We now state without proof the famous result that Theorem 7.7.1 is not
only sufficient but is also necessary for a polynomial g to a best approximation.
The following theorem is also known as the Alternation Theorem:
Definition 7.7.2 The set of points {x1 , . . . , xn+1 } in Theorem 7.7.2 is referred
to as an alternant for f and g.
Corollary 7.7.1 For any f ∈ C[a, b], there is a unique best approximation.
Theorem 7.7.1 also provides a basis for designing a method for the compu-
tation of best approximations of continuous functions. The idea, known as the
exchange method of Remez, is as follows:
4. Replace {xk } by the new extreme points and repeat the sequence of steps
given above beginning with step (2).
The objective here is to have the set {xk } converge to a true alternant and
hence the polynomial converge to a best approximation. It can be proved that
the process does converge for any choice of starting values in step (1) for which
the value of ρ computed in step (2) in not zero. With additional assumptions on
the differentibility of f , it can also be shown that convergence is quadratic. Also
the assumption that e(x) possesses exactly n + 1 extrem points in step (3) is
not essential. For more details, refer to G. Meinardus’s book ”Approximation of
Functions: Theory and Numerical Methods”, Springer-Verlag, New York, 1967.
Chapter 8
Differentiation and
Integration
f (c + h) − f (c)
f ! (c) = + 0(h), (8.1)
h
f (c + h) − f (c − h)
f ! (c) = + 0(h2 ), (8.2)
2h
−3f (c) + 4f (c + h) − f (c + 2h)
f ! (c) = + 0(h2 ), (8.3)
2h
f (c − h) − 2f (c) + f (c + h)
f !! (c) = + 0(h2 ). (8.4)
h2
Remark. From the above finite difference formulas, it seems that the approx-
imation would become more and more accurate as h → 0. This observation
is true, however, only for exact arithmetic. In actually computation, there
1
2 CHAPTER 8. DIFFERENTIATION AND INTEGRATION
N (q)2 = q + chm n
2 + 0(h2 ). (8.8)
h1
Let k := h2 . Then it is easy to see that
k m N (q)2 − N (q)1 = (k m − 1)q + 0(hn2 ). (8.9)
Thus
k m N (q)2 − N (q)1
M (q) := = q + 0(hn2 ) (8.10)
km − 1
is a higher order approximation to q.
with αi ∈ R and xi ∈ [a, b] is called a quadrature rule for the integral I(f ) :=
!b
a
f (x)dx. The points xi are called the quadrature points (abscissas) and the
values αi are called the quadrature coefficients (weights). We also define the
quadrature error En (f ) := I(f ) − Qn (f ).
b−a
I(f ) ≈ Q2 (f ) = [f (a) + f (b)]. (8.12)
2
Since f (x) − p1 (x) = (x − a)(x − b)f [a, b, x], it follows that
" b
E2 (f ) = (x − a)(x − b)f [a, b, x]dx. (8.13)
a
Observe that (x − a)(s − b) does not change sign in [a, b]. By the mean value
!b !b
theorem, i.e. a f (x)g(x)dx = f (ξ) a g(x)dx for some ξ ∈ [a, b] if g(x) is of one
sign over [a, b], we conclude that
" b
E2 (f ) = f [a, b, ξ] (x − a)(x − b)dx
a
f (2) (η) (b − a)3 f (2) (η)
= =− (b − a)3 . (8.14)
2 6 12
(2) (Simpson’s Rule) Suppose #we approximate
$ f (x) by a quadratic polynomial
p2 (x) that interpolates f (a), f a+b
2 and f (b). Then one can show that
b−a a+b
Q3 (f ) = [f (a) + 4f ( ) + f (b)]. (8.15)
6 2
The error obviously is given by
" b
a+b
E3 (f ) = f [a, b, , x]ω(x)dx (8.16)
a 2
with ω(x) := (x − a)(x − b)(x − a+b 2 ). The function ω(x) changes sign as
x crosses !a+b
2 . So we have to analyze E3 (x) by a different approach. Let
x
Ω(x) := a ω(t)dt. Then Ω! (x) = ω(x). Thus by integration by parts, we
have E3 (f ) = f [a, b, a+b b b a+b
2 , x]Ω(x)|a − |a f [a, b, 2 , x, x]Ω(x)dx. Observe that
Ω(a) = Ω(b) = 0. Observe also that Ω(x) > 0 for all x ∈ (a, b). Thus now we
4 CHAPTER 8. DIFFERENTIATION AND INTEGRATION
and error ! b n
%
En (f ) = f [x1 , . . . , xn , x] (x − xi )dx. (8.21)
a i=1
&n
In general, the function ωn (x) := i=1 (x−xi ) changes sign in the interval [a, b].
But it can be proved that
Definition 8.3.3 The quadrature (8.19) obtained above is called a closed Newton-
Cotes formula.
8.4. GAUSSIAN QUADRATURE 5
1
Remark. Consider the Runge’s function f (x) = 1+x 2 defined over [−5, 5]. We
recall the fact that the interpolating polynomial using equally spaced nodes will
not yield good convergence as n → ∞. Consequently, we should not expect that
the closed Newton-Cotes formula will yield accurate results for the integral. For
!4 1 −1
instance, I(f ) = −4 1+x 2 dx = 2 tan 4 ≈ 2.6516. But the closed Newton-
Cotes formula yields
n 3 5 7 9 11
For this reason, we
Qn (f ) 5.4902 2.2776 3.3288 1.9411 3.5956
seldom use the Newton-Cotes formula for n > 5 in practice. Instead, we limit
n ≤ 5 and the so called composited rules.
Example. Suppose the interval [a, b] is divided into an even number, say 2m,
of subintervals. Let h = b−a
2m , xi = a + ih, i = 0, 1, . . . , 2m. Then the composite
simpson’s rule takes the form
" b # m−1 m−1
%
h $ $
f (x)dx = f (a) + 2 f (x2i ) + 4 f (x2i+1 ) + f (b)
a 3 i=1 i=0
(b − a) 4 (4)
− h f (ξ). (8.24)
180
Remark. Suppose f (xi ) = yi +"i where yi is the floating point number approx-
imation to f (xi ) and "i is the roundoff error. Upon substituting these values
into (8.24), we obtain
" b # m−1 m−1
%
h $ $
f (x)dx = y0 + 2 y2i + 4 y2i+1 + y2m
a 3 i=1 i=0
# m−1 m−1
%
h $ $
+ "0 + 2 "2i + f "2i+1 + "2m . (8.25)
3 i=1 i=0
Suppose |"i | ≤ ". Then the error due to roundoff is bounded by h3 6m" = (b−a)".
Thus, unlike the process of numerical differentiation, numerical integration using
composite rule is a stable process in the sense that the error due to roundoff is
independent of the stepsize h.
spaced nodes in [a, b]. Gaussian quadrature results from a different approach
in which both the abscissas xi and weights αi are to be determined so that the
quadrature
n
!
Qn (f ) = αi f (xi ) (8.26)
i=1
has a maximal degree of precision. Since there are 2n unknowns in (8.26), the
requirements
En (xk ) = 0, k = 0, 1, . . . , 2n − 1 (8.27)
supply 2n equations. Thus it is expected that the maximal degree of precision
is ≥ 2n − 1. The condition (8.27) is equivalent to
n
! bk+1 − ak+1
αi xki = , k = 0, 1, . . . , 2n − 1 (8.28)
i=1
k+1
which is a nonlinear system. It is not clear whether (8.28) always has a solution
for arbitrary a and b. Neither is it clear whether the solution of (8.28) is real-
valued or not.
The coefficient matrix is the von de Morde matrix. Thus system (8.29) has a
unique solution for (αi ). On the other hand, we can construct an interpolating
polynomial using the same nodes {xi }. This polynomial results in a quadrature
!n
formula βi f (xi ) which has degree of precision ≥ n − 1. By setting En (xk ) =
i=1
0 for k = 0, . . . , n − 1, we end up with the same linear system (8.29). By
uniqueness, it must be that αi = βi . ⊕
By Theorem 8.4.1, the gaussian quadrature may be thought of as the inte-
gration of ascertain polynomial that interpolates f (x) at a certain set of nodes
8.4. GAUSSIAN QUADRATURE 7
Lemma 8.4.1 If f (x) = xn+ν , ν ≥ 0, then the n-th divided difference f [x1 , . . . , xn , x]
is a polynomial of degree at most ν.
x1+ν −x1+ν
(pf): When n = 1, we find f [x1 , x] = f (xx11)−f −x
(x)
= 1 x1 −x is obviously a
polynomial of degree ν. Suppose the assertion is true for n = k. Consider f (x) =
xk+1+ν . Then f [x2 , . . . , xk+1 , x], by induction hypothesis, is a polynomial of de-
f [x1 ,...,xk+1 −f [x2 ,...,xk+1 ,x]
gree at most ν + 1. Observe that f [x1 , . . . , xk+1 , x] = x1 −x .
Note that the numerator has a zero at x = x1 . Thus f [x1 , . . . , xk+1 , x] is a
polynomial of degree of most ν. The assertion now follows from the induction.
⊕
From (8.30) and Lemma 8.4.1, we see that En (f ) = 0 for f (x) = xn , . . . , xn+ν
n
#b "
if and only if a xk (x − xi )dx = 0 holds for k = 0, 1, . . . , ν. Thus we are seek-
i+1
n
"
ing {xi } so that ωn (x) := (x − xi ) is perpendicular to functions 1, x, . . . , xν .
i=1
(x)
Since ωn is a polynomial of degree n, we cannot have ν ≥ n; otherwise, the
polynomial ωn (x) would be perpendicular to itself. Is it then possible to have
ν = n − 1? The answer is positive.
Lemma 8.4.2 From the basic polynomials 1, x, x2 , . . . and the inner product
#b
< f, g >:= a f (x)g(x)dx, we can generate a new basis of polynomials {φk (x)}
such that φk is of degree k, and < φi , φh >= 0 whenever i $= j. The φk ’s are
unique up to constant multipliers.
Remark. Without loss of generality, we may assume [a, b] = [−1, 1]. In this
case, the orthogonal polynomial are known as the Legendre’s polynomials and
are given by:
P0 (x) = 1, (8.31)
P1 (x) = x, (8.32)
1
P2 (x) = (3x2 − 1), (8.33)
2
1 dk 2
Pk (x) = (x − 1)k . (8.34)
2k k! dxk
The resulting quadrature is known as the Gauss-Legendre quadrature formula.
Theorem 8.4.2 All the n zeros of the orthogonal polynomial φn (x) are real-
valued, distinct, and contained in (a, b).
(pf): Let x1 , . . . , xm ∈ (a, b) denote all the distinct, real zeros of φn (x) with
!b
odd multiplicity. Assume m < n. Consider the integral a (x − x1 ) . . . (x −
xm )φn (x)dx. Note that the integrand does not change sign over [a, b] and is
not identically zero. Thus the integral is positive. On the other hand, observe
that (x − x1 ) . . . (x − xm ) is a polynomial of degree m < n. By orthogonality
of φn (x), the integral should be zero. This is a contradiction. Thus it must be
that m = n, and the multiplicity is 1.
We now consider another approach to the Gaussian quadrature. Recall the
Hermite interpolation formula for f (x) (Example 1 in Section 7.3):
n
" n
"
f (x) = hi (x)f (ai ) + gi (x)f ! (ai )
i=1 i=1
ωn2 (x)
+ f (2n) (ξ) (8.35)
(2n)!
where
#n
x − aj ωn (x)
$i (x) = = (8.38)
j=1
a i − a j (x − ai )ωn! (ai )
j"=i
and
n
#
ωn (x) = (x − ai ). (8.39)
i=1
8.4. GAUSSIAN QUADRATURE 9
where
! b
αi = hi (x)dx (8.44)
a
! b
βi = gi (x)dx (8.45)
a
! b
ωn2 (x) (2n)
En (f ) = f (ξ)dx. (8.46)
a (2n)!
βj = 0, j = 1, . . . , n, (8.47)
ωn ⊥un−1 . (8.49)
Remark. By now we have reached the same conclusion as the other approach
on the property of the function ωn (x). Assume [a, b] = [1, −1]. Then
2n (n!)2
ωn (x) = Pn (x) (8.50)
(2n)!
P0 (x) = 1 (8.51)
P1 (x) = x (8.52)
2k + 1 k
Pk+1 (x) = xPk (x) − Pk−1 (x). (8.53)
k+1 k+1
We have seen from Theorem (8.4.2) that the zeros of the Legendre polyno-
mial of any degree are real, so this settles the question of the existence of real
abscissa. To find the weights we use (8.37) and (8.45) to get
" 1 " 1
αj = hj (x)dx = [1 − 2(x − aj )#"j (aj )]#2j (x)dx
−1 −1
" 1 " 1
= #2j (x)dx − 2#"j (aj ) (x − aj )#2j (x)dx
−1 −1
" 1
= #2j (x)dx (8.54)
−1
The following talbe shows the abscissas and weights for values of n of practical
interest.
8.5. OTHER GAUSSIAN QUADRATURES 11
n Abscissas xj Weights αj
√
2 ±1/ 3 1
√
3 ± 0.6 5/9
0 8/9
4 ±0.8611363116 0.3478548451
±0.3399810436 0.6521451549
5 ±0.9061798459 0.2369268850
±0.5384693101 0.4786286705
0 0.5688888889
6 ±0.9324695142 0.1713244924
±0.6612093865 0.3607615730
±0.2386191861 0.4679139346
To use Gauss quadrature to integrate f (x) over an arbitrary interval [a, b],
we simply map the ξ-interval [−1, 1] into the x-interval [a, b] using the linear
transformation
b−a b−a
x=a+ (ξ + 1), dx = dξ. (8.57)
2 2
Making this substitution in (8.26) gives
! b ! 1
b−a b−a
f (x)dx = f (a + (ξ + 1)) dξ (8.58)
a −1 2 2
! 1
b−a b−a
= f (a + (ξ + 1))dξ (8.59)
2 −1 2
n
b−a"
≈ αi f (xi ) (8.60)
2 i=1
where αj are the tabulated gaussian weights associated with the tabulated gaus-
sian abscissa aj in [−1, 1], and xj is obtained from aj as follows:
b−a
xj = a + (aj + 1), j = 1, . . . , n. (8.61)
2
where w(x) ≥ 0 on [a, b]. In such a case, we consider a quadrature rule of the
form
n
!
Qw (f ) := αi f (xi ). (8.63)
i=1
Note that the weight function w(x) does not appear on the right hand side of
(8.63). Using the same idea as discussed in the preceding section, it can be
proved that a sufficient and necessary condition for Qw (f ) to have as high the
degree of precision as possible is that the nodes xi are the zeros of an orthogonal
"n
polynomial with respect to w(x). That is, if ωn (x) := (x − xi ), then
i=1
# b
w(x)un−1 (x)ωn (x)dx = 0 (8.64)
a
for every polynomial un−1 (x) of degree ≥ n − 1. In this case, the quadrature
coefficients are
# b
αi := w(x)#i (x)dx (8.65)
a
Without repeating the arguments, we simply summarize below some of the well
known Gaussian formulas:
Weight function Interval Abscissas are Name of the special
w(x) [a, b] zeros of orthogonal polynomial
Obviously, if f (4) (x) various greatly in magnitude, then the error term in (8.67)
might not be reasonable. In practice, we should not introduce more than what
is necessarily many nodes to save the overhead. But near points where f (x)
behaves badly we should place denser nodes to maintain the accuracy. For
these reasons, we introduce an adaptive integration method which performs a
local error estimation and introduce nodes according to the behavior of the
integrand.
Let a = a0 < a1 < . . . < an = b be a partition of [a, b] where
hi := ai+1 − ai (8.68)
with ĥ := h2 . Thus
h 15ĥ5 (4)
R2 [α, α + h](f ) − R1 [α, α + ](f ) ≈ f (α + h) (8.74)
2 1440
and ! α+h
1
f (x)dx − R2 [α, α + h](f ) ≈ (R2 − R1 ). (8.75)
α 15
" ai +h "
In order that | ai f (x)dx − R2 [ai , ai + h](f )| < 2r , we check to see if
15"
|R2 [ai , ai + h](f ) − R1 [ai , ai + h](f )| < . (8.76)
2r
If (8.72) holds, we define ai+1 := ai + h, add " aR2 [ai , ai+1 ](f ) to the right hand
side of (8.66) to obtain an approximation of a i+1 f (x)dx, and go on to the next
subinterval. If (8.76) does not hold, we then consider the intervals [ai , ai + h2 ]
and [ai + h2 , ai + h] at the level r + 1. All the previously computed values should
be saved for future use. The integration is stopped when a subinterval [an−1 , b]
converges. A flowchart of the adaptive integration method is as follows:
Remark. The flowchart of adoptive integration method.
Chapter 9
Numerical Ordinary
Differential Equations -
Initial Value Problems
1
2 Initial Value Problems
Example. The simplest 1-step method for solving (9.1) is the so called Euler
method
yn+1 = yn + hn f (xn , yn ) (9.5)
where xn+1 = xn + hn and hn is the step size. Several questions are typical
topics in the numerical ODE theory — What is the global en := y(xn ) − yn ?
How is it constituted? How does it propagated? How does the step size affect
the error?
where xk = x0 + kh, fn−i := f (xn−i , yn−i ), and a2p + b2p "= 0. If b−1 = 0, then
the method is said to be explicit; otherwise, it is implicit.
Definition 9.1.2 The difference operator L associated with the linear (p + 1)-
step method (9.6) is defined to be, with a−1 = −1,
p
! p
!
L[y(x), h] := ai y(x + (p − i)h) + h bi y " (x + (p − i)h). (9.7)
i=−1 i=−1
Definition 9.1.3 When applying the scheme (9.6) to an initial value problem
(9.1), we say the local truncation error at xn+1 is L[y(xn−p ), h].
indeed represents the error introduced by the scheme at the present step when
no errors occur in all previous steps. If the scheme is implicit, then, by the
mean value theorem,
∂f
|L[y(xn−p+1 ), h]| = |hb−1 (xn+1 , ηn+1 ) + a−1 | |y(xn+1 ) − yn+1 |. (9.10)
∂y
Upon expanding the right hand side of (9.7) about x by the Taylor series
and collecting the like powers of h, we have
where
p
!
c0 = ai , (9.12)
i=−1
p−1
! p
!
c1 = (p − i)ai + bi , (9.13)
i=−1 i=−1
p−1 p−1
1 ! 1 !
cq = (p − i)q ai + (p − i)q−1 bi , q ≥ 2. (9.14)
q! i=−1 (q − 1)! i=−1
The exact solution is y(x) = e−x . The numerical scheme will produce a finite
difference equation
yn+1 = yn−1 − 2hyn . (9.20)
To solve (9.20) we try a solution of the form
yn = r n . (9.21)
we have
√
r2 − y1 h2 + 1 + h + y 1
α1 = = √ (9.23)
r2 − r1 2
h2 + 1
√
r1 − y1 −h + h2 + 1 − y1
α2 = = √ . (9.24)
r1 − r2 2
h2 + 1
We note that |r1 | < 1 and |r2 | > 1. Therefore, unless y1 is chosen such that
α2 = 0, yn grows unboundedly and, hence, deviated from the exact solution
regardless of the step size. Such a phenomenon is called numerical unstability.
Consider a general finite difference equation
p
!
ai yn−i = φn (9.25)
i=−1
proved that r0n , nr1n , n(n − 1)r2n , r3n , . . . , rpn are linearly independent. In this
case, the general solution ŷn is given by
p
!
ŷn = α0 r0n + α1 nr1n + α2 n2 r2n + αj rjn . (9.30)
j=3
Definition 9.2.1 The first and the second characteristic polynomials associated
with a linear multistep method
p
! p
!
ai yn−i + h bi fn−i = 0, (9.31)
i=−1 i=−1
p
!
P2 (r) := bi rp−i . (9.33)
i=−1
We say the method is zero-stable if and only if all roots of P1 (r) have modulus
≤ 1 and those with modulus 1 are simple.
Remark. The simpson’s rule is the best zero-stable 2-step method that attains
the optimal order 4.
We now apply the multistep method (9.31) to the text problem
y " = λy (9.34)
where λ ∈ R is a fixed constant. Recall that the local truncation error Tn+1 at
xn+1 is defined by
p
! p
!
Tn+1 := ai y(xn−i ) + h bi λy(xn−i ). (9.35)
i=−1 i=−1
9.2. STABILITY THEORY OF MULTI-STEP METHODS 7
Then the global errors ẽn := y(xn ) − ỹn−i satisfy the difference equation
p
! p
!
ai ẽn−i + λh bi ẽn−i = Tn+1 − Rn+1 . (9.37)
i=−1 i=−1
"p
if we assume all roots r0 , . . . , rp of the polynomial ii=−1 (ai + λhbi )rp−i are
distinct.
# p
!
(r, h) := P1 (r) + hP2 (r) = (ai + hbi )rp−i (9.39)
i=−1
r1 = 1 + h + 0(h−2 ) (9.40)
1
r2 = −1 + h + 0(h−2 ). (9.41)
3
Hence, if h > 0, then r1 > 0 and r2 > −1. If h < 0, then r1 < 1 and r2 < −1.
In other words, Simpson’s rule is no where absolutely stable.
8 Initial Value Problems
For s = 0, . . . , m − 1, do (9.45)
(s) (s)
fn+1 = f (xn+1 , yn+1 ) (9.46)
p
! p
!
(s+1) (m) (m) (s)
yn+1 = ai yn−1 + h bi fn−i + hb−1 fn+1 (9.47)
i=−1 i=0
(m) (m)
fn+1 = f (xn+1 , yn+1 ). (9.48)
The selection of the pair of the predictor and the corrector should not be
arbitrary. Rather
Theorem 9.3.1 Let r∗ and r be the order of the predictor and the corrector,
respectively.
(1) If the correction to convergence is used and if r∗ ≥ r, then the principal
local truncation error of the PC method is that of the corrector alone. The
properties of the predictor is immaterial.
(2) If P (EC)m method is used and if r∗ = r − q, 0 ≤ q < r, then the local
truncation of the PC method is
(a) that of the corrector alone if m ≥ q + 1; or
(b) of the same order as the corrector (but the error constant is larger) is
m = q; or
(c) of the form 0(hr−q+m+1 ) if m ≤ q − 1.
9.4. RUNGE-KUTTA METHODS 9
Remark. From the above theorem, we conclude that the predictor should not
be any better than the corrector. In practice, it is believed that the choice
r∗ = r with m = 1 is the best combination.
An important advantage of the PC method is the ease of estimating local
truncation errors. Suppose r∗ = r. Then under the local assumption, we know
(0)
y(xn+1 ) − yn+1 = c∗r+1 hr+1 y (r+1) + 0(hr+2 ) (9.49)
(m)
y(xn+1 ) − yn+1 = cr+1 hr+1 y (r+!) + 0(hr+2 ). (9.50)
It follows that
(m) (0)
yn+1 − yn+1 = (c∗r+1 − cr+1 )hr+1 y (r+1) + 0(hr+2 ). (9.51)
(m)
Therefore, the global error y(xn+1 ) − yn+1 is estimated by
cr+1 ! "
(m) (m) (0)
y(xn+1 ) − yn+1 ≈ ∗ yn+1 − yn+1 . (9.52)
cr+1 − cr+1
Such an estimate of error is called the Milne’s device. Note the right hand side
of (9.52) does not involve any high order derivative calculation. Note also the
local assumption is not realistic in practice. Thus the estimate should be used
with conservation.
Example. The following is a 4-th order Adams-Bashforth-Moulton pair;
h 251 5 (5)
yn+1 = yn + 24 (55fn − 59fn−1 + 37fn−2 − 9fn−3 ) , Tn+1 ≈ 720 h y
h 19 5 (5)
yn+1 = yn + 24 (9fn+1 + 19fn − 5fn−1 + fn−2 ) , Tn+1 ≈ − 720 h y .
It can be shown, analogous to the preceding section, that the stability polyno-
mial for a P (Ec)m E method is given by
# ! ∗
"
r, h) − P1 (r) + hP 2 (r) + Mm (h)(P1∗ (r) + hP 2 (r) (9.53)
P (EC)m E
where
(hb−1 )m (1 − hb−1 )
Mm (h) = . (9.54)
1 − (hb−1 )m
With somewhat more complicated analysis, one can show that the PC method
is absolutely unstable for small h > 0.
where
R
!
φ(x, y, h) = cr kr , (9.56)
r=1
R
!
kr = f (x + har , y + h brs ks ), r = 1, . . . , R, (9.57)
s=1
R
!
ar = brs . (9.58)
s=1
a B
(9.59)
cT
h2 (2)
y(xn+1 ) = y(xn ) + hy (1) (xn ) + y (xn ) + . . . (9.61)
2!
Thus by defining
h df
φT (x, y, h) := f (x, y) + (x, y) + . . . (9.62)
2! dx
we see that the Taylor algorithm of order p falls within the class (9.55).
If we choose values for the constants cr , ar , brs such that the expansion of the
function φ defined by (9.56) in powers of h differs from the expansion for φT (x, y)
9.4. RUNGE-KUTTA METHODS 11
defined in (9.62) only in the p-th and higher powers of h, then the method clearly
has order p. Although there is a great deal of tedious manipulation involved in
deriving Runge-Kutta methods of higher order, some well known methods have
already been developed. It is quite often that given a specific order, there are a
2-parameter family of Runge-Kutta methods all of which have the same order
of accuracy.
Examples. Two fourth-order 4-stage explicit Runge-Kutta methods
0 0
1/2 1/2 0
1/2 0 1/2 0 (9.63)
1 0 0 1 0
1/6 2/6 2/6 1/6
0 0
1/3 1/3 0
2/3 -1/3 1 0 (9.64)
1 1 -1 1 0
1/8 3/8 3/8 1/8
Example. The unique 2-stage implicit Runge-Kutta method of order 4:
√ √
1/2 + √3/6 1/4√ (1/4 + 3/6
1/2 − 3/6 (1/4 − 3/6 1/4 (9.65)
1/2 1/2
0 0 0 0
1/2 1/4 1/4 0
(9.66)
1 0 1 0
1/6 4/6 1/6
R 1 2 3 4 5 6 7 8 9 ≥ 10
. (9.67)
P ∗ (R) 1 2 3 4 4 5 6 6 7 ≤R−2
or equivalently,
k = λ(I − hB)−1 eyn . (9.69)
Thus, analogous to (9.37), we have
T
ẽn+1 = ẽn + hc (I − hB)−1 eẽn (9.70)
satisfies |r| < 1 whenever h ∈ (α, β). Note that, in contrast to the multistep
method, the stability of a Runge-Kutta method is determined by only one root.
In fact, it can be proved that
Examples.
Euler Rule Midpoint Rule Simpson’s Rule Trapezoial Rule
yn+1 = yn +hfn yn+1 = yn−1 +2hfn yn+1 = yn−1 + h3 (fn−1 +4fn +fn+1 ) yn+1 = yn + h2 (fn +fn+1 )
a−1 -1 -1 -1 -1
a0 1 0 0 0
a1 1 1 0
b−1 0 0 1/3 1/2
b0 1 2 4/3 0
b1 0 1/3 1/2
r 1 2 4 2
p+1 1 2 2 1