Sunteți pe pagina 1din 10

NUMERICAL METHODS: THE NEWTON-

RAPHSON METHOD
Compiled by Dr EL Voges, Soshanguve South

OUTCOME
Implement the Newton-Raphson method in suitable situations to determine numerical
solutions of equations.

ASSESSMENT CRITERIA
After studying this module you must be able to:
1. Solve a given equation using the Newton-Raphson method;
2. Perform a specified number of iterations of the Newton-Raphson method;
3. "Guess" a first approximation to the solutions
3.1 sing a sketch and/or
3.2 using the remainder theorem; and
3. Discuss the limitations of the Newton-Raphson method.

PREREQUISITES
In order to perform the tasks/calculations in this module, you must know and be able to
implement the following:
1. Differentiation techniques learnt so far; and
2. The remainder theorem.

TERMINOLOGY
At the end of this module you must be able to explain and use the following concepts.
First approximation Initial guess Iteration
Iterative process Newton-Raphson method Remainder theorem

APPROXIMATE TIME
Two hours in theory class.

 You should spend at least three hours of your study time doing the exercises in
the textbook and on WebCT!

ASSESSMENT
You will come across questions on the contents of this module in the exam, in the first
major test and in class tests.

1
IN THE TEXTBOOK
pp. 351-356

PRACTISE
Textbook: Exercise 7(h), pp. 355-356; Miscellaneous Exercise 7, pp. 358, #20

 The complete solutions to all the exercises in the textbook are available on the
web at www.palgrave.com/science/engineering/singh.

 Additional exercises are available towards the end of this document.

SUMMARY OF THE FACTS


1. The Newton-Raphson method
The Newton-Raphson formula: To determine the roots of f ( x) = 0 , "guess" the answer.
With an initial guess of r1, the values of r2, r3, r4, … are obtained by using the formula

f (rn )
rn+1 = rn − .
f '(rn )

 Always first write the given equation in the form f ( x) = 0 .

 The number of iterations depends on the accuracy required.

 Remember, "four iterations" means "calculate r5".

 How many iterations? Suppose an accuracy of four decimal places is required.


Stop when rn+1 − rn < 0.0001 .

 When asked for an answer with three decimal places, round all intermediate
approximations off to four decimal places.

2. Programming the Sharp 506


Remember, to enter a variable such as X, press ALPHA and then X.

Example 1
Solve cos x − x = 0 the Newton-Raphson method and initial guess r1 = 1 . Work
accurately to four decimal places.

2
SOLUTION
f ( x) = cos x − x ⇒ f '( x) = − sin x − 1
cos rn − rn (cos rn − rn )
Thus, the Newton-Raphson formula is rr +1 = rn − = rn + .
− sin rn − 1 (sin rn + 1)

Enter the expression on the calculator: X − (cos X − X ) ÷ (− sin X − 1)

 Note the use of brackets.

 Make sure your calculator is in RAD mode!

To calculate r2: 2nd ALG 1 Enter


and round the answer off to five decimal places: 0.75036

To calculate r3: 2nd ALG 0.75036 Enter , etc.

Write down your answer to the question as follows:

f ( x) = cos x − x ⇒ f '( x) = − sin x − 1


r1 = 1
r2 ≈ 0.75036
r3 ≈ 0.73911
r4 ≈ 0.73909
∴ x ≈ 0.7391 Υ

 Remember to write down the answer!

3. The initial guess


In this course we will usually give the initial guess. However, you may be asked to guess
yourself, and you can do it in one of two ways.
• Sketch the graph of f ( x) and use this graph to "guess" the first value. See
Exercise 7(h), p. 355.
• Use the remainder theorem as described in Example 27 on p. 354.

4. Using Derive
The Derive command: NEWTON(u,x,x0,n)
where
• u is a univariate expression, that is, an expression in
one variable
• x is the variable

3
• x0 is the initial guess
• n+1 iterations will be done

Then click Enter and ≈

 Practice with Derive by answering all the questions in the additional exercises at
the end of this document.

 Sketch the graph of #20 of Miscellaneous Exercise 7 on p 358 using Derive.

5. Use of the Casio fx-991ES PLUS

