Lab 8 – Newton’s Method



Newton’s method is a way to find the approximate value of a root of a function \( f \): the value of \(x\) where the function’s graph intersects the \(x\)-axis. In other words, this method gives an approximation to a solution \( x^* \) of the equation \( f(x) = 0 \). In general, the method starts with an initial guess \( x_0 \) for the unknown exact solution \( x^* \) and finds a list of increasingly better approximations \( x_1, x_2, \ldots \) to \( x^* \).

We will illustrate this method for the function \( f(x) = e^x – 2x^2\), which has the graph depicted below. We want to approximate the left-most root, starting at a point somewhat near it.

To begin, let us choose \(x_0 = -2.2\). This choice and the nearby root can be seen in the next figure, where we have zoomed closer on the graph. The basic idea behind Newton’s method is that when \( x_0 \) is near \(x^*\) the tangent line to the graph \( y = f(x) \) at \( x = x_0 \) will be very close to the actual graph. The \(x\)-intercept of the tangent line will be close to the \( x \)-intercept of the graph—that is, to the unknown root \( x^* \). Thus, Newton’s method determines \( x_1\) as the \(x\) intercept of the tangent line at \(x_0\). The method then recycles the same idea: once we have \( x_1 \), we calculate \( x_2\) as the \(x\)-intercept of the tangent line to \( y = f(x) \) at \( x = x_1 \), and so on. The first two steps in this process for our example are shown on the next figure. Each red slanted line segment in the figure is part of the tangent line to \( y = f(x) \) at some \(x_k\). We get the next approximation \( x_{k+1}\) by taking where the tangent line intersects the \( x\)-axis. In this case, as \( k\) increases, each term \( x_k\) becomes a better approximation to the root \( x^* \). Clearly, we could continue with \( x_3, x_4, \dots\) for even better approximations.

Example: Two iterations of Newton’s method

This idea is summarized by the following algorithm:

A Step of Newton’s Method
To obtain \( x_{k+1}\) from \( x_k\):

  1. Find the numerical value of \( m=f'(x_k)\), the derivative of \( f \) at the point \( x_k\).
  2. Using this slope, find the equation of the tangent line \( y=mx+b\) to \( y= f(x)\) through the point \( (x_k,f(x_k))\). (Note that the slope \( m\) was determined in Step 1, so now we just need to find the intercept \( b\).)
  3. Using these values of \( m\) and \( b\) find the value of \(x\) where the line \( y=mx+b\) intersects the \( x\)-axis. This is the value of the next approximation \( x_{k+1}\).

1. Apply Newton’s Method to the function \( f(x) \) given by your instructor with the value \( x_0 \) given by your instructor. You may use the SageMath cell below. (Note: Do not round your answers.)

(a) Find the equation of the tangent line to \( y = f(x) \) at \( x_0 \).
(b) Determine the value of \( x \) where the tangent line you found in (a) intersects the \(x\)-axis. This is the value of \(x_1\).
(c) Starting with \(x_1\) instead of \(x_0\), repeat the steps in parts (a) and (b) to find the value of \(x_2\). That is, find the equation of the tangent line to \( y = f(x) \) at \( x_1 \) and use that to find \( x_2 \) by determining where that tangent line crosses the \( x \)-axis.

Skip to toolbar