Numerical Analysis
Numerical Analysis
If f(x) contains some other functions like Trigonometric, Logarithmic, exponential etc.
then f(x) = 0 is called a Transcendental equation.
Bisection Method:
This method is used in locating a root of the equation f(x) = 0 between a and b.
If f(x) is continuous between a and b, f(a) and f(b) are opposite in sign then exists a root between
a and b.
1
The first approximation to the root is x 1 (a b )
2
If f(x1) = 0 then x1 is the root of f(x)=0
If f(x1) is + ve then root lies between a and x1 and the second approximation to the root is
1
x2 (a x 1 )
2
Now if f(x2) is - ve then the root lies between x2 and x1 and the third approximation to the root is
1
x3 (x 2 x1 )
2
Fig.
1. Solve x3 - 9x + 1 = 0 for the root lying between 2 and 3 using bisection method in six stages.
Answer:
f(x) = x3 - 9x + 1 = 0
f(2) =-9 -ve
f(3) = 55 +ve
23
x1 2.5
2
f ( x 1 ) 5.8 ve
Let x0 and x1 be two points such that f(x0) and f(x1) are opposite in sign.
( x a ) 2 ''
f ( x ) f (a ) ( x a ) f (a )
'
f (a ) .....
2!
1. Using Newton's Raphson Method find the real root of x log10 x = 1.2 correct to four
decimal places.
Answer:
Let f(x) = x log10 x - 1.2
f(1) = -1.2, f(2) = -0.59794, f(3) = 0.23136
x log e x 1 log e x
We have f ( x ) 1 .2 f ' ( x )
log e 10 log e 10
log10 e log10 x
x k log10 x k 1.2
x k 1 x k
log10 e log10 x K
Let x0 = 2.5 (you may choose 2 or 3 also)
2.5 log10 2.5 1.2
x 1 2 .5 2.7465
log10 e log10 2.5
2.7465 log 2.7465 1.2
x 2 2.7465 2.7406
log10 e log10 2.7465
Repeating the procedure
x 3 2.7406
x 2.7406 is the root of the given equation
2.Using Newton's Method, find the real root of xex = 2. Correct to 3 decimal places.
Answer:
Let f(x) = xex - 2
f(0) = -2
f(1) = e - 2 = 0.7182
Let x0 = 1
f' (x) = (x + 1) ex
We have
x k e xk 2
x k 1 x k
( x k 1) e x k
e2
x1 1 0.8678
2e
(0.8678 ) e 0.8678 2
x 2 0.8678 0.8527
(1.8678 ) e 0.8678
(0.8527 ) e 0.8527 2
x 3 0.8527 0.8526
(1.8527 ) e 0.8527
3. Find by Newton's Method the real root of 3x = cosx + 1 near 0.6, x is in radians.
Correct for four decimal places.
Answer:
Let f(x) = 3x - cosx - 1
f'(x) = 3 + sinx
3x k cos x k 1
x k 1 x k
3 sin x k
3 (0.6) cos (0.6) 1
When x 0 0.6 x 1 0.6 0.6071
3 sin (0.6)
3 (0.6071) cos (0.6071) 1
x 2 0.6071 0.6071
3 sin (0.6071)
Since x1 = x2
The desired root is 0.6071
4. Obtain the iterative formula for finding the square root of N and find 41
Answer:
Let x N
or x2 - N = 0
f(x) = x2 - N
f'(x) = 2x
Now
x 2k N
x k 1 x k
2x k
xk N
xk
2 2x k
1 N
i.e. x k 1 x k
2 xk
To find 41
Observe that 36 41
Choose x 0 6
1 41
x1 6 6.4166
2 6
1 41
x2 6.4166 6.4031
2 6.4166
1 41
x3 6.4031 6.4031
2 6.4031
Since x2 = x3 = 6.4031
The value of 41 6.4031
5. Obtain an iterative formula for finding the p-th root of N and hence find (10)1/3
correct to 3 decimal places.
Answer:
Let xp = N
or xp - N = 0
Let f(x) = xp - N
f ' ( x ) px p 1
x pk N
Now x k 1 x k
px pk 1
Observe that 8 < 10
81 / 3 101 / 3
i.e. 2 (10)1 / 3
Use x0 = 2, p = 3, N=10
2 3 10
x1 2 2.1666
3 (2 2 )
(2.1666) 3 10
x 2 2.1666 2.1545
3(2.1666) 2
(10)1 / 3 2.1544
6. Obtain an iterative formula for finding the reciprocal of p-th root of N. Find (30)-1/5
correct to 3 decimal places.
Answer:
Let x -p = N
or x -p - N = 0
f(x) = x -p - N
f'(x) = -px -p - 1
Now
p
xk N
x k 1 x k
p 1
p xk
1
sin ce (32)1 / 5 0.5
2
We use x0 = 0.5, p = 5, N = 30
(0.5) 5 30
x 1 0 .5 0.50625, Re peating the process
5(0.5) 6
x 2 0.506495, x 3 0.506495
(30) 1 / 5 0.5065
proof not read
Finite Differences
Let y = f(x) be represented by a table
x: x0 x1 x2 x3 …. xn
y: y0 y1 y2 y3 … yn
where x0, x1,x2….xn are equidistant. (x1 - x0 = x2 - x1 = x3 - x2 =….=xn - xn-1 = h)
We now define the following operators called the difference operators.
y r y r 1 y r , r 0,1, 2,..., n 1
y 0 y1 y 0
y1 y 2 y1
. first forward differences
.
y n 1 y n y n 1
Now 2 y 0 (y 0 ) ( y1 y 0 )
y1 y 0 ( y 2 y1 ) ( y1 y 0 )
y 2 2 y1 y 0
||| ly 2 y1 y 3 2 y 2 y1
2 y r y r 2 2 y r 1 y r
Note : 3 y 0 y 3 3y 2 3y1 y 0
k y r y r k k C1 y r k 1 k C 2 y r k 2 .... (1) k C r
Form the difference table and find f (10), 2 f (10), 3 f (20), 4 f (15)
x y 2 3 4 5
10 19.97
1.54
15 21.51 -0.58
0.96 0.67
20 22.47 0.09 -0.68
1.05 -0.01 0.72
25 23.52 0.08 0.04
1.13 0.03
30 24.65 0.11
1.24
35 25.89
x y y y y y
1 4
9
2 13 12
21 6
3 34 18 0
39 6
4 73 24
63
5 136
2. Given
x 0 1 2 3 4
f(x) 4 12 32 76 156
Construct the difference table and write the values of f (4), 2f (4), 3f (3)
x y y 2y 3y
0 4
8
1 12 12
20 12
2 32 24
44 12
3 76 36
80
4 156
Note 1:
y1 / 2 y1 y 0 y 0 y1
y 3 / 2 y 2 y1 y1 y 2
y n 1 / 2 y n y n 1 y n 1 y n
Note 2:
y 3 / 2 y1 / 2 2 y1
y 5 / 2 y 3 / 2 2 y 2
y 7 / 2 5 / 2 2 y 3
Note 3: We have
h h
f (x ) f x f x
2 2
Note 4: Central difference table
1. Show that:
i) 2 y 5 y 6 2 y 5 y 4
2 y 5 y11 / 2 y 9 / 2
y11 / 2 y 6 y 5
y 9 / 2 y 5 y 4
Now 2 y 5 y11 / 2 y 9 / 2
(y6 y5 ) (y5 y 4 )
y 6 2y 5 y 4
2 y 0 y1 / 2 y 1 / 2
y1 / 2 y1 y 0
y 1 / 2 y 0 y 1
2 y 0 y1 / 2 y 1 / 2
( y1 y 0 ) ( y 0 y 1 )
y1 2 y 0 y1
2. Given f(-2) = 12, f(-1) = 16, f(0) = 15, f(1) = 18, f(2) = 20
form the central difference table and write down the values of y-3/2, 2y0, 3y1/2 by
taking x0 = 0
x y y 2y 3y 4y
-2 y-2 12
y-3/2 4
-1 y-1 16 2y1 -5
y-1/2 -1 3y-1/2 9
0 y0 15 2y0 4 4y0 -14
y1/2 3 3y1/2 -5
1 y1 18 2y1 -1
y3/2 2
2 y2 20
y 3 / 2 4, 2 y 0 4, 3 y1 / 2 5
|| ly 2 (E 1) 2 f ( x )
n (E 1)n f (x )
n y 0 y n n C1 y n 1 n C 2 y n 2 .... (1) n y 0
Note 2:
f (x) f (x) f (x h)
1
f ( x ) f ( x ) f (x)
E
1 E 1
1 .
E E
1. Show that
i) 6 y 0 y 6 6 y 5 16 y 4 20 y 3 15 y 2 6 y1 y 0
ii) 3 y 2 y 5 3y 4 3y 3 y 2
f ( x 1) ( x 1) 3 6( x 1) 2 11( x 1) 6
f ( x ) f ( x 1) f ( x ) 3x 2 15x 18
2 f ( x ) f ( x 1) f ( x )
3( x 1) 2 15( x 1) 18 3x 2 15x 18
= 6x + 18
3. If f(x) = eax show that f(0) and its leading differences form a G.P
f(x) = eax
f(0) = e0 = 1
f ( x ) e ax ah e ax e ax (e ah 1)
2 f ( x ) (e ah 1) (e a ( x h ) e ax )
(e ah 1) (e ah 1) . e ax (e ah 1) 2 e ax
n f ( x ) (e ah 1) n e ax
which is in GP where first term = ea(0) = 1
Common ratio eah - 1
xhx
tan 1
1 ( x h ) x
h
tan 1 2
x hx 1
xh
log
x
h
log 1
x
2 x 3 2
5. Evaluate i) ii) e 2 choose h = 1
Ex 3 E
Answer:
[( x 1) 3 x 3 ]
( x 1) 3
6
( x 1) 2
ii) 2 e x (e x 1 e x )
e e x e x
(e 1) e x
(e 1) {e x 1 e x }
(e 1) (e x ) (e 1) (e 1) 2 e x
Method 2:
(E - 1)4 y0 = 0
y4 - 4E3y0 + 6E2y0- 4Ey0 + y0 = 0
y4 - 4y3 + 6y2 - 4y1 + y0 = 0 y3 = 31
We carryout upto the stage where we get two entries ( 2 unknowns) and equate each of
those entries to zero. (Assuming) to be a polynomial of degree 2.
b + 3a - 200 = 0
-3b - a + 408 = 0
We get a = 24 b = 128
Method 2:
Given 3 set of values
Assume 3u0 = 0
u 3 3 E 2 u 0 3 Eu 0 u 0 0
u 3 3u 2 3u 1 u 0 0
i.e., u 4 3u 3 3u 2 u 1 0
b 3(64) 3a 8 0
3a b 200 0
u 5 3u 4 3u 3 u 2 0
216 3b 3(64) a 0
3b a 408 0
a 3b 408 0
Solving we get a = 24, b = 128
Answer: a = 8.25