You are on page 1of 3

Lecture 31 (Marks-05)

Evaluate the integral


4

 x dx
2

Using Trapezoidal rule

Take h=1

The table of values is given by

x 0 1 2 3 4
f(x) 0 1 4 9 16

Now applying the Trapezoidal rule, we have

4
h

0
x 2 dx   y0  2  y1  y2  y3   y4 
2
1
  0  2  1  4  9   16 
2
1
  44
2
 22

Lecture 32-35 (Marks-05)

Evaluate the integral


4

 ( x  1)dx
0

Using Simpson’s 1/3 rule.

Take h=1

Solution:

The table of values is given by


x 0 1 2 3 4
F(x) -1 0 1 2 3

Now applying the Simpson’s 1/3 rule, we have

4
h

0
( x  1) dx   y0  4  y1  y3   2 y2  y4 
3
1
  1  4  0  1  2(2)  3
3
1
  10
3
 3.3333

Lecture 36 (Marks-05)
Use Euler’s method to approximate y when x=1, given that

dy y  3x
 , y (0)  1,taking h  0.5
dx y  3x

dy y  3x
 , y (0)  1,taking h  0.5
dx y  3x
x0  0, y0  1
y1  y0  hf ( x0 , y0 )
1  3(0)
 1  (0.5)  
1  3(0)
y2  y1  hf ( x1 , y1 )
1.5  3(0.5)
 1.5  (0.5)  
1.5  3(0.5)
So y cant be approximated after 1st iteration.

Lecture 37 (Marks-05)
Use Runge-Kutta Method of order four to find the values of k1 , k2 , k3 and k4 for the initial
value problem
y /  y  x, y (0)  2 taking h=0.1
Solution:
The Fourth-Order Runge-Kutta Method is described as :-
1
yn 1  yn   k1  2k2  2k3  k4 
6

where,

k1  hf  xn , yn 
 h k 
k2  hf  xn  , yn  1 
 2 2
 h k 
k3  hf  xn  , yn  2 
 2 2
k4  hf  xn  h, yn  k3 
Now

k1  0.2
k2  0.205
k3  0.20525
k4  0.210525
and
1
y1  y0  ( k1  2k2  2k3  k4 )
6
 2.20517

You might also like