Title: Numerical Integration Intended Learning Outcomes:: A = f (x) dx≈ Δx 2 (f (x) +2 f (x) +2 f (x) +... +2 f (x) +f (x) )

You might also like

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

Title : Numerical Integration

Intended Learning Outcomes : At the end of this lesson, you should be able to :
1. Determine an area under a curve using the trapezoidal rule
2. Determine an area under a curve using the Simpsons 1/3 rule

Discussions :
1. Trapezoidal Rule

The area A bounded the curve f(x) between limits x = a and x =b is


b Δx
A=∫a f (x )dx ≈ [f( xo )+2 f ( x1 )+ 2 f (x 2)+...+2 f( x n +1)+f( x n )]
2
where Δx = (b - a )/n

Illustrative problem 1. Estimate the area under the curve f(x) = x2 +sin (x) within the limits x = 1
and x= 4. Use the trapezoidal rule. Use n = 6.

18.0000

16.0000

14.0000

12.0000

10.0000

8.0000

6.0000

4.0000

2.0000

0.0000
0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5

Solution :

Numerical Integration page 1 of 3


1. Fill-in the table

x f(x)
1.0 1.8415
1.5 3.2475
2.0 4.9093
2.5 6.8485
3.0 9.1411
3.5 11.8992
4.0 15.2432

2. Apply the trapezoidal rule


Δx = (b - a )/n = (4-1)/6 = 0.5

A ≈ (0.5/2) [1.8415 + 15.2432 + 2(3.2475 +4.9093+6.8485+9.1411+11.8992)]


A ≈ (0.25) [1.8415 + 15.2432 + 2(36.0456)] = 22.2940 sq. unit

3. Verify Results
A = 22.1940 (using calculator )
%Error = |22.1940 – 22.2940| / 22.1940 x 100% = 0.45%

2. Simpsons 1/3 rule


b Δx
A=∫a f (x )dx ≈ [f( xo )+4 [f ( x1 )+f ( x 3)+f ( x 5)+...]+2 [f (x 2)+ f(x 4 )+f ( x 6)+...]+ f ( xn )]
3
note : n must be even and greater than 2

Illustrative problem 1. Estimate the area under the curve f(x) = x 2 + sin (x) within the limits x = 1
and x= 4. Use the Simpson's 1/3 rule. Use n = 6.
Solution :
1. Fill-in the table (n must be even)

x f(x) W
1.0 1.8415 1
1.5 3.2475 4
2.0 4.9093 2
2.5 6.8485 4
3.0 9.1411 2
3.5 11.8992 4
4.0 15.2432 1

2. Apply the Simpson's 1/3 rule


Δx = (b - a )/n = (4-1)/6 = 0.5

A ≈ (0.5/3) [1.8415 + 15.2432 + 2(3.2475 + 6.8485 +11.8992) + 4(4.9093 +9.1411)]


A ≈ (0.5/3) [1.8415 + 15.2432 + 4(21.9952) + 2(14.0504)] = 22.1944 sq. unit

3. Verify Results
%Error = |22.1940 – 22.1944| / 22.1940 x 100% = 0.002%

Numerical Integration page 2 of 3


Self Assessment(Problem Set) :

P1. Estimate the area under the curve f(x) = 2x3 - 2sin (x) within the limits x = 1 and x = 3. Use the
Trapezoidal Rule. Use n = 6.

P2. Estimate the area under the curve f(x) = 2x3 - 2sin (x) within the limits x = 1 and x = 3. Use the
Simpson's 1/3 rule. Use n = 6.

References :
1. Applied Numerical Methods with MATLAB for Engineers and Scientist
Steven C. Chapra, McGraw Hill International Edition c.2005

2. Elementary Numerical Analysis 3rd Edition


Kendall Atkinson &Weimin Han, John Wiley and Sons c.2004

3. Numerical Methods for Engineers 5th Edition


Steven C. Chapra & Raymond P. Canale, McGraw Hill International Edition c.2006

Numerical Integration page 3 of 3

You might also like