CHAPTER 12: NUMERICAL METHODS Example 3:
Show that the equation x 3 + 7 x − 1 = 0 has a root
Locating an approximate root between x = 0 and x = 1.
Example 1:
Determine the number of real roots for the equation Show that the equation x 3 + 7 x − 1 = 0 can be
1
x 3 + x − 3 = 0. rearranged in the form x = . Hence, use the
Solution: x +7
2
iterative formula to find this root correct
to 3 decimal places given that xo = 1.
Solution:
Example 2:
Show that the equation x 3 + ln x = 0 has a root in the
interval [0.5,1].
Solution:
Iterative method
1) To find a root of equation using iterative formula
xn+1 = F ( xn ) .
Eg:
Let initial guess for root is x o .
x1 = F ( xo )
x 2 = F ( x1 )
x3 = F ( x 2 )
….
1
Identify an iteration which converges or diverges
1) If x = is an approximation to a root of the
equation x = F (x), then a sequence defined by
xn+1 = F ( xn ) with a starting value, close to will
converge to as long as F ' ( x n ) 1.
Example 4:
It is given that equation x 3 + 2 x − 4 = 0 has a root
near x = 1. The equation can be rearranged as
1
a) x = (4 − x 3 ) b) x = 3 4 − 2 x
2
Determine which of these rearranged form would be
suitable for the use of iterative formula. Estimate this
root correct to two decimal places.
Solution:
2
Newton-Raphson Method 3) Newton-Raphson Method will over-estimate when
1) To find the approximate value of x for the equation (i) f (x) is increasing and concave upwards
f ( x) = 0.
Prove:
(ii) f (x) is decreasing and concave downwards
Gradient of the tangent at x1 , f ( x1 ) is
f ( x1 ) − 0
f ' ( x) =
x1 − x 2
f ( x1 )
x1 − x 2 =
f ' ( x1 )
f ( x1 )
x 2 = x1 −
f ' ( x1 )
f ( x2 )
x3 = x 2 −
f ' ( x2 )
…
f ( xn )
x n +1 = x n − , f ' ( xn ) 0
f ' ( xn )
2) Newton-Raphson Method will under-estimate when
(i) f (x) is increasing and concave downwards
(ii) f (x) is decreasing and concave upwards
3
Example 5: Example 6:
Using x = 1 as the first approximation, find the root of Using x = 2 as the first approximation, find the root
equation e x = 3 − x with Newton-Raphson method. of equation 2 sin x = x with the Newton-Raphson
Give your answer correct to 2 decimal places. method. Give your answer correct to 3 significant
Solution: figures.
Solution:
4
Trapezium Rule
1) To estimate the value of definite integrals.
Prove:
n strips/ intervals
( n + 1 ) ordinates
Example 8:
Area under a curve Using the trapezium rule with 3 ordinates, find an
Sum of area of trapezium estimate for the area under the curve y = sin x
= A1 + A2 + A3 + ... + An−1 + An
between x = 0 and x = . Give your answer correct
b − a 12 ( y o + y1 ) + 12 ( y1 + y 2 ) + 12 ( y 2 + y3 ) + ... 2
= to 2 decimal places. Use a sketch graph of y = sin x ,
n + 12 ( y n−1 + y n ) determine whether the trapezium rule gives an over-
= h y o + 2( y1 + y 2 + y 3 + ... + y n −1 ) + y n
1 estimate or under-estimate of the area.
2 Solution:
Hence,
h y o + 2( y1 + y 2 + y 3 + ... + y n −1 ) + y n
1
b
f ( x)dx =
a 2
b−a
where h =
n
2) If a graph is concave upwards, the trapezium rule
over-estimates the actual area.
3) If a graph is concave downwards, the trapezium rule
under-estimates the actual area.
Example 7:
1
(1 + x ) dx using the trapezium rule with five
2
2 2
Find
1
ordinates. Give your answer correct to 3 decimal places.
Solution: