Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Note Chapter 3 Mathematics (SM025)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

MR.

SANJAY A/L PRADEEP KUMAR Mathematics QS 025


Topic 3: Numerical Method

TOPIC : 3.0 NUMERICAL METHOD

SUBTOPIC : 3.1 Solutions of non – linear equations

OBJECTIVE : The objective of this lesson is to enable students to locate


approximately a root of an equation, by means of graphical
considerations and/ or searching for a sign change.

SET INDUCTION

Ask the students to solve the following equations,

1. Solve x 2  4 x  5  0
Solution : x 2  4 x  5  0
(x + 1)(x – 5) = 0
So (x + 1) = 0 or (x – 5) = 0
x  1 or x  5
2. Solve x 3  8  0
Solution : x 3  8  0

x3  8 , So x  3 8  2

3. Solve x3  e x  0
Solution :
We cannot find the exact root of the equation above.

So, in this subtopic we are going discuss numerical methods to find the approximate
numerical solutions of such equations.

CONTENT

1
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

Introduction

Many equations cannot be solved exactly, but various methods of finding approximate
numerical solutions exist.

The most commonly used methods have two main parts:


(a) finding an initial approximate value
(b) improving this value by an iterative process

Initial Values:

The initial value of the roots of f ( x)  0 can be located approximately by either a


graphical or an algebraic method.

Graphical Method:

Either

(a) Plot ( or sketch ) the graph of y  f (x) .


The real roots are the points where the curve cuts the x – axis.

Or

2
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

(b) Rewrite f ( x)  0 in the form F ( x)  G( x) .


Plot ( or sketch ) y  F (x) and y  G(x) . The real roots are at the points where
these graphs intersect.

Example 1

Find the root of the equation y  x 3 by using the graphical method.

Solution :

The root is x  0

Example 2

3
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

Find the approximate value of the equation ln x + x  4 = 0 by using the graphical method.

Solution:

Rearrange the equation ln x + x  4 = 0 as ln x = 4  x . Sketch the graph of y  ln x and


y  4  x on the same axes.

the intersection is at x  2.
Example 3
Draw the graphs of y1  x and y2  e x on the same coordinate’s axes. Estimate the root
of the equation of x  e x  0 .

Solution:

The root is x  0.6

4
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

Algebraic Method

Find two values a and b such that f (a) and f (b) have different signs.
At least one root must lie between a and b if f (x) is continuous.
If more than one root is suspected between a and b, sketch a graph of y  f (x) .

Example 1

Find the approximate value of the equation ln x  x  2  0 by using algebraic method.

Solution:
f ( x)  ln x  x  2
f (1)  ln 1  1  2  1  0 (ve)
f (2)  ln 2  2  2  0.69  0 (ve)

The root is between x = 1 and x = 2, so we can choosing x₀ = 1.5 for initial value.

Example 2

The root of the equation 2 x  e x lies between x = a and x = b. Find the values of a and b.

Solution:
f  x   2 x  e x

f  0   2  0   e0  1  0

f 1  2 1  e1  1.6  0


a  0 and b  1

5
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

Example 3

Show that the root of the equation 3x  x3 lies in the interval  2.4 2.5 .

Solution:

Rearrange the equation 3x  x3 as x3  3x  0 .


Let f ( x)  x3  3x

When x = 2.4
f (2.4)  (2.4)3  32.4
 0.1426  0 (ve)
When x = 2.5
f (2.5)  (2.5)3  32.5
 0.0356  0 (ve)

The sign is difference, therefore the root lies in the interval  2.4 2.5 .
Exercises:

1. Show that the equation sin x  x  0.5  0 has a root lying in the interval  2,1 .

2. Show that the equation 1  3x  x3  0 has a root lying between 1 and 2.

3. Using the graphical method, show that the equation e2 x  4 x  5  0 has only one
real root. Find the unit interval where the root lies.
Answer : 0,1

4. By sketching the graph y  x 3 and y  1  x , show that the equation


x3  x  1  0 has only one real root. Show by calculation that the root is in the
interval  2,0 .

6
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

SUBTOPIC : 3.2 Newton-Raphson Method

OBJECTIVE : The objective of this lesson is to enable students to find the root by
the Newton-Raphson method using the formula
f ( xn )
xn+1 = xn - , n = 1,2,3, …
f ' ( xn )

CONTENT

Newton-Raphson Method

If x1 is an aprroximation to root  of f(x) = 0 , then a better approximation x2 is given by

f ( x1 )
x2  x1  .
f ( x1 )

Repeat this process as required.

f ( xn )
xn  1  xn 
f  ( xn )

This method fails if

(a) f  (α) is near to zero.


(b) f  (x) is very large.

Example 1

Using the Newton-Raphson Method, find the solution of f  x   x  e x near x  0.5 to


four decimal places.

Solution

Let f  x   x  ex

So f '  x   1  ex

x0  0.5

7
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

f ( xn )
xn1 xn 
f ' ( xn )

xn  e xn
xn1  xn 
1  e xn

x1  0.5 
 0.5  e   0.56631
0.5

1  e  0.5

x2  0.56631 
 0.56631  e   0.56714
0.56631

1  e 
0.56631

x3  0.56714 
 0.56714  e   0.56714
0.56714

1  e 
0.56714

x4  0.56714

The required solution is x  0.5671 ( 4 decimal places ).

Example 2

Show that the equations 2 sin x  x  0 has a root between x  1 (radian) and x  2 (radian).
Find the root of the equation by using Newton Raphson method. Giving your answer
correct to two decimal places.

Solution

f (1)  2 sin 1  1  0.6829 (ve)


different signs
f (2)  2 sin 2  2  0.1814 (ve)

so , 2sin x – x = 0 has a root between x =1 and x = 2.

f  x   2sin x  x  f ’  x   2cos x –1

x0 = first approximation = 2

8
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

f ( xn )
xn1 xn 
f ' ( xn )

2 sin xn  xn
xn1 xn 
2 cos xn  1

2 sin 2  2
x1  2   1.90
2 cos 2  1

2 sin 1.90  1.90


x2  1.90   1.896
2 cos 1.90  1

2 sin 1.896  1.896


x3  1.896   1.895
2 cos 1.896  1

x4  1.895

The required solution is 1.90 ( two decimal places )

Example 3

Show that the equation x3  x  6  0 has a root between 1 and 2. Using the Newton-
Raphson method with the starting point 1.6 to determine an approximation to this root ,
giving your answer to three significant figures.

Solution

Let f  x   x3  x – 6

f (1)  13  1  6  4  0 (ve)
different signs
f (2)  2  2  6  4  0 (ve)
3

so , x3  x  6  0 has a root between x =1 and x = 2.

Newton- Raphson Method

9
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

Let f  x   x3  x – 6
So f '  x   3x 2  1

x0  1.6
xn3  xn  6
xn1  xn 
3xn2  1

x1  1.6 
1.6  1.6  6
3

 1.6350
31.6  1
2

x2  1.6350 
1.6350  1.6350  6
3

 1.6344
31.6350  1
2

x3  1.6344

So , to three significant figures the root is 1.63

Example 4

3
Use the Newton-Raphson Method to estimate 21 correct to four decimal places.

Solution :

If x  3 21 x 3  21  0 . Let f ( x)  x 3  21 . So, f ' ( x)  3x 2 (Because 3


82
and 3 27  3 , so root for 3 21 may lies between 2 and 3) f (2)  13 and f (3)  6 .Thus,
the root lies in between 2 and 3.
x 3  21
x0  2 xn1  xn  n 2
3 xn
23  21
x1  2   3.083333
3(2)
x2  2.791859
x3  2.759311
x4  2.758924
x5  2.758924
The last two value agree, correct to four decimal places. Therefore 3
21  2.7589

10
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

Example 5

Sketch the graph of y  e x and y  2  x where x  2 , on the same axes.


Get the first approximation, x0 for the equation e x  2  x where 0  x0  1 .
1
Hence, by using Newton-Raphson method , solve the equation of e  x 
2 x
For x  2 to three decimal places.

Solution :

Newton-Raphson method:

1
ex 
2 x
1
2  x  x
e
2  x  ex
ex  x  2  0

f ( x)  e x  x  2
f ' ( x)  e x  1

x0 = first approximation = 0.4 (from graph)

e xn  x  2
xn 1  xn 
e xn  1

 e0.4  2  0.4 
x1  0.4     0.4434
 e 1 
0.4

11
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

 e0.4434  2  0.4434 
x2  0.4434     0.4429
 e0.4434  1 

x4  0.4429

x5  0.4429

The required solution is 0.443 ( three decimal places)

Exercises:

1. By taking 0.2 as first approximation find the root of the equation


1
x 2   4  0 ,giving your answer to three significant figures by using the Newton
x
Raphson method.

Answer : 0.246

2. By taking x  2 as the first approximation, calculate using the Newton-Raphson


1
method for 7 3 correct to three significant figures.

Answer: 1.91

3. Show that there is a real root for cos x  x between x  0.5 radian and x  1 radian.
Hence, find the real root correct to four decimal places using Newton-Raphson
method.

Answer: 0.739

12
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

SUBTOPIC : 3.3 The Trapezium Rule

OBJECTIVES : The objectives of this lesson are to enable students to use the
b
trapezium rule to approximate  f ( x)dx
a
for n  4.

CONTENT

Introduction

e
x2
What happens when a mathematical function cannot be integrated ?. Example dx ,

 1  x 3 dx,....... In these cases a numerical method can be used to find an approximate


b
value for the integral. As the definite integral  f ( x)dx
a
is a number which represents the

area between y = f (x) , the x-axis and the lines x = a and x = b . Therefore , even if
b b


a
f ( x)dx cannot be found, approximate value for  f ( x)dx
a
can be found by evaluating the

appropriate area using another method. The two common methods are the trapezium rule
and Simpson’s rule. However, here we will discuss the trapezium rule as requested by our
syllabus.

