Newton's Method for Solving Equations

Calculus I Project

Objective:

To learn Newton's Method for approximating solutions of equations.

Using Maple will help you to quickly compute the successive approximations of the solutions.

Solved Example :

Solve the equation x = 1 + sin(2x).

Solution:

There is no general technique to solve this equation and we must settle for an approximate solution. The method that we will apply is attributed to Newton and uses the idea that the tangent line to a curve closely approximates the curve near the point of tangency.

The Newton's Method

Suppose we have a function f and we want to solve equation f(x) = 0. To use Newton's method we must make an initial approximation of the solution, [Maple Math] . The next approximation, [Maple Math] , is the x-intercept of the tangent line to y = f(x) at the point ( [Maple Math] ). We need to find the formula for [Maple Math] .

[Maple Plot]

(In the figure, [Maple Math] is 5 and [Maple Math] is about 4.3)

The slope of the tangent line is [Maple Math] = f ' ( [Maple Math] ) = [Maple Math]

Solving for [Maple Math] : [Maple Math] = [Maple Math] - f( [Maple Math] ) / f ' ( [Maple Math] )

Now we repeat the process to obtain [Maple Math] from [Maple Math] , [Maple Math] from [Maple Math] , etc.

Write a formula of [Maple Math] in terms of [Maple Math] , [Maple Math] in terms of [Maple Math] .

It follows that [Maple Math] = [Maple Math] - f( [Maple Math] ) / f ' ( [Maple Math] )

We will apply this formula to solve our equation. We first put the equation in the form f(x) = 0

> f:=x->1+sin(2*x)-x;

[Maple Math]

> plot(f(x),x=-3..3);

[Maple Plot]

To solve the equation amounts to finding the x at which the graph of the function intersects the x-axis.

Let's define function g so that [Maple Math] = g(x)

> df:=x->D(f)(x);

[Maple Math]

> g:=evalf @ unapply(x-f(x)/df(x),x);

[Maple Math]

Let's make an initial guess and apply g repeatedly to it.

> x[0]:=2;

[Maple Math]

> x[1]:=g(x[0]); x[2]:=g(x[1]);

[Maple Math]

[Maple Math]

Maple can do more of these commands at the same time:

> for n from 2 to 5 do x[n+1]:=g(x[n])od;

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

Is 1.377336877 the solution?

> f(x[6]);

[Maple Math]

Yes, 1.377336877 is the solution.

This was an example of Newton's method working well. If we pick another starting point we might not be so lucky.

> w[0]:=0;

[Maple Math]

> for n from 0 to 10 do w[n+1]:=g(w[n])od;

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

The values show no signs of stabilizing. Look at the graph of the function to understand what is going on.

The tangent line at [Maple Math] = 2 is a good approximation of the function not only at the point of tangency but also at the x-intercept of the function. On the other hand the tangent line for x = 0 bears no resemblance to the function at the x-intercept of the function.

______________________________________________

ASSIGNMENT

Problem 1.

Using Newton's Method and Maple, solve the equation [Maple Math] with [Maple Math] = 5

Problem 2.

Go back to the equation in Problem 1.

a) Let [Maple Math] = 2. What seems to be happening? Sketch the first three iterations on the graph of y = [Maple Math]

b) Let [Maple Math] = 0. What happens?

Problem 3.

Solve x cos(x) = sin(x) + 1 with 0 < x < 2 [Maple Math] . Plot the graph to find a good starting point.

_________________________________________________________________________

MSIP Grant #P120A80089-98: "Three Urban Calculus Reform Programs: Adopting the Best" 1998-2001