Annotated
Annotated
• f(x) = 3x - 2, f(x) = x2 + 2x - 3
• f(x) = x2 + ecos(x) - 3
x*
Root of the
tangent line
Formula for x1
f :
derivative of f
• Find x1: !
Xo) = =
f(Xo)
=> X -Xo
, = =)
f(Xo)
Root of f Our estimate of x*
Cassume f(x) +
0)
x*
Root of the
tangent line
Formula for x1
• The tangent line: y = f′(x0)(x − x0) + f(x0)
• Find x1:
x*
• This is called Newton’s method. Root of the
tangent line
Example 3.2.1 in [Atkinson-Han]
6
• Find a root of f(x) = x − x − 1 using Newton’s method.
Example 3.2.1 in [Atkinson-Han]
6
• Find a root of f(x) = x − x − 1 using Newton’s method.
• What do we need?
5
• Derivative: f′(x) = 6x − 1
Example 3.2.1 in [Atkinson-Han]
6
• Find a root of f(x) = x − x − 1 using Newton’s method.
• What do we need?
5
• Derivative: f′(x) = 6x − 1
6
f(xn) xn − xn − 1
Iteration formula: xn+1 = xn − = x − , n = 0,1,2,…
• f′(xn)
n
6xn − 1
5
• Matlab
True root: 1.134724138…
Newton’s method converges faster
Example 3.2.2 in [Atkinson-Han]
• Consider a procedure that was used to carry out divisions on some early
computers. These computers had hardware for addition, subtraction, and
multiplication, but division had to be implemented by software. This
procedure is also used on some present-day supercomputers.
1
• Let f(x) = b − (assume b > 0). Then, 1/b is a root of f(x) .
x
le+ b -
y 0 = X 5
= =
Example 3.2.2 in [Atkinson-Han]
1
• Find the root of f(x) = b − (assume b > 0 ) using Newton’s method.
x
• What do we need?
Xn += Xn-(bxi-Xn)
• An initial guess x0 for the root
1 2xn-bX
=
• Derivative: f′(x) =
x 2 xxn
=
xn(2 -
bxn)
-
•
-
Iteration formula:
O
f(xn) b − 1/xn
xn+1 = xn − = xn − = xn (2 − bxn ), n = 0,1,2,…
f′(xn) 1/xn2
Example 3.2.2 in [Atkinson-Han]
1
• Find the root of f(x) = b − (assume b > 0 ) using Newton’s method.
x
• What do we need?
• An initial guess x0 for the root
1
• Derivative: f′(x) =
x 2
Only has multiplication and subtraction,
• Iteration formula: no division
f(xn) b − 1/xn
xn+1 = xn − = xn − = xn (2 − bxn ), n = 0,1,2,…
f′(xn) 1/xn2
Example 3.2.2 in [Atkinson-Han]
1
• Initial guess x0 for the root of f(x) = b − (assume b > 0 ). Of course, we
x
should have x0 > 0.
relative error
↑ 1/b − x
2 n
• Claim. Rel(xn+1 ) = Rel(xn ) , where rel(xn ) = is the relative
1/b
error when considering xn as an approximation to the root 1/b.
If.
=
Rel(Xuy) X
-ex by
+
=
Example 3.2.2 in [Atkinson-Han]
1
• Initial guess x0 for the root of f(x) = b − (assume b > 0 ). Of course, we
x
should have x0 > 0.
Rel (Xn 14
(Rellxn-1) (2 1/b − x
= -
2 n
• Claim. Rel(xn+1) = Rel(xn) , where rel(xn) = is the relative
-
1/b
error when considering xn as an approximation to the root 1/b.
n
2
• So, Irel(xn) 111
= rel(x0) for n = 1,2,…
=>
Example 3.2.2 in [Atkinson-Han]
1
• Initial guess x0 for the root of f(x) = b − (assume b > 0 ). Of course, we
x
should have x0 > 0.
E) -
2 -
bx o
- 0x7
Example 3.2.2 in [Atkinson-Han]
• Convergence condition:
=
y
Example 3.2.2 in [Atkinson-Han]
2
• The formula Rel(xn+1) = Rel(xn) shows the convergence is very rapid,
once we have a somewhat accurate initial guess. For example,
| Rel(x0) | = 0.1 (10% error in x0), then
Convergence
• Assumption on f:
• Has two continuous derivatives for all x in some interval around x* (root)
• f′(x*) ≠ 0 (aka, the graph of y = f(x) is not tangent to the x-axis when the
graph intersects it at x = x*; it implies that x* is a simple root)
• The case f′(x*) = 0 is treated in [AH] Chapter 3.5 (won’t cover in class)
Convergence
straight line :
Y = fixn)(X- Xn) + f(xn)
/
(x*) (x* (x*
-
O
x* (x*)
I x* (x*
Xn + 1 + (x
*
-
2f(Xn)
Convergence
f(xn)
-
Recall that xn+1 = xn − . We have
f′(xn)
x* x*
x*
x* x*
-
Convergence
f(xn)
Recall that xn+1 = xn − . We have
f′(xn)
x* x*
x*
x* x*
The error in xn+1 is nearly proportional to the square of the error in xn.
When the error in x0 is sufficiently small, the error in the succeeding iterations
will decrease very rapidly.
Example 3.2.1 in [Atkinson-Han]
6
• Find a root of f(x) = x − x − 1 using Newton’s method.
5
• f′(x) = 6x − 1 X
*
t
4
• f′′(x) = 30x
Xn)( =
* *
x -
xn+ 1
=
(X -
-
Example 3.2.3 in [Atkinson-Han]
*
(x*) (x*) 4 x = 1 ,
13472438
..
(x*) 6(x*)5
x* x*
x*
x*
x*
Convergence
• Recall x* x*
(x*)
(x*)
-
x* x*
x* x*
Convergence
x*
x* x*
x*
x*
-
(x*)
x*
(x*)
Find x0
• If | M | is large, then x0 will have to be chosen very close to the root to
obtain convergence.
1
• Bisection method: En+1 ≤ ⋅ E n
2
• Linear convergence (En+1 is linear in En)
• If we have the same En ≪ 1 for Newton and bisection methods, the error
of Newton in iteration n+1 is much smaller than that of bisection.
True root: 1.134724138…
Newton’s method converges faster
Comparison
• Newton’s method • Bisection method
B f(xn) f(xn)
Since f(x*) = 0, we have x* − xn = − ≈ − = x − x
• f′(c) f′(xn)
n+1 n
p
Newton's iteration
Stopping criteria for Newton’s method
• Our goal is to find xn such that | x* − xn | < tol (pre-specified tolerance). Issue:
don’t know x*
*
X
X