The trapezium rule


This method divides the area A under the curve y  f (x) is into n vertical strips. The
width of each strip is h.
The area under the curve  sum of areas of n trapezia.

13
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

Let y0 , y1 , y2 ,….,yn1,yn be the values of the function f (x) . These correspond to the
n  1 ordinates x0 , x1 , x2 ,...., xn respectively. Using

1
Area of trapezium = ( width  sum of parallel sides )
2

The trapezoidal rule estimates the area under the curve as

 f ( x)dx  sum of the areas of trapeziums


a

y0  y1 y  y2 y  y3 y  yn
h h 1 h 2  .........  h n1
2 2 2 2
 1 1 
 h  y0  y1  y2  ....  yn1  yn 
2 2 

  y0  yn   2 y1  y2  .......  yn1 
h
2

ba
Where h  , n  number of strips (sub-interval) and y r  f ( x r )
n

14
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

Example 1
5
Evaluate  ln x dx using 4 strips by the trapezium rule.
1

Notation
Working must have 4 or more decimal places.

Solution

The integration interval ( b - a ) = 5 –1 = 4 units

ba 4
So h= = =1
n 4

The value of x at which y is calculated are :

1, 2, 3, 4, 5

Tabulating the results as follows help the final calculation :

x y First and last ordinates Remaining


ordinates
1 y0 0
2 y1 0.6931
3 y2 1.0986
4 y3 1.3863
5 y4 1.6094

Totals 1.6094 3.1780

5
h
 ln x dx
1

2
 ( y0 + y4) + 2 ( y1 +… + y3 )

1
=  1.6094 + 2 (3.178) 
2

= 3.9828

15
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

*** Note : We can calculate the values of y 0 , y1 , y 2 , y3 and y 4 from the table above
using scientific calculator.

Example :
Key in :

MODE 1 (COMP)
ALPHA Y = ln X
CALC ( X = ?)
1=0
CALC ( X = ?)
2 = 0.69314…
CALC ( X = ?)
3 = 1.09861….
CONTINUE THE PROCESS.

Example 2
0.8

e
x2
Use the trapezium rule, with five ordinates, to evaluate dx .
0

Correct your answer to three decimal places.

Solution

For five ordinates, ( yo , y1 , y2 , y3 , y4 ) evenly spaced in the range

0 ≤ x ≤ 0.8 , we need to divide this range into four equal parts

The integration interval ( b - a ) = 0.8 - 0 = 0.8 units

ba 0.8
So, h = = = 0.2
n 4

The value of x at which y is calculated are :

16
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

0 , 0.2, 0.4, 0.6 , 0.8

x y First and last ordinates Remaining


ordinates
0 y0 1
0.2 y1 1.0408
0.4 y2 1.1735
0.6 y3 1.4333
0.8 y4 1.8965

Totals 2.8965 3.6476

0.8
h
e dx   ( y0 + y4 ) + 2 ( y1 +… +y 3 ) 
x2

0
2
0 .2
=  2.8965 + 2 ( 3.6476 ) 
2

= 1.0192

= 1.019 (3 decimal places)


Example 3
5
Approximate  1  x dx by using trapezoidal rule with 4 strips (4 sub-intervals). Give
3
your answer correct to 4 decimal places.

Solution:

(Notation: Working must have 5 or more decimal places.)

ba 2
The integration interval ( b - a ) = 5 – 3 = 2 units. So, h =   0.5 . Value of xi at
n 4
which yi is calculated are x0 = 3, x1 = 3.5, x2 = 4, x3 = 4.5, x4 = 5.

Tabulating the results as follows help the final calculation :

y 1 x
xi
First and last ordinates Remaining ordinates
x0 = 3 y0  1  x0  1 3  2
x1 = 3.5 y1  1  x1  1  3.5  2.12132

17
MR. SANJAY A/L PRADEEP KUMAR Mathematics QS 025
Topic 3: Numerical Method

x2 = 4 y2  1  x0  1  4  2.23607
x3 = 4.5 y3  1  x3  1  4.5  2.34521
x4 = 5 y4  1  x4  1  5  2.44949
Total 4.44949 6.70260

Trapezoidal Rule:
5 h
 1  x dx   ( y0 + y4) + 2 ( y1 + y2+y3 )
3 2
0 .5
=  4.44949 + 2 ( 6.70260 ) 
2
= 4.4637 (4 decimal places)
Exercises:

1. Use the trapezium rule to estimate the value of

0 .4
(a) 0
( 1 - x 2 ) dx with 5 ordinates

Answer: 0.389

0 .6

xe
x
(b) dx with 7 ordinates
0
Answer: 0.273
2. correct your answer to three decimal places.
5

(c)  x ln x
3
dx with 4 sub-intervals

Answer: 11.1742
π
3

(d)  tan x
0
dx with 4 strips

Answer: 0.7098
π
2
(e) 
0
sinh x dx with 4 strips

Answer: 1.3893

correct your answer to four decimal places.

18

You might also like