MA128ALectureWeek3 PDF
MA128ALectureWeek3 PDF
a1 ≤ a2 ≤ · · · ≤ an ≤ · · · ≤ · · · ≤ bn ≤ · · · ≤ b2 ≤ b1 .
Thus sequences {an } and {bn } monotonically converge to
limits a∞ ≤ b∞ , respectively.
I Since f (an ) · f (bn ) < 0 for all n, it follows that
f (a∞ ) · f (b∞ ) ≤ 0, and thus a root p ∈ [a∞ , b∞ ] ⊂ [an , bn ]
exists.
bn −an
I Since pn = an +b 2 , it follows that |pn − p| ≤
n
2 .
I By construction
bn−1 − an−1 bn−2 − an−2 b 1 − a1 b−a
bn −an = = 2
= · · · = n−1 = n−1 .
2 2 2 2
I Put together,
b−a
|pn − p| ≤ .
2n
I In fact, a∞ = b∞ = p.
Example Function with Root
x 2
function = $e − (2+2x )$
7
−1
−2
−3
2.5 2.6 2.7 2.8 2.9 3 3.1 3.2 3.3 3.4 3.5
Bisection Method with 52 Points
7
−1
−2
−3
2.5 2.6 2.7 2.8 2.9 3 3.1 3.2 3.3 3.4 3.5
Fixed Point Iteration
pn = g (pn−1 ), n = 1, 2, · · · ,
−0.5
−1
−1.5
−2
−2.5
2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3
Fixed Point: x − (1 − cos(x)) = 0: fast convergence
I Since
lim k n = 0,
n→∞
{pn }∞
n=0 converges to p.
Newton’s Method for solving f (p) = 0
I Suppose that f ∈ C 2 [a, b].
I Let p0 ∈ [a, b] be an approximation to p with
(p − p0 )2 00
0 = f (p) = f (p0 ) + (p − p0 )f 0 (p0 ) + f (ξ(p)).
2
”Solve” for p:
f (p0 ) (p − p0 )2 00
p = p0 − − f (ξ(p))
f 0 (p0 ) 2f 0 (p0 )
f (p0 ) def
≈ p0 − 0 = p1 .
f (p0 )
f (pk )
Newton’s Method: pk+1 = pk − f 0 (pk ) , k = 0, 1, · · ·
Newton’s Method for solving f (p) = 0
f (p0 ) (p − p0 )2 00
p = p0 − − f (ξ(p))
f 0 (p0 ) 2f 0 (p0 )
f (p0 ) def
≈ p0 − 0 = p1 .
f (p0 )
(p − p0 )2 00
0 = f (p) = f (p0 ) + (p − p0 )f 0 (p0 ) + f (ξ(p)).
2
I Replace f (x) by a straight line:
f (p0 ) + (p − p0 )f 0 (p0 ) ≈ 0.
I
f (p0 )
p ≈ p0 −
f 0 (p0 )
is the horizontal intercept of straight line
y = f (p0 ) + (x − p0 )f 0 (p0 )
Newton Method
Newton Method for f (x) = e x − (2 + 2x 2 )
Newton Method with 8 Points
8
−2
−4
2.6 2.8 3 3.2 3.4 3.6 3.8
Computing square root with Newton’s Method
def √
I Given a > 0, p = a is positive root of equation
def
f (x) = x 2 − a = 0.
I Newton’s Method
p2 − a
1 a
pk+1 = pk − k = pk + , k = 0, 1, 2, · · · ,
2pk 2 pk
I Newton’s Method is well defined for any p0 > 0.
Newton Method for square root
Proof of Theorem 2.6
I Newton’s method is fixed point iteration
pn = g (pn−1 ), g (x) = x − ff 0(x)
(x) .
I 0
Since f (p) 6= 0, there exists an interval
[p − δ1 , p + δ1 ] ⊂ [a, b] on which f 0 (x) 6= 0. Thus, g (x) is
defined on [p − δ1 , p + δ1 ].
I
Approach
f (pn )
I Newton method: pn+1 = pn − f 0 (pn ) .
I Replace f 0 (pn ) by its cheap approximation
f (pn ) − f (x) f (pn ) − f (pn−1 )
f 0 (pn ) = lim ≈ .
x→ pn − x pn − pn−1
I Secant method
f (pn )(pn − pn−1 )
pn+1 = pn − , n = 1, 2, · · · .
f (pn ) − f (pn−1 )
Secant Method: Geometry
(x − p0 )f (p1 ) − (x − p1 )f (p0 )
f (x) ≈ .
p1 − p0
20
15
10
−5
2.5 3 3.5 4
Performance: number of iterations vs. error in the solution
I Function to be considered
p = 2.98930778246493e + 00.
I Bisection Method
I Fixed Point Iteration
I Newton’s Method
I Secant Method
Bisection Method Order of Convergence
Convergence Rate, Bisection Method
0
10
−2
10
−4
10
−6
10
−8
10
−10
10
−12
10
−14
10
−16
10
0 10 20 30 40 50 60
Fixed Point Iteration Order of Convergence
Convergence Rate, Fixed Point Method
0
10
−5
10
−10
10
−15
10
0 10 20 30 40 50 60 70
Secant Method Order of Convergence
Convergence Rate, Secant Method
2
10
0
10
−2
10
−4
10
−6
10
−8
10
−10
10
−12
10
1 2 3 4 5 6 7 8 9 10
Newton Method Order of Convergence
Convergence Rate, Newton Method
0
10
−2
10
−4
10
−6
10
−8
10
−10
10
−12
10
−14
10
1 2 3 4 5 6 7
Order of convergence
Linear and Quadratic Order of convergence
Recall rate of convergence: the Big O
def √
I Given a > 0, p = a is positive root of equation
def
f (x) = x 2 − a = 0.
I Newton’s Method
p2 − a
1 a
pk+1 = pk − k = pk + , k = 0, 1, 2, · · · ,
2pk 2 pk
I Newton’s Method is well defined for any p0 > 0.
√
Newton’s Method for a converges quadratically if p0 > 0
√
I {pk }∞
k=1 bounded below by a:
√ 2
√ √ pk−1 − a
1 a
pk − a = pk−1 + − a= ≥ 0, k = 1, 2, · · · ,
2 pk−1 2pk−1
I {pk }∞
k=1 monotonically decreasing:
a − pk2
1 a
pk+1 − pk = pk + − pk = ≤ 0, k = 1, 2, · · · ,
2 pk 2pk
def
I limk→∞ pk = p exists and satisfies Newton Iteration:
√ √
1 a
p= p+ ≥ a, therefore p = a.
2 p
I Newton’s Method quadratically convergent
√
|pk − a| 1 1
lim √ 2 = lim = √ .
k→∞ p k→∞ 2pk−1 2 a
k−1 − a
Linear Convergence Theorem of Fixed Point Iteration
pk = g (pk−1 ), k = 1, 2, · · · ,
|pk+1 − p|
lim = |g 0 (p)| ≤ κ, if pk 6= p for all k.
k→∞ |pk − p|
I Therefore
|pk+1 − p| 1
lim 2
= |g 00 (p)|, if pk 6= p for all k.
k→∞ |pk − p| 2
I Taylor expansion at p:
ξk between p, pk 1
g (pk ) ========== g (p) + g 0 (p)(pk − p) + g 00 (ξk )(pk − p)2
2
1 00
========== g (p) + g (ξk )(pk − p)2
2
I Therefore
|pk+1 − p| |g (pk ) − p| 1 |g 00 (ξk )(pk − p)2 |
lim = lim = lim
k→∞ |pk − p|2 k→∞ |pk − p|2 2 k→∞ |pk − p|2
1 00
= |g (p)|
2
Quadratic Convergence of Newton Iteration
I Newton Iteration is FPI with
f (x)
g (x) = x − ,
f 0 (x)
and with f (p) = 0.
I derivatives
f (x)f 00 (x)
g 0 (x) =
(f 0 (x))2
f 00 (x) f 0 (x) f 000 (x) − 2 (f 00 (x))2
g 00 (x) = + f (x)
f 0 (x) (f 0 (x))3
I therefore
f 00 (p)
g 0 (p) = 0, and g 00 (p) = 0 ,
f (p)
1 f 00 (p)
|pk+1 − p|
lim = , if f 0 (p) 6= 0.
k→∞ |pk − p|2 2 f 0 (p)
Multiple roots: f (p) = 0, f 0 (p) = 0
m f (pk )
pk+1 = pk − , for k = 1, 2, · · · , (m = multiplicity of root p.)
f 0 (pk )
m f (x)
pk+1 = g (pk ), g (x) = x − , for k = 1, 2, · · · ,
f 0 (x)
pk+1 − p
lim = λ, |λ| < 1.
k→∞ pk − p
I Define
pk+1 − p def
= λk ,
pk − p
so that {λk }∞
k=1 converges to λ.
I It follows that
pk+2 − p pk+1 − p
0 ≈ λk+1 − λk = − .
pk+1 − p pk − p
I Solve for p:
2
pk+1 − pk pk+2 (λk+1 − λk )(pk+1 − p)(pk − p)
p= + .
2pk+1 − pk − pk+2 2(pk+1 − p) − (pk − p) − (pk+2 − p)
Accelerating Convergence: Aitken’s ∆2 Method
2
pk+1 − pk pk+2
def
pbk =
2pk+1 − pk − pk+2
(pk+1 − pk )2 def
= pk − = {∆2 }(pk ).
pk+2 − 2pk+1 + pk
Approximation Error
(λk+1 − λk )(pk+1 − p)(pk − p)
|b
pk − p| =
2(pk+1 − p) − (pk − p) − (pk+2 − p)
k+1 − λk )(pk − p)
(λ
=
−1
p −p pk+2 −p
2 − pk+1 −
k −p pk+1 −p
(λk+1 − λk )(pk − p)
≈
O (|pk − p|) .
2 − λ−1 − λ
Accelerating Convergence: Aitken’s ∆2 Method
(pk+1 − pk )2
{∆2 }(pk ) = pk − .
pk+2 − 2pk+1 + pk
I Steffensen’s Method: use Aitken’s Acceleration as soon as
iterations are generated:
(0)
I Given p0
I for k = 0, 1, 2, · · · ,
(k) (k) (k) (k) (k+1) (k)
p1 = g (p0 ), p2 = g (p1 ), p0 = {∆2 }(p0 ).
Fixed point for g (x) = log (2 + 2x 2 )
FixedPoint Method with 66 Points
0
−0.5
−1
−1.5
−2
−2.5
2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3
Fixed Point Iteration: Linear Convergence
Convergence Rate, Fixed Point Method
0
10
−5
10
−10
10
−15
10
0 10 20 30 40 50 60 70
Aitken’s Method: Faster, but Linear Convergence
−2
10
−4
10
−6
10
−8
10
−10
10
−12
10
−14
10
−16
10
0 10 20 30 40 50 60 70
Steffenson’s Method: Quadratic Convergence
−1
10
−2
10
−3
10
−4
10
−5
10
−6
10
−7
10
−8
10
−9
10
1 1.5 2 2.5 3 3.5 4 4.5 5
Newton’s Method on Polynomial roots = Horner’s Method
Let
P(x) = an xn + an−1 xn−1 + · · · + a1 x + a0 .
Horner’s Method computes P(x0 ) and P 0 (x0 )
I define bn = an
I for k = n − 1, n − 2, · · · , 1, 0
bk = ak + bk+1 x0 ,
I then
b0 = P(x0 )
P(x) = (x − x0 ) Q(x) + b0
Q(x) = bn xn−1 + bn−1 xn−2 + · · · + b2 x + b1 .
I it follows
P 0 (x) = Q(x) + (x − x0 ) Q 0 (x)
P 0 (x0 ) = Q(x0 )
Horner’s Method
Muller’s Method: finding complex roots
I Given three points (p0 , f (p0 )), (p1 , f (p1 )), and (p2 , f (p2 )).
I Construct a parabola through them,
I p3 is the intersection of x-axis with parabola closer to p2 .
Secant Method vs. Muller’s Method
Muller’s Method: derivation
Choose parabola
P(x) = a(x − p2 )2 + b(x − p2 ) + c.
a, b, c satisfy
Muller’s Method: finding complex roots
0
10
−1
10
−2
10
−3
10
−4
10
−5
10
−6
10
−7
10
1 2 3 4 5 6 7 8 9
Choices, and more Choices
I Given two distinct points (p0 , f (p0 )) and (p1 , f (p1 )), there is
a unique line connecting them
x − p1 x − p0
P(x) = f (p0 ) · + f (p1 ) ·
p0 − p1 p1 − p0
def
= f (p0 ) · L0 (x) + f (p1 ) · L1 (x),
L0 (p0 ) = 1, L0 (p1 ) = 0,
L1 (p0 ) = 0, L1 (p1 ) = 1.
Connecting two dots
I Given two distinct points (p0 , f (p0 )) and (p1 , f (p1 )), there is
a unique line connecting them
x − p1 x − p0
P(x) = f (p0 ) · + f (p1 ) ·
p0 − p1 p1 − p0
Connecting n + 1 dots
I Given n + 1 distinct points
(x0 , f (x0 )), (x1 , f (x1 )), · · · , (xn , f (xn )),
I Find a degree ≤ n polynomial
P(x) = an x n + an−1 x n−1 + · · · + a1 x + a0 ,
so that P(x0 ) = f (x0 ), P(x1 ) = f (x1 ), · · · , P(xn ) = f (xn ).
Connecting n + 1 dots
P(x) = f (x0 )L0 (x) + f (x1 )L1 (x) + · · · + f (xn )Ln (x),
f (xj ) = P(xj ) = f (x0 )L0 (xj ) + f (x1 )L1 (xj ) + · · · + f (xn )Ln (xj )
P(x) = f (x0 )L0 (x) + f (x1 )L1 (x) + · · · + f (xn )Ln (x),
1, if i = j,
Li (xj ) =
0, if i 6= j,