Professional Documents
Culture Documents
Numerical Integration
Numerical Integration
Trapezoidal Rule
Simpson’s 1/3 rule
Simpson’s 3/8 rule
11/8/2022 8:08:08 PM
Gauss Quadrature Method1
Numerical Integration
b
The problem of numerical integration is to evaluate f x dx
a
The problem arises when the integrand f x is not integrable or
f x is known at only at finite number of points.
2
11/8/2022 8:08:08 PM
Trapezoidal Rule
b
The evaluation of integrand I f x dx by trapezoidal rule is geometrically
a
equivalent to approximating the area under straight line connecting f a and f b .
ba
Here h , where n is the no. of sub intervals.
n
3
11/8/2022 8:04:25 PM
Example:-
1
Evaluate I= e x2
dx with n=10 by using Trapezoidal rule.
0
1
Ans :
Given that I= e x2
dx. i.e. f ( x) e x2
a 0, b 1 and n 10.
0
b a 1 0
So h 0.1.
n 10
Now using interval [a, b] [0,1] with h 0.1, we have the following table:
x: x0 x1 x2 x3 x4 x5
x: 0 0.1 0.2 0.3 0.4 0.5
f ( x) : 1 0.99005 0.96079 0.91393 0.85214 0.7788
4
11/8/2022 8:04:25 PM
Continue..
x: x6 x7 x8 x9 x10
x: 0.6 0.7 0.8 0.9 1.0
f ( x) : 0.69768 0.61263 0.52729 0.44485 0.36788
I 0.74621
5
11/8/2022 8:04:25 PM
Simpson’s 1/3 rule:
b
The Simpson’s one-third rule for integration f x dx is given by
a
ba
Here h , where n is the no. of sub intervals.
n
Note:-
The Simpson’s 1/3 rule requires the interval a, b to be divided into an
even number of subintervals of width h.
i.e. n should be even.
6
11/8/2022 8:04:25 PM
Example:-
1
Evaluate I= e x2
dx with n=10 by using Simpson's 1/3 rule.
0
1
Ans :
Given that I= e x2
dx. i.e. f ( x) e x2
a 0, b 1 and n 10.
0
b a 1 0
So h 0.1.
n 10
Now using interval [a, b] [0,1] with h 0.1, we have the following table:
x: x0 x1 x2 x3 x4 x5
x: 0 0.1 0.2 0.3 0.4 0.5
f ( x) : 1 0.99005 0.96079 0.91393 0.85214 0.7788
7
11/8/2022 8:04:25 PM
Continue..
x: x6 x7 x8 x9 x10
x: 0.6 0.7 0.8 0.9 1.0
f ( x) : 0.69768 0.61263 0.52729 0.44485 0.36788
I 0.746924
8
11/8/2022 8:04:26 PM
Simpson’s 3/8 rule:
b
The Simpson’s 3/8 rule for integration f x dx is given by
a
f x0 f xn
3h
b
I f x dx 3 f x1 f x2 f x4 f x5 .... f xn1
8
2 f x3 f x6 f x9 .... f xn3
a
ba
Here h , where n is the no. of sub intervals.
n
Note:-
The no. of sub intervals for Simpson’s 3/8 rule should be
taken as multiples of 3.
9
11/8/2022 8:04:26 PM
Example:-
2
Evaluate I= cos d by using simpson's 3/8 rule with n=6.
0
Ans:- Given that f cos and a 0 and b .
2
ba
So h= .
n 12
: 0 1 2 3 4 5 6
5
: 0
12 6 4 3 12 2
f : 1 0.9828 0.9306 0.8409 0.7071 0.5087 0
2
3
I= cos d = 1 0 3 0.9828 0.9306 0.7071 0.5087 2 0.8409
0
8 12
I 1.18491
10
11/8/2022 8:04:26 PM
Gauss Quadrature Method
Gauss quadrature is another method of evaluation of integral
b
f ( x)dx.........................(1)
a
1
in stanadard form
1
f ( x)dx.........................(2)
After transfering the given integral to standard form we can use the
Gauss quadrature formulas as follow
12
11/8/2022 8:09:11 PM
Continue…
Two-point Gauss Legendre formula:-
1 1
1
I f ( x)dx f f
1 3 3
1
5 3 8 5 3
I f ( x)dx f f 0 f
1
9 5 9 9 5
13
11/8/2022 8:09:11 PM
Example:-
3
Obtain the integral xe x dx using Two, Three-Point Gauss-Legendre formula.
0
Ans:- 3
Given integral is I= xe x . This is not in standard form.
0
dx 1.5dt
3 1 1
I 2.25 t 1 e
1.5t 1.5
I xe x dx 1.5t 1.5 e
1.5t 1.5
1.5dt dt 2.25* I1
0 1 1
1
Here I1 t 1 e dt and f (t ) t 1 e
1.5t 1.5 1.5t 1.5
1
14
11/8/2022 8:09:11 PM
Continue…
So by Gauss-Legendre two point formulas, we have
1 1
1
I1 t 1 e 1.5t 1.5
dt f f
1 3 3
1 1
1 1.5 1 1 1.5 1
I1 1 e 3
1 e 3
3 3
15
11/8/2022 8:09:11 PM
Continue..
Similarly by Gauss-Legendre three point formulas, we have
1
5 3 8 5 3
I1 t 1 e 1.5t 1.5
dt f f 0 f
1
9 5 9 9 5
16
11/8/2022 8:09:11 PM
Make Presentation much more fun
11/8/2022 8:04:26 PM 17