## 4.7 Newton’s Method

### Learning Objectives

• Describe the steps of Newton’s method.
• Explain what an iterative process means.
• Recognize when Newton’s method does not work.
• Apply iterative processes to various situations.

In many areas of pure and applied mathematics, we are interested in finding solutions to an equation of the form $f(x)=0$. For most functions, however, it is difficult—if not impossible—to calculate their zeroes explicitly. In this section, we take a look at a technique that provides a very efficient way of approximating the zeroes of functions. This technique makes use of tangent line approximations and is behind the method used often by calculators and computers to find zeroes.

# Describing Newton’s Method

Consider the task of finding the solutions of $f(x)=0$. If $f$ is the first-degree polynomial $f(x)=ax+b$, then the solution of $f(x)=0$ is given by the formula $x=-\frac{b}{a}$. If $f$ is the second-degree polynomial $f(x)=ax^2+bx+c$, the solutions of $f(x)=0$ can be found by using the quadratic formula. However, for polynomials of degree 3 or more, finding roots of $f$ becomes more complicated. Although formulas exist for third- and fourth-degree polynomials, they are quite complicated. Also, if $f$ is a polynomial of degree 5 or greater, it is known that no such formulas exist. For example, consider the function

$f(x)=x^5+8x^4+4x^3-2x-7$.

No formula exists that allows us to find the solutions of $f(x)=0$. Similar difficulties exist for nonpolynomial functions. For example, consider the task of finding solutions of $\tan (x)-x=0$. No simple formula exists for the solutions of this equation. In cases such as these, we can use Newton’s method to approximate the roots.

Newton’s method makes use of the following idea to approximate the solutions of $f(x)=0$. By sketching a graph of $f$, we can estimate a root of $f(x)=0$. Let’s call this estimate $x_0$. We then draw the tangent line to $f$ at $x_0$. If $f^{\prime}(x_0)\ne 0$, this tangent line intersects the $x$-axis at some point $(x_1,0)$. Now let $x_1$ be the next approximation to the actual root. Typically, $x_1$ is closer than $x_0$ to an actual root. Next we draw the tangent line to $f$ at $x_1$. If $f^{\prime}(x_1)\ne 0$, this tangent line also intersects the $x$-axis, producing another approximation, $x_2$. We continue in this way, deriving a list of approximations: $x_0, x_1, x_2, \cdots$. Typically, the numbers $x_0,x_1,x_2, \cdots$ quickly approach an actual root $x*$, as shown in the following figure.

Figure 1. The approximations $x_0,x_1,x_2, \cdots$ approach the actual root $x*$. The approximations are derived by looking at tangent lines to the graph of $f$.

Now let’s look at how to calculate the approximations $x_0,x_1,x_2, \cdots$. If $x_0$ is our first approximation, the approximation $x_1$ is defined by letting $(x_1,0)$ be the $x$-intercept of the tangent line to $f$ at $x_0$. The equation of this tangent line is given by

$y=f(x_0)+f^{\prime}(x_0)(x-x_0)$.

Therefore, $x_1$ must satisfy

$f(x_0)+f^{\prime}(x_0)(x_1-x_0)=0$.

Solving this equation for $x_1$, we conclude that

$x_1=x_0-\frac{f(x_0)}{f^{\prime}(x_0)}$.

Similarly, the point $(x_2,0)$ is the $x$-intercept of the tangent line to $f$ at $x_1$. Therefore, $x_2$ satisfies the equation

$x_2=x_1-\frac{f(x_1)}{f^{\prime}(x_1)}$.

In general, for $n>0, \, x_n$ satisfies

$x_n=x_{n-1}-\frac{f(x_{n-1})}{f^{\prime}(x_{n-1})}$.

Next we see how to make use of this technique to approximate the root of the polynomial $f(x)=x^3-3x+1$.

### Finding a Root of a Polynomial

Use Newton’s method to approximate a root of $f(x)=x^3-3x+1$ in the interval $[1,2]$. Let $x_0=2$ and find $x_1,x_2,x_3,x_4$, and $x_5$.

Letting $x_0=0$, use Newton’s method to approximate the root of $f(x)=x^3-3x+1$ over the interval $[0,1]$ by calculating $x_1$ and $x_2$.

#### Hint

Use (Figure).

Newton’s method can also be used to approximate square roots. Here we show how to approximate $\sqrt{2}$. This method can be modified to approximate the square root of any positive number.

### Finding a Square Root

Use Newton’s method to approximate $\sqrt{2}$ ((Figure)). Let $f(x)=x^2-2$, let $x_0=2$, and calculate $x_1,x_2,x_3,x_4,x_5$. (We note that since $f(x)=x^2-2$ has a zero at $\sqrt{2}$, the initial value $x_0=2$ is a reasonable choice to approximate $\sqrt{2}$.)

Use Newton’s method to approximate $\sqrt{3}$ by letting $f(x)=x^2-3$ and $x_0=3$. Find $x_1$ and $x_2$.

#### Hint

For $f(x)=x^2-3$, (Figure) reduces to $x_n=\frac{x_{n-1}}{2}+\frac{3}{2x_{n-1}}$.

When using Newton’s method, each approximation after the initial guess is defined in terms of the previous approximation by using the same formula. In particular, by defining the function $F(x)=x-[\frac{f(x)}{f^{\prime}(x)}]$, we can rewrite (Figure) as $x_n=F(x_{n-1})$. This type of process, where each $x_n$ is defined in terms of $x_{n-1}$ by repeating the same function, is an example of an iterative process. Shortly, we examine other iterative processes. First, let’s look at the reasons why Newton’s method could fail to find a root.

# Failures of Newton’s Method

Typically, Newton’s method is used to find roots fairly quickly. However, things can go wrong. Some reasons why Newton’s method might fail include the following:

1. At one of the approximations $x_n$, the derivative $f^{\prime}$ is zero at $x_n$, but $f(x_n) \ne 0$. As a result, the tangent line of $f$ at $x_n$ does not intersect the $x$-axis. Therefore, we cannot continue the iterative process.
2. The approximations $x_0,x_1,x_2, \cdots$ may approach a different root. If the function $f$ has more than one root, it is possible that our approximations do not approach the one for which we are looking, but approach a different root (see (Figure)). This event most often occurs when we do not choose the approximation $x_0$ close enough to the desired root.
3. The approximations may fail to approach a root entirely. In (Figure), we provide an example of a function and an initial guess $x_0$ such that the successive approximations never approach a root because the successive approximations continue to alternate back and forth between two values.

Figure 4. If the initial guess $x_0$ is too far from the root sought, it may lead to approximations that approach a different root.

### When Newton’s Method Fails

Consider the function $f(x)=x^3-2x+2$. Let $x_0=0$. Show that the sequence $x_1,x_2, \cdots$ fails to approach a root of $f$.

For $f(x)=x^3-2x+2$, let $x_0=-1.5$ and find $x_1$ and $x_2$.

#### Hint

Use (Figure).

From (Figure), we see that Newton’s method does not always work. However, when it does work, the sequence of approximations approaches the root very quickly. Discussions of how quickly the sequence of approximations approach a root found using Newton’s method are included in texts on numerical analysis.

# Other Iterative Processes

As mentioned earlier, Newton’s method is a type of iterative process. We now look at an example of a different type of iterative process.

Consider a function $F$ and an initial number $x_0$. Define the subsequent numbers $x_n$ by the formula $x_n=F(x_{n-1})$. This process is an iterative process that creates a list of numbers $x_0,x_1,x_2, \cdots ,x_n, \cdots$. This list of numbers may approach a finite number $x*$ as $n$ gets larger, or it may not. In (Figure), we see an example of a function $F$ and an initial guess $x_0$ such that the resulting list of numbers approaches a finite value.

### Finding a Limit for an Iterative Process

