Use Sophia to knock out your gen-ed requirements quickly and affordably. Learn more
×

The Algorithm for Newton's Method

Author: Sophia

what's covered
As you have seen in this challenge, the tangent line to a function at x equals a provides a good estimate to f open parentheses x close parentheses near x equals a. Another way to use the tangent line is to find its x-intercept to approximate the x-intercept of f open parentheses x close parentheses. In this lesson, you will learn Newton’s method, which uses successive tangent lines to approximate an x-intercept. Most graphing utilities use Newton’s method to locate x-intercepts and points of intersections of graphs. Specifically, this lesson will cover:

Table of Contents

1. The Idea Behind Newton’s Method

The goal of Newton’s method is to use tangent lines to approximate an x-intercept of the graph of y equals f open parentheses x close parentheses. In other words, the goal is to solve the equation f open parentheses x close parentheses equals 0.

Consider the function f open parentheses x close parentheses equals x cubed plus 2 x minus 4.

 A graph with an x-axis and a y-axis ranging from −6 to 6. The graph consists of a curve that rises from the third quadrant, passes through (0, −4) and a marked point at (1, −1), and extends into the first quadrant. A dashed line (tangent line) begins from (0, −6), passes through the marked point at (1, −1), and extends into the first quadrant. The line is tangent to the curve at the marked point (1, −1).

Now, consider the picture shown above, which has two graphs:

  • The solid curve is the graph of f open parentheses x close parentheses.
  • The dashed line is the tangent line at x equals 1 (this corresponds to our “guess”).
To start the process for Newton’s method, we’re going to “guess” x equals 1 as the x-intercept.

Notice that the x-intercept of f open parentheses x close parentheses is very close to the x-intercept of the tangent line. The advantage of using the tangent line is that it is much easier to solve a linear equation than it is a cubic equation.

First step: Find the equation of the tangent line at x equals 1.

Given f open parentheses x close parentheses equals x cubed plus 2 x minus 4, the derivative is f apostrophe open parentheses x close parentheses equals 3 x squared plus 2. Then, the slope of the tangent line is f apostrophe open parentheses 1 close parentheses equals 3 open parentheses 1 close parentheses squared plus 2 equals 5.

Then, the equation of the tangent line is:

table attributes columnalign left end attributes row cell y equals f open parentheses 1 close parentheses plus f apostrophe open parentheses 1 close parentheses open parentheses x minus 1 close parentheses end cell row cell y equals short dash 1 plus 5 open parentheses x minus 1 close parentheses end cell row cell y equals short dash 1 plus 5 x minus 5 end cell row cell y equals 5 x minus 6 end cell end table

Then, the x-intercept of the tangent line is found by letting y equals 0 and solving for x:

table attributes columnalign left end attributes row cell 0 equals 5 x minus 6 end cell row cell 6 equals 5 x end cell row cell 6 over 5 equals x space left parenthesis or space 1.2 space in space decimal space form right parenthesis end cell end table

Thus, our approximation for the x-intercept is open parentheses 1.2 comma space 0 close parentheses.

So, where would we go from here?

We now have a new “guess” for the x-intercept of the graph of f open parentheses x close parentheses. To continue with this process, find the equation of the tangent line to f open parentheses x close parentheses at x equals 1.2, then find its x-intercept. We’ll formalize this process and then complete this problem in the next part of this challenge.


2. Applying Newton’s Method

Consider a function y equals f open parentheses x close parentheses and let x subscript 0 be the first guess for its x-intercept.

Write the equation of the tangent line at x equals x subscript 0 space colon thin space y equals f open parentheses x subscript 0 close parentheses plus f apostrophe open parentheses x subscript 0 close parentheses open parentheses x minus x subscript 0 close parentheses.

Find the x-intercept of the tangent line, which means y equals 0:

