You are on page 1of 6

4.

6
Numerical Integration

Trapezoidal Rule Area of a Trapezoid


b2

Area  hb1  b2 
1 h
2
b1

b1 b2

h
We are going to sum up
n trapezoids from a to b.

Let’s let n = 4
(4 trapezoids)

ba
h
n
a h b Now we need to find the
x0 x1 x2 x3 x4 sums of the area of these
four trapezoids.
ba
A  f x0   f x1 
2n simplified to
ba ba
  f x1   f x2   ...   f x3   f x4 
2n 2n
ba
  f x0   2 f x1   2 f x2   ...  2 f xn1   f xn 
2n
b
 lim
n   f ( x)dx
a

The bigger n you use, the more accurate your answer


will be.
Use the Trapezoidal Rule to approximate

 sin xdx
0
Let n  4 1

ba  0
h 
n 4
0
  3 
4 2 4
       3  
Area   f 0  2 f    2 f    2 f    f  
(2)4  4 2  4  
   2  2 
  21  2
 0  2 
  0
 2    1.896
8   2    
Simpson’s Rule

n is even

b  a  f ( x0 )  4 f ( x1 )  2 f ( x2 )  4 f ( x3 )
b


a
f ( x)dx 
3n 
 ...  4 f ( x )  f ( x )
n 1 n

Note: The coefficients in Simpson’s Rule have the following


pattern

1 4 2 4 2 4 … 4 2 4 2 4 1

 sin x
Ex.
dx
0

Let n = 4

0   3 
4 2 4

    3 
0 sin x dx  34 sin 0  4 sin 4  2 sin 2  4 sin 4  sin  


12
02 2 22 2 0   2.005

 sin xdx  cos x 



if n = 8 Ans.  2.0003 0
2
0

You might also like