Let $F(x)=\frac{1}{2}x+4$ and let $x_0=0$. For all $n \ge 1$, let $x_n=F(x_{n-1})$. Find the values $x_1,x_2,x_3,x_4,x_5$. Make a conjecture about what happens to this list of numbers $x_1,x_2,x_3, \cdots,x_n, \cdots$ as $n\to \infty$. If the list of numbers $x_1,x_2,x_3, \cdots$ approaches a finite number $x^*$, then $x^*$ satisfies $x^*=F(x^*)$, and $x^*$ is called a fixed point of $F$.

Consider the function $F(x)=\frac{1}{3}x+6$. Let $x_0=0$ and let $x_n=F(x_{n-1})$ for $n \ge 2$. Find $x_1,x_2,x_3,x_4,x_5$. Make a conjecture about what happens to the list of numbers $x_1,x_2,x_3, \cdots, x_n, \cdots$ as $n\to \infty$.

#### Hint

Consider the point where the lines $y=x$ and $y=F(x)$ intersect.

### Student Project: Iterative Processes and Chaos

Iterative processes can yield some very interesting behavior. In this section, we have seen several examples of iterative processes that converge to a fixed point. We also saw in (Figure) that the iterative process bounced back and forth between two values. We call this kind of behavior a 2-cycle. Iterative processes can converge to cycles with various periodicities, such as 2-cycles, 4-cycles (where the iterative process repeats a sequence of four values), 8-cycles, and so on.

Some iterative processes yield what mathematicians call chaos. In this case, the iterative process jumps from value to value in a seemingly random fashion and never converges or settles into a cycle. Although a complete exploration of chaos is beyond the scope of this text, in this project we look at one of the key properties of a chaotic iterative process: sensitive dependence on initial conditions. This property refers to the concept that small changes in initial conditions can generate drastically different behavior in the iterative process.

Probably the best-known example of chaos is the Mandelbrot set (see (Figure)), named after Benoit Mandelbrot (1924–2010), who investigated its properties and helped popularize the field of chaos theory. The Mandelbrot set is usually generated by computer and shows fascinating details on enlargement, including self-replication of the set. Several colorized versions of the set have been shown in museums and can be found online and in popular books on the subject.

Figure 7. The Mandelbrot set is a well-known example of a set of points generated by the iterative chaotic behavior of a relatively simple function.

In this project we use the logistic map

$f(x)=rx(1-x)$, where $x\in [0,1]$ and $r>0$

as the function in our iterative process. The logistic map is a deceptively simple function; but, depending on the value of $r$, the resulting iterative process displays some very interesting behavior. It can lead to fixed points, cycles, and even chaos.

To visualize the long-term behavior of the iterative process associated with the logistic map, we will use a tool called a cobweb diagram. As we did with the iterative process we examined earlier in this section, we first draw a vertical line from the point $(x_0,0)$ to the point $(x_0,f(x_0))=(x_0,x_1)$. We then draw a horizontal line from that point to the point $(x_1,x_1)$, then draw a vertical line to $(x_1,f(x_1))=(x_1,x_2)$, and continue the process until the long-term behavior of the system becomes apparent. (Figure) shows the long-term behavior of the logistic map when $r=3.55$ and $x_0=0.2$. (The first 100 iterations are not plotted.) The long-term behavior of this iterative process is an 8-cycle.

Figure 8. A cobweb diagram for $f(x)=3.55x(1-x)$ is presented here. The sequence of values results in an 8-cycle.

1. Let $r=0.5$ and choose $x_0=0.2$. Either by hand or by using a computer, calculate the first 10 values in the sequence. Does the sequence appear to converge? If so, to what value? Does it result in a cycle? If so, what kind of cycle (for example, 2-cycle, 4-cycle)?
2. What happens when $r=2$?
3. For $r=3.2$ and $r=3.5$, calculate the first 100 sequence values. Generate a cobweb diagram for each iterative process. (Several free applets are available online that generate cobweb diagrams for the logistic map.) What is the long-term behavior in each of these cases?
4. Now let $r=4$. Calculate the first 100 sequence values and generate a cobweb diagram. What is the long-term behavior in this case?
5. Repeat the process for $r=4$, but let $x_0=0.201$. How does this behavior compare with the behavior for $x_0=0.2$?