0 equals f open parentheses x subscript 0 close parentheses plus f apostrophe open parentheses x subscript 0 close parentheses open parentheses x minus x subscript 0 close parentheses Replace y with 0.
short dash f open parentheses x subscript 0 close parentheses equals f apostrophe open parentheses x subscript 0 close parentheses open parentheses x minus x subscript 0 close parentheses Subtract f open parentheses x subscript 0 close parentheses from both sides.
short dash fraction numerator f open parentheses x subscript 0 close parentheses over denominator f apostrophe open parentheses x subscript 0 close parentheses end fraction equals x minus x subscript 0 Divide both sides by f apostrophe open parentheses x subscript 0 close parentheses.
x subscript 0 minus fraction numerator f open parentheses x subscript 0 close parentheses over denominator f apostrophe open parentheses x subscript 0 close parentheses end fraction equals x Add x subscript 0 to both sides.

Now, this x-intercept is the next guess for the intercept, which under normal conditions, is a closer estimate than x subscript 0. Since this process will continue, let’s call the x-intercept of the tangent line x subscript 1. Then, x subscript 1 equals x subscript 0 minus fraction numerator f open parentheses x subscript 0 close parentheses over denominator f apostrophe open parentheses x subscript 0 close parentheses end fraction.

Now, suppose we want to continue this process:

  • Find the equation of the tangent line at x equals x subscript 1.
  • Find the x-intercept of the tangent line and call it x subscript 2. Then, x subscript 2 equals x subscript 1 minus fraction numerator f open parentheses x subscript 1 close parentheses over denominator f apostrophe open parentheses x subscript 1 close parentheses end fraction.
If we continue this process, we get a sequence of estimates x subscript 0 comma space x subscript 1 comma space x subscript 2, ... for the estimates of the x-intercept that get closer to some number (which would be the actual x-intercept). Performing these iterations is what is known as Newton’s method.

2a. Newton’s Method: The Algorithm

Suppose the goal is to find an approximation to an x-intercept of a function y equals f open parentheses x close parentheses, which is equivalent to finding a solution to f open parentheses x close parentheses equals 0. Starting with an initial guess at x equals x subscript 0, the sequence of guesses x subscript 1 comma space x subscript 2 comma space x subscript 3, ... is generated by the formula x subscript n plus 1 end subscript equals x subscript n minus fraction numerator f open parentheses x subscript n close parentheses over denominator f apostrophe open parentheses x subscript n close parentheses end fraction.

The process stops when one of two things occurs:

  • Two consecutive x-values are “close enough” together.
  • The x-values are jumping around to the point where they aren’t getting closer to a common number.
formula to know
Newton’s Method
To find the next estimate for an x-intercept, use the formula x subscript n plus 1 end subscript equals x subscript n minus fraction numerator f open parentheses x subscript n close parentheses over denominator f apostrophe open parentheses x subscript n close parentheses end fraction.

2b. Approximating x-Intercepts with Newton’s Method

EXAMPLE

Let’s pick back up with the function f open parentheses x close parentheses equals x cubed plus 2 x minus 4. When we left off, we had x subscript 0 equals 1 and x subscript 1 equals 1.2. Let’s perform two more iterations of Newton’s Method to get a better approximation of the x-intercept. To use Newton’s method, it is best to organize the information into a table:

Note: f open parentheses x close parentheses equals x cubed plus 2 x minus 4 and f apostrophe open parentheses x close parentheses equals 3 x squared plus 2.

n bold italic x subscript bold n bold italic f open parentheses bold x subscript bold n close parentheses bold italic f bold apostrophe open parentheses bold x subscript bold n close parentheses bold italic x subscript bold n bold plus bold 1 end subscript bold equals bold italic x subscript bold n bold minus fraction numerator bold f open parentheses bold x subscript bold n close parentheses over denominator bold f bold apostrophe open parentheses bold x subscript bold n close parentheses end fraction
0 1 -1 5 1.2
1 1.2 0.128 6.32 1.179746835
2 1.179746835 0.001468379 6.175407787 1.179509057
3 1.179509057 0.0000002 6.173724847 1.179509025

The last two estimates are identical to 6 decimal places, so we conclude that the x-intercept to six decimal places of f open parentheses x close parentheses is (1.179509, 0). This also means that the equation x cubed plus 2 x minus 4 equals 0 has the solution x almost equal to 1.179509.

