Chapter 3: Applications of Differentiation
Section 3.2: Newton's Method
Example 3.2.1
Use Newton's method to calculate the positive zero of the function fx=sinx−x/2.
Solution
Define f and draw its graph
Control-drag fx=… Context Panel: Assign Function
fx=sinx−x/2→assign as functionf
Figure 3.2.1(a) can be drawn interactively with the Plots option in the Context Panel.
The positive zero of f certainly lies in the interval 1,3, and appears to be slightly less than 2.
Figure 3.2.1(a) Graph of fx=sinx−x/2
Obtain the Maple solution for the equation fx=0
Type fx=0 and press the Enter key.
Context Panel: Solve≻Numerically Solve from point≻x=2
fx=0
sin⁡x−12⁢x=0
→solve
1.895494267
Construct the iteration function gx=x−fxf′x
Control-drag gx=… Context Panel: Assign Function
gx=x−fxf′x→assign as functiong
Implement the Newton iteration
Start with x0=3.0 and compute x1=gx0=g3.0
g3.0
2.087995413
Compute x2=gx1, referencing x1 by its equation label.
g
1.912229259
Compute x3=gx2, referencing x2 by its equation label.
1.895652628
Compute x4=gx3, referencing x3 by its equation label.
1.895494282
Compute x5=gx4, referencing x4 by its equation label.
Compute x6=gx5, referencing x5 by its equation label.
Since x6=x5, no further iteration at this level of accuracy will produce a more accurate solution. In fact, x5 agrees exactly with Maple's numeric solution computed with the default number of digits, namely, ten.
Table 3.2.1(a) implements the Newton iteration by explicitly obtaining the equations determining the x-intercepts of successive tangent lines, and solving the equations for the Newton iterates.
Set y=0 in the equation of the tangent line at x=3.0. Press the Enter key.
Context Panel: Solve≻Numerically Solve
f′3.0 x−3.0+f3.0=0
−1.489992497⁢x+3.111097499=0
Set y=0 in the equation for the tangent line at the new x. Press the Enter key.
f′ x− +f=0
−0.9944475053⁢x+1.901611616=0
−0.8348376528⁢x+1.582562190=0
1.895652627
−0.8191726053⁢x+1.552736989=0
−0.8190225383⁢x+1.552452526=0
Table 3.2.1(a) Newton iterates generated as x-intercepts of successive tangent lines
The Newton's Method tutor
Figure 3.2.1(b) contains an image of the tutor used to solve the equation fx=0 starting from x=3. The tutor shows the ensuing iterates, and can display an animation of the successive tangent lines.
Notice at the bottom of the tutor that there is the NewtonsMethod command from the Student Calculus1 package.
The output from this command can be one of plot, animation, sequence, or value. With the option sequence, the command returns a sequence of iterates. The default is value, for which the return is just the "final" iterate.
Figure 3.2.1(b) Newton's Method tutor
The NewtonsMethod command
Student:-Calculus1:-NewtonsMethodfx,3,iterations=6,output=sequence
By wrapping the command in angle-brackets (inequality symbols), the output of the NewtonsMethod command is converted from a horizontally-written sequence, to a column vector, a much easier display to read.
<< Previous Section Section 3.2 Next Example >>
© Maplesoft, a division of Waterloo Maple Inc., 2024. All rights reserved. This product is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation.
For more information on Maplesoft products and services, visit www.maplesoft.com
Download Help Document