### Key Concepts

• Newton’s method approximates roots of $f(x)=0$ by starting with an initial approximation $x_0$, then uses tangent lines to the graph of $f$ to create a sequence of approximations $x_1,x_2,x_3, \cdots$.
• Typically, Newton’s method is an efficient method for finding a particular root. In certain cases, Newton’s method fails to work because the list of numbers $x_0,x_1,x_2, \cdots$ does not approach a finite value or it approaches a value other than the root sought.
• Any process in which a list of numbers $x_0,x_1,x_2, \cdots$ is generated by defining an initial number $x_0$ and defining the subsequent numbers by the equation $x_n=F(x_{n-1})$ for some function $F$ is an iterative process. Newton’s method is an example of an iterative process, where the function $F(x)=x-[\frac{f(x)}{f^{\prime}(x)}]$ for a given function $f$.

For the following exercises, write Newton’s formula as $x_{n+1}=F(x_n)$ for solving $f(x)=0$.

1. $f(x)=x^2+1$

2. $f(x)=x^3+2x+1$

3. $f(x)= \sin x$

4. $f(x)=e^x$

5. $f(x)=x^3+3xe^x$

For the following exercises, solve $f(x)=0$ using the iteration $x_{n+1}=x_n-cf(x_n)$, which differs slightly from Newton’s method. Find a $c$ that works and a $c$ that fails to converge, with the exception of $c=0$.

6. $f(x)=x^2-4$, with $x_0=0$

7. $f(x)=x^2-4x+3$, with $x_0=2$

8. What is the value of “$c$” for Newton’s method?

For the following exercises, start at

a. $x_0=0.6$ and

b. $x_0=2$.

Compute $x_1$ and $x_2$ using the specified iterative method.

9. $x_{n+1}=(x_n)^2-\frac{1}{2}$

10. $x_{n+1}=2x_n(1-x_n)$

11. $x_{n+1}=\sqrt{x_n}$

12. $x_{n+1}=\frac{1}{\sqrt{x_n}}$

13. $x_{n+1}=3x_n(1-x_n)$

14. $x_{n+1}=(x_n)^2+x_n-2$

15. $x_{n+1}=\frac{1}{2}x_n-1$

16. $x_{n+1}=|x_n|$

For the following exercises, solve to four decimal places using Newton’s method and a computer or calculator. Choose any initial guess $x_0$ that is not the exact root.

17. $x^2-10=0$

18. $x^4-100=0$

19. $x^2-x=0$

20.$x^3-x=0$

21. $x+5 \cos (x)=0$

22. $x+ \tan (x)=0$, choose $x_0 \in (-\frac{\pi}{2},\frac{\pi }{2})$

23. $\frac{1}{1-x}=2$

24. $1+x+x^2+x^3+x^4=2$

25. $x^3+(x+1)^3=10^3$

26. $x= \sin^2 (x)$

For the following exercises, use Newton’s method to find the fixed points of the function where $f(x)=x$; round to three decimals.

27. $\sin x$

28. $\tan (x)$ on $x \in (\frac{\pi }{2},\frac{3\pi }{2})$

29. $e^x-2$

30. $\ln (x)+2$

Newton’s method can be used to find maxima and minima of functions in addition to the roots. In this case apply Newton’s method to the derivative function $f^{\prime}(x)$ to find its roots, instead of the original function. For the following exercises, consider the formulation of the method.

31. To find candidates for maxima and minima, we need to find the critical points $f^{\prime}(x)=0$. Show that to solve for the critical points of a function $f(x)$, Newton’s method is given by $x_{n+1}=x_n-\frac{f^{\prime}(x_n)}{f^{\prime \prime}(x_n)}$.

