Solving Equations by Iterative Methods - Lecture 4
Solving Equations by Iterative Methods - Lecture 4
9
Solving equations by iterative methods
f (x) Hence
f (1.0625) = 5(1.0625)2 + 11(1.0625) − 17
A
20
= +0.33203125
2
f (x) = 5x +11x−17
Since f (1) is negative and f (1.0625) is positive, a
10 root lies between x = 1 and x = 1.0625.
1 + 1.0625
Bisecting this interval gives i.e.
−3 −2 −1 0 1 2 2
1.03125.
−10
Hence
−17
−20 f (1.03125) = 5(1.03125)2 + 11(1.03125) − 17
= −0.338867 . . .
Since f (1.03125) is negative and f (1.0625) is posi-
Figure 9.2 tive, a root lies between x = 1.03125 and x = 1.0625.
Bisecting this interval gives
The method of bisection suggests that the root is
1+2 1.03125 + 1.0625
at = 1.5, i.e. the interval between 1 and 2 has i.e. 1.046875
2 2
been bisected.
Hence
Hence
f (1.046875) = 5(1.046875)2 + 11(1.046875) − 17
f (1.5) = 5(1.5)2 + 11(1.5) − 17
= −0.0046386 . . .
= +10.75
Since f (1.046875) is negative and f (1.0625) is
Since f (1) is negative, f (1.5) is positive, and f (2) is positive, a root lies between x = 1.046875 and
also positive, a root of the equation must lie between x = 1.0625.
x = 1 and x = 1.5, since a sign change has occurred
Bisecting this interval gives
between f (1) and f (1.5).
1 + 1.5 1.046875 + 1.0625
Bisecting this interval gives i.e. 1.25 as the i.e. 1.0546875
2 2
next root.
The last three values obtained for the root are
Hence 1.03125, 1.046875 and 1.0546875. The last two val-
f (1.25) = 5(1.25)2 + 11x − 17 ues are both 1.05, correct to 3 significant figure. We
therefore stop the iterations here.
= +4.5625
Thus, correct to 3 significant figures, the positive
Since f (1) is negative and f (1.25) is positive, a root root of 5x2 + 11x − 17 = 0 is 1.05
lies between x = 1 and x = 1.25.
1 + 1.25
Bisecting this interval gives i.e. 1.125 Problem 2. Use the bisection method to deter-
2
Hence mine the positive root of the equation x + 3 = ex ,
correct to 3 decimal places.
f (1.125) = 5(1.125)2 + 11(1.125) − 17
= +1.703125 Let f (x) = x + 3 − ex
Since f (1) is negative and f (1.125) is positive, a root then, using functional notation:
lies between x = 1 and x = 1.125. f (0) = 0 + 3 − e0 = +2
1 + 1.125 f (1) = 1 + 3 − e1 = +1.2817 . . .
Bisecting this interval gives i.e. 1.0625.
2 f (2) = 2 + 3 − e2 = −2.3890 . . .
78 NUMBER AND ALGEBRA
3
1.5625 + 1.5
f(x) = e x i.e. 1.53125
2
2
Hence
1
f (1.53125) = 1.53125 + 3 − e1.53125
−2 −1 0 1 2 x
= −0.09270 . . .
Since f (1.53125) is negative and f (1.5) is positive,
a root lies between x = 1.53125 and x = 1.5.
Bisecting this interval gives
Figure 9.3
1.53125 + 1.5
i.e. 1.515625
2
Bisecting the interval between x = 1 and x = 2 gives
1+2 Hence
i.e. 1.5.
2 f (1.515625) = 1.515625 + 3 − e1.515625
Hence
= −0.03664 . . .
f (1.5) = 1.5 + 3 − e1.5 Since f (1.515625) is negative and f (1.5) is positive,
= +0.01831 . . . a root lies between x = 1.515625 and x = 1.5.
Bisecting this interval gives
Since f (1.5) is positive and f (2) is negative, a root
lies between x = 1.5 and x = 2. 1.515625 + 1.5
1.5 + 2 i.e. 1.5078125
Bisecting this interval gives i.e. 1.75. 2
2
Hence Hence
f (1.5078125) = 1.5078125 + 3 − e1.5078125
f (1.75) = 1.75 + 3 − e1.75
= −0.009026 . . .
= −1.00460 . . .
Since f (1.5078125) is negative and f (1.5) is positive,
Since f (1.75) is negative and f (1.5) is positive, a root a root lies between x = 1.5078125 and x = 1.5.
lies between x = 1.75 and x = 1.5.
1.75 + 1.5 Bisecting this interval gives
Bisecting this interval gives i.e. 1.625.
2 1.5078125 + 1.5
Hence i.e. 1.50390625
2
f (1.625) = 1.625 + 3 − e1.625 Hence
= −0.45341 . . .
f (1.50390625) = 1.50390625 + 3 − e1.50390625
Since f (1.625) is negative and f (1.5) is positive, a = +0.004676 . . .
root lies between x = 1.625 and x = 1.5.
Since f (1.50390625) is positive and f (1.5078125)
1.625 + 1.5 is negative, a root lies between x = 1.50390625 and
Bisecting this interval gives i.e. 1.5625.
2 x = 1.5078125.
SOLVING EQUATIONS BY ITERATIVE METHODS 79
−2
Let f (x) = 2 ln x + x − 2
f (0.1) = 2 ln (0.1) + 0.1 − 2 = −6.5051 . . .
(Note that ln 0 is infinite that
is why x = 0 was not chosen) Figure 9.4
80 NUMBER AND ALGEBRA
Hence, the solution of 2 ln x + x = 2 is x = 1.37, (d) Let the true value of the root be (x2 + δ2 ).
correct to 2 decimal places. (e) Determine x3 , the approximate value of (x2 + δ2 )
by determining the value of f (x2 + δ2 ) = 0, but
Now try the following exercise. neglecting terms containing products of δ2 .
(f) The fourth and higher approximations are
Exercise 39 Further problems on the obtained in a similar way.
bisection method
Using the techniques given in paragraphs (b) to (f),
Use the method of bisection to solve the follow- it is possible to continue getting values nearer and
ing equations to the accuracy stated. nearer to the required root. The procedure is repeated
until the value of the required root does not change
1. Find the positive root of the equation on two consecutive approximations, when expressed
x 2 + 3x − 5 = 0, correct to 3 significant fig- to the required degree of accuracy.
ures, using the method of bisection. [1.19]
2. Using the bisection method solve ex − x = 2, Problem 4. Use an algebraic method of suc-
correct to 4 significant figures. [1.146] cessive approximations to determine the value
of the negative root of the quadratic equation:
3. Determine the positive root of x 2 = 4 cos x, 4x 2 − 6x − 7 = 0 correct to 3 significant figures.
correct to 2 decimal places using the method Check the value of the root by using the quadratic
of bisection. [1.20] formula.
4. Solve x − 2 − ln x = 0 for the root near to 3,
correct to 3 decimal places using the bisection A first estimate of the values of the roots is made by
method. [3.146] using the functional notation method
5. Solve, correct to 4 significant figures, f (x) = 4x 2 − 6x − 7
x − 2 sin2 x = 0 using the bisection method. f (0) = 4(0)2 − 6(0) − 7 = −7
[1.849]
f (−1) = 4(−1)2 − 6(−1) − 7 = 3
SOLVING EQUATIONS BY ITERATIVE METHODS 81
These results show that the negative root lies between Neglecting terms containing products of δ2
0 and −1, since the value of f (x) changes sign gives:
between f (0) and f (−1) (see Section 9.1). The pro- 2.3864 − 6.1792 δ2 + 4.6344 − 6 δ2 − 7 ≈ 0 A
cedure given above for the root lying between 0 and
−1 is followed. −2.3864 − 4.6344 + 7
i.e. δ2 ≈
−6.1792 − 6
First approximation
−0.0208
(a) Let a first approximation be such that it divides ≈
−12.1792
the interval 0 to −1 in the ratio of −7 to 3, i.e.
let x1 = −0.7. ≈ +0.001708
Thus x3 , the third approximation to the root is
Second approximation (−0.7724 + 0.001708),
(b) Let the true value of the root, x2 , be (x1 + δ1 ). i.e. x3 = −0.7707, correct to 4 significant figures
(or −0.771 correct to 3 significant figures).
(c) Let f (x1 + δ1 ) = 0, then, since x1 = −0.7,
4(−0.7 + δ1 )2 − 6(−0.7 + δ1 ) − 7 = 0
Fourth approximation
Hence, 4[(−0.7)2 + (2)(−0.7)(δ1 ) + δ21 ]
− (6)(−0.7) − 6 δ1 − 7 = 0 (f) The procedure given for the second and third
approximations is now repeated for
Neglecting terms containing products of δ1
gives: x3 = −0.7707
Let the true value of the root, x4 , be (x3 + δ3 ).
1.96 − 5.6 δ1 + 4.2 − 6 δ1 − 7 ≈ 0
Let f (x3 + δ3 ) = 0, then since x3 = −0.7707,
i.e. −5.6 δ1 − 6 δ1 = −1.96 − 4.2 + 7
4(−0.7707 + δ3 )2 − 6(−0.7707
−1.96 − 4.2 + 7
i.e. δ1 ≈ + δ3 ) − 7 = 0
−5.6 − 6
0.84 4[(−0.7707)2 + (2)(−0.7707) δ3 + δ23 ]
≈
−11.6 − 6(−0.7707) − 6 δ3 − 7 = 0
≈ −0.0724 Neglecting terms containing products of δ3
Thus, x2 , a second approximation to the root is gives:
[−0.7 + (−0.0724)], 2.3759 − 6.1656 δ3 + 4.6242 − 6 δ3 − 7 ≈ 0
i.e. x2 = −0.7724, correct to 4 significant fig-
−2.3759 − 4.6242 + 7
ures. (Since the question asked for 3 significant i.e. δ3 ≈
figure accuracy, it is usual to work to one figure −6.1656 − 6
greater than this). −0.0001
≈
The procedure given in (b) and (c) is now −12.156
repeated for x2 = −0.7724.
≈ +0.00000822
Third approximation Thus, x4 , the fourth approximation to the root is
(−0.7707 + 0.00000822), i.e. x4 = −0.7707,
(d) Let the true value of the root, x3 , be (x2 + δ2 ). correct to 4 significant figures, and −0.771,
correct to 3 significant figures.
(e) Let f (x2 + δ2 ) = 0, then, since x2 = −0.7724,
Since the values of the roots are the same on two
4(−0.7724 + δ2 )2 − 6(−0.7724 + δ2 ) − 7 = 0 consecutive approximations, when stated to the
required degree of accuracy, then the negative
4[(−0.7724)2 + (2)(−0.7724)(δ2 ) + δ22 ]
root of 4x 2 − 6x − 7 = 0 is −0.771, correct to 3
− (6)(−0.7724) − 6 δ2 − 7 = 0 significant figures.
82 NUMBER AND ALGEBRA
[Checking, using the quadratic formula: Neglecting terms containing products of δ1 and
using the binomial series gives:
−(−6) ± [(−6)2 − (4)(4)(−7)]
x= 3[1.83 + 3(1.8)2 δ1 ] − 10[1.82 + (2)(1.8) δ1 ]
(2)(4)
+ 4(1.8 + δ1 ) + 7 ≈ 0
6 ± 12.166
= = −0.771 and 2.27, 3(5.832 + 9.720 δ1 ) − 32.4 − 36 δ1
8
correct to 3 significant figures] + 7.2 + 4 δ1 + 7 ≈ 0
17.496 + 29.16 δ1 − 32.4 − 36 δ1
[Note on accuracy and errors. Depending on the + 7.2 + 4 δ1 + 7 ≈ 0
accuracy of evaluating the f (x + δ) terms, one or two
iterations (i.e. successive approximations) might be −17.496 + 32.4 − 7.2 − 7
δ1 ≈
saved. However, it is not usual to work to more than 29.16 − 36 + 4
about 4 significant figures accuracy in this type of
calculation. If a small error is made in calculations, 0.704
≈− ≈ −0.2479
the only likely effect is to increase the number of 2.84
iterations.]
Thus x2 ≈ 1.8 − 0.2479 = 1.5521
Since x4 and x5 are the same when expressed The functional notation method is used to determine
to the required degree of accuracy, then the the first approximation to the root.
required root is 1.62, correct to 3 significant A
figures. f (x) = 5x 2 + 11x − 17
Now try the following exercise. f (0) = 5(0)2 + 11(0) − 17 = −17
Use an algebraic method of successive approx- This shows that the value of the root is close to x = 1.
imation to solve the following equations to the
accuracy stated. Let the first approximation to the root, r1 , be 1.
Newton’s formula states that a closer approximation,
1. 3x 2 + 5x − 17 = 0, correct to 3 significant
f (r1 )
figures. [−3.36, 1.69] r2 = r1 −
f (r1 )
2. x 3 − 2x + 14 = 0, correct to 3 decimal places. f (x) = 5x + 11x − 17,
2
[−2.686]
3. x 4 − 3x 3 + 7x − 5.5 = 0, correct to 3 signifi- thus, f (r1 ) = 5(r1 )2 + 11(r1 ) − 17
cant figures. [−1.53, 1.68]
= 5(1)2 + 11(1) − 17 = −1
4. x 4 + 12x 3 − 13 = 0, correct to 4 significant f (x) is the differential coefficient of f (x),
figures. [−12.01, 1.000]
i.e. f (x) = 10x + 11.
Thus f (r1 ) = 10(r1 ) + 11
9.4 The Newton-Raphson method = 10(1) + 11 = 21
The Newton-Raphson formula, often just referred to By Newton’s formula, a better approximation to the
as Newton’s method, may be stated as follows: root is:
−1
If r1 is the approximate value of a real root of the r2 = 1 − = 1 − (−0.048) = 1.05,
equation f (x) = 0, then a closer approximation 21
to the root r2 is given by: correct to 3 significant figures.
f (r1 )
r2 = r1 − A still better approximation to the root, r3 , is
f (r1 ) given by:
required root is 1.05, correct to 3 significant figures. [(2.005)2 − 3 sin 2.005 + 2 ln 3.005 − 3.5]
Checking, using the quadratic equation formula, = 2.005 −
2
√ 2(2.005) − 3 cos 2.005 +
−11 ± [121 − 4(5)(−17)] 2.005 + 1
x=
(2)(5) (−0.00104)
= 2.005 − = 2.005 + 0.000175
−11 ± 21.47 5.9376
=
10 i.e. r3 = 2.01, correct to 3 significant figures.
The positive root is 1.047, i.e. 1.05, correct to 3 Since the values of r2 and r3 are the same when
significant figures (This root was determined in expressed to the required degree of accuracy, then the
Problem 1 using the bisection method; Newton’s required root is 2.01, correct to 3 significant figures.
method is clearly quicker).
f (r1 )
Newton’s formula states that r2 = r1 − , where The functional notational method is used to deter-
f (r1 )
r1 is a first approximation to the root and r2 is a better mine the approximate value of the root.
approximation to the root. x
f (x) = (x + 4)3 − e1.92x + 5 cos − 9
Since f (x) = x 2 − 3 sin x + 2 ln(x + 1) − 3.5 3
f (0) = (0 + 4) − e + 5 cos 0 − 9 = 59
3 0
f (r1 ) = f (2) = 22 − 3 sin 2 + 2 ln 3 − 3.5,
1
where sin2 means the sine of 2 radians f (1) = 53 − e1.92 + 5 cos − 9 ≈ 114
3
= 4 − 2.7279 + 2.1972 − 3.5 2
f (2) = 63 − e3.84 + 5 cos − 9 ≈ 164
= −0.0307 3
2 f (3) = 73 − e5.76 + 5 cos 1 − 9 ≈ 19
f (x) = 2x − 3 cos x +
x+1 4
2 f (4) = 83 − e7.68 + 5 cos − 9 ≈ −1660
f (r1 ) = f (2) = 2(2) − 3 cos 2 + 3
3 From these results, let a first approximation to the
= 4 + 1.2484 + 0.6667 root be r1 = 3.
Newton’s formula states that a better approximation
= 5.9151 to the root,
f (r1 )
Hence, r2 = r1 − f (r1 )
f (r1 ) r 2 = r1 −
f (r1 )
−0.0307
=2−
5.9151 f (r1 ) = f (3) = 73 − e5.76 + 5 cos 1 − 9
= 2.005 or 2.01, correct to = 19.35
3 significant figures. 5 x
f (x) = 3(x + 4)2 − 1.92e1.92x − sin
A still better approximation to the root, r3 , is 3 3
given by: 5
f (r2 ) f (r1 ) = f (3) = 3(7)2 − 1.92e5.76 − sin 1
r3 = r2 − 3
f (r2 ) = −463.7
SOLVING EQUATIONS BY ITERATIVE METHODS 85