Professional Documents
Culture Documents
Numerical Analysis
Solutions of Equations in One Variable
OL Say
ol.say@itc.edu.kh
2 Fixed-Point Iteration
3 Newton’s Method
b1 − a1 a1 + b1
p1 = a1 + = .
2 2
Theorem 1
Suppose that f ∈ C[a, b] and f (a) · f (b) < 0. The Bisection method
generates a sequence {pn }∞n=1 approximating a zero p of f with
b−a
|pn − p| ≤ , when n ≥ 1.
2n
Example 2
−3 −2 −1 0 1 2 3
Proof.
Example 4
Proof.
0
−3 −2 −1 0 1 2 3
−1
−2
−3
Theorem 5
1 If g ∈ C[a, b] and g(x) ∈ [a, b] for all x ∈ [a, b], then g has at least
one fixed point in [a, b].
2 If, in addition, g(x) exists on (a, b) and a positive constant k < 1
exists with
b
p
a pb
Let g ∈ C[a, b] be such that g(x) ∈ [a, b], for all x in [a, b]. Suppose, in
addition, that g′ exists on (a, b) and that a constant 0 < k < 1 exists
with
pn = g(pn−1 ), n ≥ 1,
Corollary 7
and
kn
|pn − p| ≤ |p1 − p0 |, for all n ≥ 1.
1−k
Example 8
The equation x3 + 4x2 − 10 = 0 has a unique root in [1, 2]. There are
many ways to changethe equation to the fixed-point form x = g(x)
using simple algebraic manipulation. It is not important for you to
derive thefunctions shown here, but you should verify that the fixed
point of each is actually a solution to the original equation,
x3 + 4x2 − 10 = 0. For instance,
1 g1 (x) = x − x3 − 4x2 + 10 1/2
1/2 10
10
4 g4 (x) =
2 g2 (x) = − 4x 4+x
x
x3 + 4x2 − 10
1 5 g5 (x) = x −
3 g3 (x) = (10 − x3 )1/2 3x2 + 8x
2
Fixed-Point Iteration
4 Set i = i + 1.
5 Set p0 = p.
6 OUTPUT ‘The method failed after N0 iterations.’
q
10
Table: Fixed-Point Iteration: g4 (x) = 4+x , x0 = 1.5
step x f(x)
0 1.5000000000000000 2.3750000000000000
1 1.3483997249264841 -0.2756368637700302
2 1.3673763719912828 0.0354809813042891
3 1.3649570154024870 -0.0045075217780894
4 1.3652647481134421 0.0005735977195567
5 1.3652255941605249 -0.0000729767397445
6 1.3652305756734338 0.0000092848153734
7 1.3652299418781833 -0.0000011813010481
8 1.3652300225155685 0.0000001502962341
9 1.3652300122561221 -0.0000000191220995
10 1.3652300135614253 0.0000000024328930
Newton’s Method
(p − p0 )2 ′′
f (p) = f (p0 ) + (p − p0 )f ′(p0 ) + f (𝜉(p)),
2
where 𝜉(p) lies between p and p0 . Since f (p) = 0 and Newton’s
Method is derived by assuming that |p − p0 | is small,
f (p0 )
p ≈ p0 − ′ := p1 . This sets the stage for Newton’s method,
f (p0 )
which starts with an initial approximation p0 and generates the
sequence {pn }∞ n=0 , by
f (pn−1 )
pn = pn−1 − , for n ≥ 1.
f ′(pn−1 )
OL Say (ITC) Numerical Analysis February 28, 2023 19 / 62
3. Newton’s Method
Let f ∈ C2 [a, b]. If p ∈ (a, b) is such that f (p) = 0 and f ′(p) ≠ 0, then
there exists a 𝛿 > 0 such that Newton’s method generates a
sequence {pn }∞ n=1 converging to p for any initial approximation
p0 ∈ [p − 𝛿, p + 𝛿].
The stopping-technique inequalities given with the Bisection
method are applicable to Newton’s method. That is, select a
tolerance 𝜀 > 0, and construct p1 , ... , pN until
Newton’s
5 Set i = i + 1
6 Set p0 = p
7 OUTPUT ‘The method failed after N0 iterations’
Example 10
Figure: y = cos x, y = x
Proof.
1 A solution to this root-finding problem is also a solution to the
fixed-point problem x = cos x, and the graph in above figure
implies that a single fixed-point p lies in [0, 𝜋/2]. In this case, we
choose p0 = 𝜋/4 ∈ [0, 𝜋/2].
𝜋
pn = g(pn−1 ) = cos(pn−1 ), p0 =
4
At n = 7, p7 ≈ 0.7361282565008520.
2 We have f ′(x) = − sin x − 1.
At n = 3, p3 = 0.7390851332151610.
The best we could conclude from these results is that p ≈ 0.74. □
OL Say (ITC) Numerical Analysis February 28, 2023 24 / 62
3. Newton’s Method
step x f (x)
0 0.7853981633974483 -0.0782913822109007
1 0.7071067811865476 0.0531378158890825
2 0.7602445970756301 -0.0355771161865038
3 0.7246674808891262 0.0240524049003580
4 0.7487198857894842 -0.0161590411972424
5 0.7325608445922418 0.0109033667230518
6 0.7434642113152936 -0.0073359548144416
7 0.7361282565008520 0.0049454305828581
8 0.7410736870837101 -0.0033295280911354
9 0.7377441589925747 0.0022436058032962
10 0.7399877647958709 -0.0015109560713171
step x f (x)
0 0.7853981633974483 -0.0782913822109007
1 0.7395361335152383 -0.0007548746825027
2 0.7390851781060102 -0.0000000751298666
3 0.7390851332151610 -0.0000000000000007
4 0.7390851332151606 0.0000000000000001
5 0.7390851332151607 0.0000000000000000
By definition of derivative,
f (x) − f (pn−1 )
f ′(pn−1 ) = lim .
x→pn−1 x − pn−1
f (pn−1 ) − f (pn−2 )
f ′(pn−1 ) ≈ .
pn−1 − pn−2
Secant Method
5 Set i = i + 1.
6 Set p0 = p1 ; q0 = q1 ; p1 = p; q1 = f (p).
7 OUTPUT ‘The method failed after N0 iterations’
Example 11
step x f(x)
0 0.0000000000000000 1.0000000000000000
1 0.3926990816987241 0.5311804508125626
2 0.5890486225480862 0.2424209897544590
3 0.6872233929727672 0.0857870603899697
.. .. ..
. . .
49 0.7390851332151605 0.0000000000000003
50 0.7390851332151605 0.0000000000000003
51 0.7390851332151605 0.0000000000000003
52 0.7390851332151607 0.0000000000000000
step x f(x)
0 1.5000000000000000 -1.4292627983322972
1 0.0707372016677029 0.9267619655388831
2 0.9974991672065860 -0.4550941748673661
3 0.5424049923392199 0.3140647166081081
.. .. ..
. . .
83 0.7390851332151603 0.0000000000000004
84 0.7390851332151608 -0.0000000000000002
85 0.7390851332151606 0.0000000000000001
86 0.7390851332151607 0.0000000000000000
step x f(x)
0 0.7853981633974483 -0.0782913822109007
1 0.7395361335152383 -0.0007548746825027
2 0.7390851781060102 -0.0000000751298666
3 0.7390851332151610 -0.0000000000000007
4 0.7390851332151606 0.0000000000000001
5 0.7390851332151607 0.0000000000000000
i x0 x1 f(x1)
0 0.5000000000000000 0.7853981633974483 -0.0782913822109007
1 0.7853981633974483 0.7363841388365822 0.0045177185221702
2 0.7363841388365822 0.7390581392138897 0.0000451772159638
3 0.7390581392138897 0.7390851493372764 -0.0000000269821671
4 0.7390851493372764 0.7390851332150645 0.0000000000001609
5 0.7390851332150645 0.7390851332151607 0.0000000000000000
Example 12
Corollary 14
Corollary 15
Theorem 16
c = f (p2 )
(p0 − p2 )2 [f (p1 ) − f (p2 )] − (p1 − p2 )2 [f (p0 ) − f (p2 )]
b=
(p0 − p2 )(p1 − p2 )(p0 − p1 )
(p1 − p2 )[f (p0 ) − f (p2 )] − (p0 − p2 )[f (p1 ) − f (p2 )]
a=
(p0 − p2 )(p1 − p2 )(p0 − p1 )
Example 17
n
Õ
Compute the value of P(x) = ak xk and its derivative at x0 .
k=1
INPUT Coefficients a0 , ... , an and x0 .
OUTPUT The value P(x0 ), P′(x0 ) and P′′(x0 ).
1 Set p = an ; dp = 0.
2 For k from 1 to n,
a set p = an−i + p ∗ x0
b set dp = p + dp ∗ x0
c set ddp = 2dp + ddp ∗ x0
Pn (x) = (x − x1 ) · · · (x − xn )
1 1
P′n (x)
= P(x) +···+
x − x1 x − xn
P′(x) 1 1
⇒ = +···+ ≡ G(x)
P(x) x − x1 x − xn
2
P′′(x) P′ (x)
1 1
⇒ − n =− −···− ≡ −H(x)
P(x) Pn (x) (x − x1 )2 (x − xn )2
a ≡ x − x1
b ≡ x − xi , ∀i = 2, ... , n.
1 n−1
G≡ +
a b
1 n−1
H≡ 2 + .
a b2
where the sign is taken to give the largest magnitude for the
denominator. To apply the method, calculate a for a trial value x,
then use x − a as the next trial value, and iterate until a becomes
sufficiently small.
h Set x0 = x0 − a.
i If |a| < TOL : OUTPUT x0 ; STOP.
2 OUTPUT “Too many iterations.”
Example 18