32. What additional restrictions are necessary on the function $f$?

For the following exercises, use Newton’s method to find the location of the local minima and/or maxima of the following functions; round to three decimals.

33. Minimum of $f(x)=x^2+2x+4$

34. Minimum of $f(x)=3x^3+2x^2-16$

35. Minimum of $f(x)=x^2e^x$

36. Maximum of $f(x)=x+\frac{1}{x}$

37. Maximum of $f(x)=x^3+10x^2+15x-2$

38. Maximum of $f(x)=\frac{\sqrt{x}-\sqrt[3]{x}}{x}$

39. Minimum of $f(x)=x^2 \sin x$, closest non-zero minimum to $x=0$

40. Minimum of $f(x)=x^4+x^3+3x^2+12x+6$

For the following exercises, use the specified method to solve the equation. If it does not work, explain why it does not work.

41. Newton’s method, $x^2+2=0$

42. Newton’s method, $0=e^x$

43. Newton’s method, $0=1+x^2$ starting at $x_0=0$

44. Solving $x_{n+1}=−(x_n)^3$ starting at $x_0=-1$

For the following exercises, use the secant method, an alternative iterative method to Newton’s method. The formula is given by

$x_n=x_{n-1}-f(x_{n-1})\frac{x_{n-1}-x_{n-2}}{f(x_{n-1})-f(x_{n-2})}$.

45. Find a root to $0=x^2-x-3$ accurate to three decimal places.

46. Find a root to $0= \sin x+3x$ accurate to four decimal places.

47. Find a root to $0=e^x-2$ accurate to four decimal places.

48. Find a root to $\ln (x+2)=\frac{1}{2}$ accurate to four decimal places.

49. Why would you use the secant method over Newton’s method? What are the necessary restrictions on $f$?

For the following exercises, use both Newton’s method and the secant method to calculate a root for the following equations. Use a calculator or computer to calculate how many iterations of each are needed to reach within three decimal places of the exact answer. For the secant method, use the first guess from Newton’s method.

50. $f(x)=x^2+2x+1, \, x_0=1$

51. $f(x)=x^2, \, x_0=1$

52. $f(x)= \sin x, \, x_0=1$

53. $f(x)=e^x-1, \, x_0=2$

54. $f(x)=x^3+2x+4, \, x_0=0$

In the following exercises, consider Kepler’s equation regarding planetary orbits, $M=E-\epsilon \sin (E)$, where $M$ is the mean anomaly, $E$ is eccentric anomaly, and $\epsilon$ measures eccentricity.

55. Use Newton’s method to solve for the eccentric anomaly $E$ when the mean anomaly $M=\frac{\pi }{3}$ and the eccentricity of the orbit $\epsilon =0.25$; round to three decimals.

56. Use Newton’s method to solve for the eccentric anomaly $E$ when the mean anomaly $M=\frac{3\pi }{2}$ and the eccentricity of the orbit $\epsilon =0.8$; round to three decimals.

The following two exercises consider a bank investment. The initial investment is $10,000$. After 25 years, the investment has tripled to $30,000$.

57. Use Newton’s method to determine the interest rate if the interest was compounded annually.

58. Use Newton’s method to determine the interest rate if the interest was compounded continuously.

59. The cost for printing a book can be given by the equation $C(x)=1000+12x+(\frac{1}{2})x^{2/3}$. Use Newton’s method to find the break-even point if the printer sells each book for $20$.

## Glossary

iterative process
process in which a list of numbers $x_0,x_1,x_2,x_3, \cdots$ is generated by starting with a number $x_0$ and defining $x_n=F(x_{n-1})$ for $n \ge 1$
Newton’s method
method for approximating roots of $f(x)=0$; using an initial guess $x_0$, each subsequent approximation is defined by the equation $x_n=x_{n-1}-\frac{f(x_{n-1})}{f^{\prime}(x_{n-1})}$