In this next example, we’ll see how we can apply Newton’s Method to approximating a square root of a number.

EXAMPLE

We’re going to use Newton’s Method a little differently to approximate the value of square root of 13 comma which is a solution to the equation x squared minus 13 equals 0.

Therefore, we will apply Newton’s Method to the function f open parentheses x close parentheses equals x squared minus 13.

First, find the derivative of f open parentheses x close parentheses comma which is f apostrophe open parentheses x close parentheses equals 2 x.

Next, we know from Newton’s formula that x subscript n plus 1 end subscript equals x subscript n minus fraction numerator f open parentheses x subscript n close parentheses over denominator f apostrophe open parentheses x subscript n close parentheses end fraction.

Instead of making a table of values, we will form Newton’s formula for this choice of f open parentheses x close parentheses. Using f open parentheses x close parentheses equals x squared minus 13 and f apostrophe open parentheses x close parentheses equals 2 x comma we have:

x subscript n plus 1 end subscript equals x subscript n minus fraction numerator x subscript n superscript 2 minus 13 over denominator 2 x subscript n end fraction

This is the formula we will use to find our approximations to the solution to f open parentheses x close parentheses equals 0. Recall that we need a starting value. In this case, we’ll use x subscript 0 equals 4 since we know that square root of 13 is between 3 and 4; likely closer to 4.

By the formula:

x subscript 1 equals x subscript 0 minus fraction numerator x subscript 0 superscript 2 minus 13 over denominator 2 x subscript 0 end fraction equals 4 minus fraction numerator 4 squared minus 13 over denominator 2 open parentheses 4 close parentheses end fraction equals 4 minus 3 over 8 equals 3.625

Applying the formula again to find x subscript 2 comma we have:

x subscript 2 equals x subscript 1 minus fraction numerator x subscript 1 superscript 2 minus 13 over denominator 2 x subscript 1 end fraction equals 3.625 minus fraction numerator 3.625 squared minus 13 over denominator 2 open parentheses 3.625 close parentheses end fraction almost equal to 3.605603448

(Note: Remember that it is important to carry as many decimal places as possible from one step to the next to ensure accuracy. Whatever the desired accuracy is, it should be applied to the final answer only.)

Applying the formula one last time to find x subscript 3 comma we have:

x subscript 3 equals x subscript 2 minus fraction numerator x subscript 2 superscript 2 minus 13 over denominator 2 x subscript 2 end fraction equals 3.605603448 minus fraction numerator 3.605603448 squared minus 13 over denominator 2 open parentheses 3.605603448 close parentheses end fraction almost equal to 3.605551276

Thus, after three iterations of Newton’s Method, the (positive) solution to x squared minus 13 equals 0 is approximately 3.605551276.

Using your calculator, you would see that square root of 13 almost equal to 3.605551275 comma which is very close!

watch
Use Newton’s method to find the approximate solution to x minus cos x equals 0.

summary
In this lesson, you learned the idea behind Newton’s method, which is to use tangent lines to approximate an x-intercept of the graph of y equals f open parentheses x close parentheses. Newton's method is a very straightforward approximation method designed to solve equations of the form f open parentheses x close parentheses equals 0 (equivalent to finding the x-intercepts of the graph of y equals f open parentheses x close parentheses). You learned how to apply Newton's method using its algorithm, by starting with an initial guess at x equals x subscript 0, then generating a sequence of guesses x subscript 1 comma space x subscript 2 comma space x subscript 3, ... to arrive at a close approximation of the x-intercept.

Source: THIS TUTORIAL HAS BEEN ADAPTED FROM CHAPTER 2 OF "CONTEMPORARY CALCULUS" BY DALE HOFFMAN. ACCESS FOR FREE AT WWW.CONTEMPORARYCALCULUS.COM. LICENSE: CREATIVE COMMONS ATTRIBUTION 3.0 UNITED STATES.

Formulas to Know
Newton’s Method

To find the next estimate for an x-intercept, use the formula x subscript n plus 1 end subscript equals x subscript n minus fraction numerator f open parentheses x subscript n close parentheses over denominator f apostrophe open parentheses x subscript n close parentheses end fraction.