5.5 Newton`s Approximation Method

−2
3
y
3
2
2
1
1
−1
−2
2
−2
y = cos x
f (x
)=
=
x−
4
x
4
co s
x
498CHAPTER 5. USING DERIVATIVES TO ANALYZE FUNCTIONS; FURTHER APPLICATIONS
−1
2
−2
−3
−3
x = cos x
⇐⇒
x − cos x = 0
Figure 5.11: Figure showing the existence of a solution of x = cos x which occurs where
the graphs of y = x and y = cos x intersect, or equivalently a solution of f (x) = 0 where
f (x) = x − cos x.
5.5
Newton’s Approximation Method
While there are many types of equations we can solve algebraically—and students typically
spend much time in their young years learning to solve them—there are numerous equations we
cannot solve algebraically. We can often demonstrate that there exist solutions, and perhaps
even discover the number of solutions, without actually knowing the exact solutions. Within
industry approximate solutions often suffice, though the level of precision needed varies from
problem to problem. When the problem is very complex, or an approximate solution is needed
quickly, efficiency becomes an important consideration. Efficiency, accuracy, and prospects for
success are all factors when choosing a mehtod, and what works well for one problem might not
work well—or even at all—for another.
In this section we will look at an approximating scheme attributed to Newton, though the
modern interpretation has been ascribed to Thomas Simpson (of Simpson’s Rule, Section 8.3).
We will also examine other methods for comparison.
5.5.1
Approximating Methods Applied to an Example
Consider the equation
x = cos x.
(5.20)
We can tell from the first figure of Figure 5.11 that there is a solution of this equation somewhere
in x ∈ [0, 2]. In fact, by the Intermediate Value Theorem (page 196) we can look at
f (x) = x − cos x
(5.21)
and note that f (x) is continuous everywhere, f (0) = 0 − 1 = −1 < 0, while f (π/2) = π/2 − 0 =
π/2 > 0, so there is a solution of f (x) = 0 in x ∈ [0, π/2], meaning there is a solution of
5.5. NEWTON’S APPROXIMATION METHOD
499
x = cos x there as well. Rather than solving the original equation (5.20), we will instead solve
the equivalent equation (5.21). To do so, we will consider three methods in turn.
Solve by graphing: If we have access to a device such as a graphing calculator, we can make
successive magnifications of the window near the apparent solution, and thereby “zoom in”
to the solution repeatedly, in the meantime reading off better and better approximations
from the provided axes or curve tracing features of the device. While visually appealing,
it is not an easy process to train a primitive device to implement.
Method of Bisection: This method is based on the Intermediate Value Theorem, where we
check the sign of f (x) at various points, and once we detect a sign change on an interval,
we check the sign of f (x) at the midpoint of the interval to see which subinterval (left or
right) contained the sign change, and then we continue, each time halving the length of
the interval with the sign change. In this way we can ultimately get as close to the actual
value as we wish.
For instance, if we wish to attempt this method with our current problem, we would
compute
f (0) = −1 < 0
sign change in [0, 2].
f (2) = 2 − cos 2 ≈ 1.090702573 > 0
Next we consider the value of f (x) at the midpoint of [0, 2], and include the previous values
for clarity:

f (0) = −1 < 0

f (1) = 1 − cos 1 ≈ 0.4596796941 > 0
sign change in [0, 1].

f (2) = 2 − cos 2 ≈ 1.090702573 > 0
Next we compute f (x) at the midpoint of [0, 1], again including the two endpoints for
clarity:

f (0) = −1 < 0

f (0.5) = 0.5 − cos 0.5 ≈ −0.3775825619 < 0
sign change in [0.5, 1].

f (1) = 1 − cos 1 ≈ 0.4596796941 > 0
Next we compute f (x) and the midpoint of [0.5, 1] and compare it to the endpoints:

f (0.5) = 0.5 − cos 0.5 ≈ −0.3775825619 < 0 
f (0.75) = 0.75 − cos 0.75 ≈ 0.0183111311 > 0,
sign change in [0.5, 0.75].

f (1) = 1 − cos 1 ≈ 0.4596796941 > 0
Next we compute f (x) and the midpoint of [0.5, 0.75], namely 12 (0.5 + 0.75) = 0.625:

f (0.5) = 0.5 − cos 0.5 ≈ −0.3775825619 < 0

f (0.625) = 0.625 − cos 0.625 ≈ −0.1859631195 < 0
sign change in [0.625, 0.75].

f (0.75) = 0.75 − cos 0.75 ≈ 0.0183111311 > 0
This tells us the solution is somewhere in [0.625, 0.75], whose midpoint is 12 (0.625 + 0.75) =
0.6875, and so on.
If we take x0 = 0, x1 = 2, and then consider the midpoints of the relevant intervals
generated by the sign changes to be x2 = 1, x3 = 0.5, x4 = 0.75, x5 = 0.625, and so on,
we see a sequence of x-values which get progressively closer to the actual solution. A sign
chart for the f (xn ) values helps to illustrate this phenomenon:
500CHAPTER 5. USING DERIVATIVES TO ANALYZE FUNCTIONS; FURTHER APPLICATIONS
x4 = 0.75
x5 = 0.625
x3 = 0.5
x0 = 0
⊕
⊕
x1 = 2
⊖ ⊖ ⊕
x2 = 1
sign f (xn ): ⊖
While this method can be easily programmed into a computer or similar device, it is
not usually the most efficient computationally, meaning it takes more steps to get the
same accuracy as the next method, which takes some advantage of the actual slope of the
function, i.e., the function’s derivative.
Newton’s Method: With Newton’s method, we begin with one guess, which we will call x1 .
We then look at the tangent line to f (x) at (x1 , f (x1 )), the slope of this line being f ′ (x1 ).
We then take x2 to be the x-intercept of this tangent line (which would be a solution if
the curve’s slope were constant!), in essence “following” the tangent line to the x-axis to
find x2 . We then take the tangent line at (x2 , f (x2 )) and follow it to the x-axis to find x3 ,
and follow the tangent line at (x3 , f (x3 )) to the x-axis to find x4 , and so on, to produce a
sequence x1 , x2 , x3 , · · · , which will often converge very quickly towards a point x which
solves f (x) = 0. This is illustrated for our example above, namely solving x = cos x, i.,e.,
f (x) = x − cos x = 0 using x1 = 0, and the xn following for n = 2, 3, 4, · · · . This is
illustrated in Figure 5.12.
Algebraically, for Newton’s Method we let xn be our “nth guess,” and then its tangent line
to y = f (x) at x = xn is given by
y = f (xn ) + f ′ (xn )(x − xn ),
which when we set equal to zero—to find the x-intercept—giving us
f (xn ) + f ′ (xn )(x − xn ) = 0 ⇐⇒ f ′ (xn )(x − xn ) = −f (xn )
f (xn )
f ′ (xn )
f (xn )
.
⇐⇒ x = xn − ′
f (xn )
⇐⇒ x − xn = −
Taking xn+1 to be this x-value at which the tangent line through (xn , f (xn 1)) intersects the
x-axis, we get the following, recursive formula:
xn+1 = xn −
f (xn )
.
f ′ (xn )
(5.22)
For our present example in which f (x) = x−cos x and f ′ (x) = 1+sin x, our recursion relationship
becomes
x − cos x
.
xn+1 = xn −
1 + sin x
So far we have considered x1 = 0 to be our ”first guess.” Below we list values of xn where
we begin first with x1 = 0, and then also consider x1 = 1, x1 = 2 and x1 = 10. Note that
approximations are given to ten significant digits.
501
5.5. NEWTON’S APPROXIMATION METHOD
y = f (x)
1
(x2 , f (x2 ))
x1
−2
x3 x2
−1
1
2
(x1 , f (x1 ))
−1
Figure 5.12: Figure showing two iterations of Newton’s Method for finding approximate
solutions of f (x) = x − cos x = 0, i.e., solutions of x = cos x, with an initial guess of x1 = 0.
n
1
2
3
4
5
6
7
8
9
xn
0
1
0.7503638678
0.7391128909
0.7390851334
0.7390851332
0.7390851332
0.7390851332
0.7390851332
n
1
2
3
4
5
6
7
8
9
xn
3
-0.4965581783
2.131003844
0.6896627208
0.7396529975
0.7390852044
0.7390851332
0.7390851332
0.7390851332
n
1
2
3
4
5
6
7
8
9
xn
4
-15.13524412
16.07064125
-10.28559751
-4.80680582
-2.350795113
3.348266027
-2.095887668
9.740319348
For this particular example, it is clear that a good “first guess” x1 can cause the algorithm
to converge quickly to a stable value. However, using x1 = 4 here leads to unstable oscillation in
the sequence {xn }, and no apparent convergence. The behavior is not always predictable at first
glance (the reader is invited to note that x1 = 2 actually converges faster to the stable value of
xn than does letting x1 = 0, though the solution is closer to 0 than 2). To be sure we have an
approximate solution, one can check cos 0.7390851332 ≈ 0.7390851332, as desired.
Note that when the method does converge, it often does so quite quickly: we managed
to get answers accurate to 10 significant digits after 5–6 iterations. To use our method of
bisection and have accuracy of ±10−10 we would need to bisect the interval [0, 2] some n times,
giving a subinterval of length 2/2n where 2/2n ≤ 10−10 , i.e., 21−n ≤ 10−10 , which means
(1 − n) log 2 ≤ −10, or (n − 1) log 2 ≥ 10, or n ≥ 1 + 10/ log 2 ≈ 34.2, so we would need 35
iterations of the Method of Bisection to achieve the same accuracy for this problem. That is
certainly not a problem for a computer program to accomplish quickly, but the 5–6 steps required
502CHAPTER 5. USING DERIVATIVES TO ANALYZE FUNCTIONS; FURTHER APPLICATIONS
here show Newton’s Method to be more efficient for this particular problem.15
In the typical application of Newton’s Method, one attempts to solve an equation that has
been put into the form f (x) = 0, makes a “guess” for x1 , runs the algorithm16 and inspects for
convergence. If there will be convergence, it is usually readily apparent. If not, that is usually
clear as well and another attempt to choose an x1 that will cause convergence. There are some
functions which will not allow for convergence, and a method such as the Method of Bisection
can be attempted. (We will consider such situations later.) The electronic ability to graph
the function in question can be very helpful as well, even if only to determine where to begin
whichever method is chosen.
It is also the case that there can be several solutions of f (x) = 0, and perhaps some graphical
analysis needs to be done at first so we know how many solutions exist, and approximately where
they are located.
Example 5.5.1 Find all real solutions of x3 = 1 − 3x2 .
Solution: We begin as before by making this a question about “zeros” of a function f (x) =
x3 + 3x2 − 1. Assuming we had no graph to work with, we could next seek out intervals on which
the function changes signs:
x
f (x)
−3 −2 −1 0 1
−1 3
1 −1 3
2 3
19 53
We see sign changes in [−3, −2], [−1, 0], and [0, 1]. We know from Algebra that there can be at
most three solutions of f (x) = 0 for the case that f (x) is a third-degree polynomial, so we need
only look for approximations of the solutions in these three intervals. We will choose x1 to be
15 Indeed such problems were—and still are—typically solved by students using pencil-and-paper and very
simple “scientific” calculators in homework and exam settings for decades.
16 Three common ways to run the algorithm are through the use of a calculator, a computer programming
language, or a spreadsheet. With most graphing calculators today, we can use the ANS and ENTER keys to run
the recursive steps easily. For instance, if we type our x1 value 0 ENTER , the display shows 0 as our “answer.”
We then can type
ANS-(ANS-(COS(ANS))/(1+SIN(ANS))
ENTER
and the calculator will return the output from entering our first “answer” (x1 = 0) after it is run through the
right-hand side of (5.22), namely x2 . At that point, x2 is our new “answer,” so if we type ENTER again it
will repeat the line above with ANS= x2 , giving our new “answer,” namely x3 and so on. Repeatedly pressing
ENTER then outputs x4 , x5 and so on.
On a spreadsheet, one can enter 0 into cell A1, and then in A2 enter
= A1 − (A1 − cos(A1))/(1 + sin(A1)),
causing the contents of A2 to be as above. One can then “copy” cell A2 and “paste” its contents simultaneously
into A3, A4 and so on, and the spreadsheet will likely understand this action to mean each cell should reference
the one above using a similar formula, i.e., so that
A2 = A1 − (A1 − cos(A1))/(1 + sin(A1)),
A3 = A2 − (A2 − cos(A2))/(1 + sin(A2)),
A4 = A3 − (A3 − cos(A3))/(1 + sin(A3)),
and so on. This will in fact make it easier to try new first guesses for A1 (think “x1 ”), since editing A1 to be a
different number will automatically “update” A2, A3 and so on.
Using either the programmable features of a graphing calculator, or an actual computer programming language
are alternative strategies, as is simply using calculator memory (or re-typing) and processing the numbers by
brute force.
Of course, regardless of the chosen method, we have to be sure that the calculating device is reading angles in
radians.
503
5.5. NEWTON’S APPROXIMATION METHOD
3
2
1
−3
−2
−1
1
−1
Figure 5.13: Graph of f (x) = x3 + 3x2 − 1 for Example 5.5.1. Note the intervals on which
there is a sign change, and the approximate placements of the solutions of f (x) = 0, i.e., where
x3 = 1 − 3x2 .
the midpoint in each case. We will use these in our recursive formula, which for this problem
becomes:
f (xn )
f ′ (xn )
x3 + 3x2 − 1
.
= xn −
3x2 + 6x
xn+1 = xn −
=⇒ xn+1
Using x1 = 2.5, −0.5, 0.5 respectively we generate the following tables:
n
1
2
3
4
5
6
7
xn
-2.5
-3.066666667
-2.900875604
-2.879719904
-2.879385325
-2.879385242
-2.879385242
n
1
2
3
4
5
6
7
xn
-0.5
-0.6666666667
-0.6527777778
-0.6527036468
-0.6527036447
-0.6527036447
-0.6527036447
n
1
2
3
4
5
6
7
xn
0.5
0.5333333333
0.5320906433
0.5320888862
0.5320888862
0.5320888862
0.5320888862
We conclude that approximate solutions of x3 = 1−3x2 are x ≈ −2.879385242, −0.6527036447
and 0.5320888862. The graph of f (x) = x3 + 3x2 − 1 is given in Figure 5.13.
From both the geometric interpretation (of following the tangent lines back to the x-axis) and
the recursion formula that a flatter curve, i.e., smaller f ′ (xn ) will cause xn+1 to be more distant
from xn . In the above example, at x = 0 we would have f ′ (x) = 0 and therefore the tangent
line would never intercept the x-axis. We would also find ourselves with a zero denominator in
the recursion formula.
A common example showing graphically how the xn can diverge is given next.
√
Example 5.5.2 Suppose we wish to use Newton’s Method to solve 3 x = 0. While we can see
the solution is x = 0, instead we will suppose we do not know this, and instead make our first
504CHAPTER 5. USING DERIVATIVES TO ANALYZE FUNCTIONS; FURTHER APPLICATIONS
2
1
x4
x2
x1
−8 −7 −6 −5 −4 −3 −2 −1
−1
1
x3
2
3
4
5
6
7
8
−2
Figure 5.14: Figure showing the tangent lines producing the succession of the x1 , x2 , x3 , · · ·
√
generated by the Newton’s Method recursion formula for f (x) = 3 x = 0 if x1 = 1, as in
Example 5.5.2. As the tangent lines become more horizontal, the xn values diverge from each
other.
guess of x1 = 1. Our recursion relation becomes
xn+1 = xn −
f (xn )
f ′ (xn )
= xn −
x1/3
1 −2/3
3x
= xn − 3xn .
Running our algorithm, we get
n
1
2
3
4
5
xn
1
-2
4
-8
16
and so on. Indeed we can see a simple pattern where xn+1 = −2xn , and the xn diverge. This
coincides with the slopes of the tangent lines shrinking in size, the effect of which is shown
graphically in Figure 5.14.
As has been pointed out, when the slope of the curve decreases in size, the method is likely to
produce points xn which are more spread apart, and therefore less likely convergent. However,
the method can be quite useful when algebraic methods are not up to the task. It is helpful to
have a general idea of the behavior of the function’s graph, such as the number of solutions.
505
5.5. NEWTON’S APPROXIMATION METHOD
Exercises
1. Newton’s Method produces a method
to compute square roots which was
used for many years by students who
had no access to calculators.
For in√
stance, to compute 3, one would look
at the function f (x) = x2 − 3 and use
the method to find where f (x) = 0.
In this way,
√ Newton’s
√ Method to
√ use
compute 3, 24 and 36 accurate to
±10−9 or better.
In doing so, note what happens if we attempt the method
with various initial values x1 =
4.1, 4.2, 4.3, 4.4, 4.6, 4.7, 4.8 and
4.9. Do so again with x1 ranging from 7.3 to 8.0.
4. Using only a scientific (non-graphing)
calculator or similar device, graph
f (x) = x3 + 2x2 − 5x − 1. To do so:
2. As above,
√ use Newton’s Method to
compute 3 9 accurate to ±10−9 or better.
(a) Find the critical points (using the
Quadratic Formula) and produce
a sign chart for f ′ (x). Use this to
identify local extrema.
3. Consider the equation tan x = x.
(b) Find any inflection points and
produce a sign chart for f ′′ (x).
(a) Sketch rough graphs of y = tan x
and y = x. Note that x = 0 is
clearly one solution.
(b) Use Newton’s Method to find
two other positive solutions.
(c) Use Newton’s Method to find all
(three) x-intercepts.
(d) Sketch the graph, reflecting all of
this information, along with the yintercept.