Example 2
Newton invented his version of the Newton-Raphson method while trying to solve the
equation x 3 − 2 x − 5 = 0 . (Burden & Faires, 2005:63;Edwards & Penny, 2002:179).
Determine the solution of this equation close to 2 accurately to four decimal places.

SOLUTION
 xn 3 − 2 xn − 5 
f ( x) = x − 2 x − 5 ⇒ f '( x) = 3 x − 2
3 2
∴ xn +1 = xn −  2 
 3 xn − 2 

Casio fx-991ES PLUS


⊕ SOLVE on the Casio uses Newton's method! Enter the given equation and get the
answer only.
⊕ Alternatively use CALC. Enter the iterative formula and get the intermediate steps
as well.

SOLVE
• Enter the original equation
ALPHA X SHIFT x3 – 2 ALPHA X – 5 ALPHA = 0 You'll see the
equation
• Solve the equation
SHIFT SOLVE 2 =

The answer is displayed: 2.094551482

CALC
• Enter the iterative formula – remember the ALPHA
 X 3 − 2X − 5 
X − 2 
 3X − 2 
• Determine the values of x

4
21
CALC 2 = See = 2.1
10
11761
CALC 2.1 = See = 2.094568121
5615
CALC 2.09457 See 2.094551482
CALC 2.09455 See 2.094551482

∴ x ≈ 2.0946

5. Limitations of the Newton-Raphson method


Does this method always give the expected answer?

Example 3
Use numerical methods to solve for x if x3 − x − 1 = 0 and the indicated initial value. Give
the answer correct to four decimal places.
a) r1 = 1 b) r1 = 0.6 c) r1 = 0.5
SOLUTION
f ( x) = x3 − x − 1 ⇒ f '( x) = 3 x 2 − 1

 For the answer to be accurate to four decimal places, we round of the


intermediate answers to five decimal places.

a) r1 = 1 b) r1 = 0.6 c) r1 = 0.5
r2 = 1.5 r2 = 17.9 r2 = −5.0
r3 ≈ 1.34783 r3 ≈ 11.94680 r3 ≈ −3.36486
r4 ≈ 1.32520 r4 ≈ 7.98552 r4 ≈ −2.28095
r5 ≈ 1.32472 r5 ≈ 5.35691 M
r6 ≈ 1.32472 r6 ≈ 3.62540 r7 ≈ −0.561403
∴ x ≈ 1.3247 r7 ≈ 2.50559 r8 ≈ −11.85980
r8 ≈ 1.82013 M
r9 ≈ 1.46104 r20 ≈ 1.32472
r10 ≈ 1.33932 r21 ≈ 1.32472
r11 ≈ 1.32491 ∴ x ≈ 1.3247 Υ
r12 ≈ 1.32472
r13 ≈ 1.32472
∴ x ≈ 1.3247

 Note the 0 in r8 ≈ −11.85980 . Leaving out this zero will imply four decimal
places.

5
 Why did we need so many iterations in (b) and 20 in (c) to reach the required
accuracy?

y 0.5

x
-1 -0.5 0 0.5 1 1.5 2
0

f 
1
-0.5

-1
f 
0. 6
f 
0. 5

-1.5

Turning point

3
Figure 1 The graph of f ( x ) = x − x − 1

• Consider the graph of f ( x) given in Figure 1. From the graph we see that
the equation x3 − x − 1 = 0 has only one root between 1 and 1.5. Thus,
choosing r1 = 1 will converge to the correct answer relatively quickly
while r1 = 0.6 , which is further away from the actual solution, will require
more steps.
• One turning point of f ( x) is at x = 3 3 ≈ 0.57735 . Thus, the actual root is
to the right of this turning point. But 0.5 is to the left of this turning point
and hence choosing r1 = 0.5 will require even more steps.

Example 4
Use Derive to determine the root of f (b) = (b 2 − 1) sin b − 2b cos b , b ≥ 0 , with the
indicated initial approximations.
a) r1 = 7 b) r1 = 8
SOLUTION
a) r1 = 7
In Derive: NEWTON((b - 1)·SIN(b) - 2·b·COS(b), b, 7, 7)
The answer: [7, 6.604697609, 6.584733220, 6.584620046, 6.584620042,
6.584620042, 6.584620042, 6.584620042]

∴ x1 = 7 : x ≈ 6.584620042 after four iterations

