Skip to main content
\(\require{cancel}\newcommand{\highlight}[1]{{\color{blue}{#1}}} \newcommand{\apex}{A\kern -1pt \lower -2pt\mbox{P}\kern -4pt \lower .7ex\mbox{E}\kern -1pt X} \newcommand{\colorlinecolor}{blue!95!black!30} \newcommand{\bwlinecolor}{black!30} \newcommand{\thelinecolor}{\colorlinecolor} \newcommand{\colornamesuffix}{} \newcommand{\linestyle}{[thick, \thelinecolor]} \newcommand{\bmx}[1]{\left[\hskip -3pt\begin{array}{#1} } \newcommand{\emx}{\end{array}\hskip -3pt\right]} \newcommand{\ds}{\displaystyle} \newcommand{\fp}{f'} \newcommand{\fpp}{f''} \newcommand{\lz}[2]{\frac{d#1}{d#2}} \newcommand{\lzn}[3]{\frac{d^{#1}#2}{d#3^{#1}}} \newcommand{\lzo}[1]{\frac{d}{d#1}} \newcommand{\lzoo}[2]{{\frac{d}{d#1}}{\left(#2\right)}} \newcommand{\lzon}[2]{\frac{d^{#1}}{d#2^{#1}}} \newcommand{\lzoa}[3]{\left.{\frac{d#1}{d#2}}\right|_{#3}} \newcommand{\plz}[2]{\frac{\partial#1}{\partial#2}} \newcommand{\plzoa}[3]{\left.{\frac{\partial#1}{\partial#2}}\right|_{#3}} \newcommand{\inflim}[1][n]{\lim\limits_{#1 \to \infty}} \newcommand{\infser}[1][1]{\sum_{n=#1}^\infty} \newcommand{\Fp}{F\primeskip'} \newcommand{\Fpp}{F\primeskip''} \newcommand{\yp}{y\primeskip'} \newcommand{\gp}{g\primeskip'} \newcommand{\dx}{\Delta x} \newcommand{\dy}{\Delta y} \newcommand{\ddz}{\Delta z} \newcommand{\thet}{\theta} \newcommand{\norm}[1]{\left\lVert#1\right\rVert} \newcommand{\vnorm}[1]{\left\lVert\vec #1\right\rVert} \newcommand{\snorm}[1]{\left|\left|\ #1\ \right|\right|} \newcommand{\la}{\left\langle} \newcommand{\ra}{\right\rangle} \newcommand{\dotp}[2]{\vec #1 \cdot \vec #2} \newcommand{\proj}[2]{\text{proj}_{\,\vec #2}{\,\vec #1}} \newcommand{\crossp}[2]{\vec #1 \times \vec #2} \newcommand{\veci}{\vec i} \newcommand{\vecj}{\vec j} \newcommand{\veck}{\vec k} \newcommand{\vecu}{\vec u} \newcommand{\vecv}{\vec v} \newcommand{\vecw}{\vec w} \newcommand{\vecx}{\vec x} \newcommand{\vecy}{\vec y} \newcommand{\vrp}{\vec r\, '} \newcommand{\vsp}{\vec s\, '} \newcommand{\vrt}{\vec r(t)} \newcommand{\vst}{\vec s(t)} \newcommand{\vvt}{\vec v(t)} \newcommand{\vat}{\vec a(t)} \newcommand{\px}{\partial x} \newcommand{\py}{\partial y} \newcommand{\pz}{\partial z} \newcommand{\pf}{\partial f} \newcommand{\mathN}{\mathbb{N}} \newcommand{\zerooverzero}{\ds \raisebox{8pt}{\text{``\ }}\frac{0}{0}\raisebox{8pt}{\textit{ ''}}} \newcommand{\deriv}[2]{\myds\frac{d}{dx}\left(#1\right)=#2} \newcommand{\myint}[2]{\myds\int #1\ dx= {\ds #2}} \DeclareMathOperator{\sech}{sech} \DeclareMathOperator{\csch}{csch} \newcommand{\primeskip}{\hskip.75pt} \newcommand{\plotlinecolor}{blue} \newcommand{\colorone}{blue} \newcommand{\colortwo}{red} \newcommand{\coloronefill}{blue!15!white} \newcommand{\colortwofill}{red!15!white} \newcommand{\abs}[1]{\left\lvert #1\right\rvert} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section4.1Newton's Method

Solving equations is one of the most important things we do in mathematics, yet we are surprisingly limited in what we can solve analytically. For instance, equations as simple as \(x^5+x+1=0\) or \(\cos(x) =x\) cannot be solved by algebraic methods in terms of familiar functions. Fortunately, there are methods that can give us approximate solutions to equations like these. These methods can usually give an approximation correct to as many decimal places as we like. In Section 1.5 we learned about the Bisection Method. This section focuses on another technique (which generally works faster), called Newton's Method.

Newton's Method is built around tangent lines. The main idea is that if \(x\) is sufficiently close to a root of \(f(x)\text{,}\) then the tangent line to the graph at \((x,f(x))\) will cross the \(x\)-axis at a point closer to the root than \(x\text{.}\)

We start Newton's Method with an initial guess about roughly where the root is. Call this \(x_0\text{.}\) (See Figure 4.1.1.(a).) Draw the tangent line to the graph at \((x_0,f(x_0))\) and see where it meets the \(x\)-axis. Call this point \(x_1\text{.}\) Then repeat the process — draw the tangent line to the graph at \((x_1, f(x_1))\) and see where it meets the \(x\)-axis. (See Figure 4.1.1.(b).) Call this point \(x_2\text{.}\) Repeat the process again to get \(x_3\text{,}\) \(x_4\text{,}\) etc. This sequence of points will often converge rather quickly to a root of \(f\text{.}\)

<<SVG image is unavailable, or your browser cannot render it>>

<<SVG image is unavailable, or your browser cannot render it>>

<<SVG image is unavailable, or your browser cannot render it>>

(a)
(b)
(c)
Figure4.1.1Demonstrating the geometric concept behind Newton's Method.

We can use this geometric process to create an algebraic process. Let's look at how we found \(x_1\text{.}\) We started with the tangent line to the graph at \((x_0,f(x_0))\text{.}\) The slope of this tangent line is \(\fp(x_0)\) and the equation of the line is \begin{equation*} y=\fp(x_0)(x-x_0)+f(x_0) \text{.} \end{equation*}

This line crosses the \(x\)-axis when \(y=0\text{,}\) and the \(x\)-value where it crosses is what we called \(x_1\text{.}\) So let \(y=0\) and replace \(x\) with \(x_1\text{,}\) giving the equation: \begin{equation*} 0 = \fp(x_0)(x_1-x_0)+f(x_0) \text{.} \end{equation*}

Now solve for \(x_1\text{:}\) \begin{equation*} x_1=x_0-\frac{f(x_0)}{\fp(x_0)} \text{.} \end{equation*}

Since we repeat the same geometric process to find \(x_2\) from \(x_1\text{,}\) we have \begin{equation*} x_2=x_1-\frac{f(x_1)}{\fp(x_1)} \text{.} \end{equation*}

In general, given an approximation \(x_n\text{,}\) we can find the next approximation, \(x_{n+1}\) as follows: \begin{equation*} x_{n+1} = x_{n} - \frac{f(x_{n})}{\fp(x_{n})} \text{.} \end{equation*}

We summarize this process as follows.

Key Idea4.1.2Newton's Method

Let \(f\) be a differentiable function on an interval \(I\) with a root in \(I\text{.}\) To approximate the value of the root, accurate to \(d\) decimal places:

  1. Choose a value \(x_0\) as an initial approximation of the root. (This is often done by looking at a graph of \(f\text{.}\))

  2. Create successive approximations iteratively; given an approximation \(x_n\text{,}\) compute the next approximation \(x_{n+1}\) as \begin{equation*} x_{n+1} = x_n - \frac{f(x_n)}{\fp(x_n)} \text{.} \end{equation*}

  3. Stop the iterations when successive approximations do not differ in the first \(d\) places after the decimal point.

Newton's Method is not Infallible

The sequence of approximate values may not converge, or it may converge so slowly that one is “tricked” into thinking a certain approximation is better than it actually is. These issues will be discussed at the end of the section.

Let's practice Newton's Method with a concrete example.

Example4.1.3Using Newton's Method

Approximate the real root of \(x^3-x^2-1=0\text{,}\) accurate to the first three places after the decimal, using Newton's Method and an initial approximation of \(x_0=1\text{.}\)

Solution

We can automate this process on a calculator that has an ANS key that returns the result of the previous calculation. Start by pressing 1 and then Enter. (We have just entered our initial guess, \(x_0=1\text{.}\)) Now compute \begin{equation*} \texttt{ ANS } - \frac{f(\texttt{ ANS } )}{\fp(\texttt{ ANS } )} \end{equation*} by entering the following and repeatedly press the Enter key.

ANS-(ANS^3-ANS^2-1)/(3*ANS^2-2*ANS)

Each time we press the Enter key, we are finding the successive approximations, \(x_1, x_2, \ldots\text{,}\) and each one is getting closer to the root. In fact, once we get past around \(x_7\) or so, the approximations don't appear to be changing. They actually are changing, but the change is far enough to the right of the decimal point that it doesn't show up on the calculator's display. When this happens, we can be pretty confident that we have found an accurate approximation.

Using a calculator in this manner makes the calculations simple; many iterations can be computed very quickly.

Example4.1.5Using Newton's Method to find where functions intersect

Use Newton's Method to approximate a solution to \(\cos(x) = x\text{,}\) accurate to five places after the decimal.

Solution

If you know how to program, you can translate the following pseudocode into your favorite language to perform the computation in this problem.

x = .75
while true
    oldx = x
    x = x - (cos(x)-x)/(-sin(x)-1)
    print x
    if abs(x-oldx) < .0000000001
        break

This code calculates \(x_1\text{,}\) \(x_2\text{,}\) etc., storing each result in the variable x. The previous approximation is stored in the variable oldx. We continue looping until the difference between two successive approximations, abs(x-oldx), is less than some small tolerance, in this case, .0000000001.

Subsection4.1.1Convergence of Newton's Method

What should one use for the initial guess, \(x_0\text{?}\) Generally, the closer to the actual root the initial guess is, the better. However, some initial guesses should be avoided. For instance, consider Example 4.1.3 where we sought the root to \(f(x) = x^3-x^2-1\text{.}\) Choosing \(x_0=0\) would have been a particularly poor choice. Consider Figure 4.1.7, where \(f(x)\) is graphed along with its tangent line at \(x=0\text{.}\) Since \(\fp(0)=0\text{,}\) the tangent line is horizontal and does not intersect the \(x\)-axis. Graphically, we see that Newton's Method fails.

<<SVG image is unavailable, or your browser cannot render it>>

Figure4.1.7A graph of \(f(x) = x^3-x^2-1\text{,}\) showing why an initial approximation of \(x_0=0\) with Newton's Method fails.

We can also see analytically that it fails. Since \begin{equation*} x_1 = 0 -\frac{f(0)}{\fp(0)} \end{equation*} and \(\fp(0)=0\text{,}\) we see that \(x_1\) is not well defined.

This problem can also occur if, for instance, it turns out that \(\fp(x_5)=0\text{.}\) Adjusting the initial approximation \(x_0\) by a very small amount will likely fix the problem.

It is also possible for Newton's Method to not converge while each successive approximation is well defined. Consider \(f(x) = \sqrt[3]{x}\text{,}\) as shown in Figure 4.1.8. It is clear that the root is \(x=0\text{,}\) but let's approximate this with \(x_0=0.1\text{.}\) Figure 4.1.8.(a) shows graphically the calculation of \(x_1\text{;}\) notice how it is farther from the root than \(x_0\text{.}\) Figure 4.1.8.(b) and Figure 4.1.8.(c) show the calculation of \(x_2\) and \(x_3\text{,}\) which are even farther away; our successive approximations are getting worse. (It turns out that in this particular example, each successive approximation is twice as far from the true answer as the previous approximation.)

<<SVG image is unavailable, or your browser cannot render it>>

<<SVG image is unavailable, or your browser cannot render it>>

<<SVG image is unavailable, or your browser cannot render it>>

(a)
(b)
(c)
Figure4.1.8Newton's Method fails to find a root of \(f(x) = x^{1/3}\text{,}\) regardless of the choice of \(x_0\text{.}\)

There is no “fix” to this problem; Newton's Method simply will not work and another method must be used. (In this case the particular reason Newton's Method fails is that the tangent line is vertical at the root).

While Newton's Method does not always work, it does work “most of the time,” and it is generally very fast. Once the approximations get close to the root, Newton's Method can as much as double the number of correct decimal places with each successive approximation. A course in Numerical Analysis will introduce the reader to more iterative root finding methods, as well as give greater detail about the strengths and weaknesses of Newton's Method.

Subsection4.1.2Exercises

Terms and Concepts

In the following exercises, the roots of \(f(x)\) are known or are easily found. Use five iterations of Newton's Method with the given initial approximation to approximate the root. Compare it to the known value of the root.

In the following exercises, use Newton's Method to approximate all roots of the given functions accurate to three places after the decimal. If an interval is given, find only the roots that lie in that interval. Use technology to obtain good initial approximations.

In the following exercises, use Newton's Method to approximate when the given functions are equal, accurate to 3 places after the decimal. Use technology to obtain good initial approximations.