b) r1 = 8
In Derive: NEWTON((b^2-1)*sin(b)-2b*cos(b), b, 8, 7)

6
The answer: [8, 5.162145435, 1.844325061, 1.371290831, 1.309318149,
1.306548196, 1.306542374, 1.306542374]

∴ x ≈ 1.306542374 after six iterations. Υ

 Consider the graph in Figure 2 to see the reason for the different answers.

50

g 
8
25
x

0
0 2 4 6 8 10

-25

2
Figure 2 The graph of f (b) = (b − 1) sin b − 2b cos b

Some limitations
• The initial guess must be relatively close the root to limit the number of iterations
required. However, with computer technology such as Derive the approximate
root may be obtained in the blink of the eye.
• The initial guess must be close enough to the root to prohibit convergence to a
different root, as was the case in Example 4.

 We strongly recommend that you do all the exercises in the textbook and
additional exercises using your calculator and Derive.

7
NUMERICAL METHODS: THE NEWTON-
RAPHSON METHOD
Compiled by Dr EL Voges, Soshanguve South

ADDITIONAL EXERCISES

The answers to these questions are given at the end of this document.

1. Use the Newton-Raphson method to determine roots close to the initial guesses.
Give the answers rounded off to four decimal places.
1.1 2 sin x = x, r1 = 2 1.2 2 sin x = x, r1 = −2
1.3 x3 = 4 x − 1, r1 = 2 1.4 x3 = 4 x − 1, r1 = −2
1.5 2 cos x = 2 − x, r1 = 3.5 1.6 x5 − 10 = 0, r1 = 1.5
1.7 3 x − 1 = x, r1 = 1.1 1.8 x3 − 2 x + 1 = 0, r1 = −2
1.9 3ln x − x = 0, r1 = 2 1.10 x3 = 5cos 2 x, r1 = 0.5

2. Consider the function f ( x) = x 2 − 2 .


2.1 Determine the positive root of f ( x) = 0 using the Newton-Raphson method with
initial guess r1 = 1 . Give the answer accurately to five decimal places.
2.2 Compare this answer to the numerical value of 2 .
2.3 Hence describe in your own words how the Newton Raphson method may be used
to determine 7 .

The following questions are from Finney, Weir & Giordano, 2003:303-304.

3. Explain why the following four statements ask for the same information:
a) Determine the roots of f ( x) = x3 − 3 x − 1 .
b) Determine the x coordinates of the intersections of the curve y = x3 with the
line y = 3 x + 1 .
c) Determine the x-coordinates of the points where the curve y = x3 − 3 x crosses
the horizontal line y = 1 .
d) Determine the values of x where the derivative of g ( x) = 14 x 4 − 32 x 2 − x − 5
equals zero.

You may use Derive to answer the following questions.

4. Given: sin 3 x = 0.99 − x 2 .


4.1 How many roots does this equation have?

8
4.2 Use Newton's method (the Newton-Raphson method) to determine all the roots
accurately to six decimal places.

5. While trying to determine the acidity of a saturated solution of magnesium


hydroxide in hydrochloric acid, you derive the equation
3.64 × 10−11
= [H 3O + ]+3.6 × 10-4
[H 3O + ]2
for the hydronium ion concentration [H 3O]+ .
5.1 To determine the value of [H 3O]+ , set x = 104 [H 3O]+ and show that the equation is
converted to
x3 + 3.6 x 2 − 36.4 = 0 .
5.2 Solve for x using Newton's method. Give the answer accurately to two decimal
places.
5.3 Hence determine [H 3O]+ .

9
NUMERICAL METHODS: THE NEWTON-
RAPHSON METHOD
Compiled by Dr EL Voges, Soshanguve South

 When you come across an incorrect answer in this document, please


contact me via my WebCT e-mail.

ANSWERS
1.1 1.8955 1.2 -1.8955 1.3 1.8608 1.4 -2.1149
1.5 3.6982 1.6 1.5849 1.7 1.1459 1.8 -1.6180
1.9 1.8572 1.10 0.74414 2.1 1.41421 2.2 2 ≈ 1.41421
3. Discussion 4.1 3 4.2 -1.026173; 0.350035; 1.237996
5.1 Proof 5.2 2.45 5.3 2.45 × 10 −4

Back

10

S-ar putea să vă placă și