You are on page 1of 2

Finding a Definite Integral Numerically 5 Ways & Compared to the AntiDerivative

Integral =

x2 + 1 dx

from 1 to 3
|

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

x
1.00
1.10
1.20
1.25
1.30
1.40
1.50
1.60
1.70
1.75
1.80
1.90
2.00
2.10
2.20
2.25
2.30
2.40
2.50
2.60
2.70
2.75
2.80
2.90
3.00

x
1
1.21
1.44
1.6
1.69
1.96
2.25
2.56
2.89
3.1
3.24
3.61
4
4.41
4.84
5.1
5.29
5.76
6.25
6.76
7.29
7.6
7.84
8.41
9

x +1
2
2.21
2.44
2.6
2.69
2.96
3.25
3.56
3.89
4.1
4.24
4.61
5
5.41
5.84
6.1
6.29
6.76
7.25
7.76
8.29
8.6
8.84
9.41
10

Let n = # of intervals ; p = # of points


1) Reimann
n=4, p=4
I=
[ delta x ] [ sum of f(x)]
I=
[ 2 / 4 ] [ f(1)+ f(1.5) + f(2.0) + f(2.5) ]
I=
[ 0.5 ] [
2 + 3.25 + 5 + 7.25 ]
I=
[ 0.5 ] [ 17.5 ]
I=
8.75
Underestimated

2) Midpoint
I=
[ delta x ]
I=
[ 0.5 ] [
I=
[ 0.5 ] [
I=
[ 0.5 ] [
I=
11.2

n=4;p=4
[ sum of f ( {x1 + x2} / 2 ) ]
f(1.25) + f(1.75) + f(2.25) + f(2.75) ]
2.6 + 4.1 + 6.1 + 8.6 ]
22.4]
Better approximation

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

Summary for p = 4 points


Reimann
Midpoint
Trapezoid
Simpson
Averaging
AntiDerivative

8.75
11.2
10.75
10.669
8.75
10.67

AntiDerivative yields the exact answer


Simpson is nearly perfect with only 4 points
Trapezoid is also very good with 4 points
Averaging required more points for good result
Averaging is nearly identical to Reimann
Averaging with 21 points improves result to 10.73
Conclusions
More points improves accuracy
One can get as accurate as necessary with
more work calculating more points.
Better method requires fewer points & work
Computers can do the work so numerical
methods are practical and used frequently
-------------------------------------------------------

3) Trapezoid Method
n=4;p=5
I=
[ delta x / 2] [ f( x1) + 2 f(x2) + 2 f (x3) + 2 f (x4) + f (x5) ]
I=
[ delta x / 2] [ f( 1) + 2 f(1.5) + 2 f (2.0) + 2 f (2.5) + f ( 3.0 ) ]
I=
[ 0.5 / 2 ] [ 2 + 2 x 3.25 + 2 x 5 + 2 x 7.25 + 10 ]
I=
[ 0.25 ] [ 43 ]
I=
10.75
Good approximation

P.Freda
8/14/2011
Assumption College

Integral =

x2 + 1 dx

from 1 to 3
Let n = # of intervals ; p = # of points

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
21
11
9

x
1.00
1.10
1.20
1.25
1.30
1.40
1.50
1.60
1.70
1.75
1.80
1.90
2.00
2.10
2.20
2.25
2.30
2.40

x
1
1.21
1.44
1.6
1.69
1.96
2.25
2.56
2.89
3.1
3.24
3.61
4
4.41
4.84
5.1
5.29
5.76

x +1
2
2.21
2.44
2.6
2.69
2.96
3.25
3.56
3.89
4.1
4.24
4.61
5
5.41
5.84
6.1
6.29
6.76

2.50
2.60
2.70
2.75
2.80
2.90
3.00

6.25
6.76
7.29
7.6
7.84
8.41
9

7.25
7.76
8.29
8.6
8.84
9.41
10

42.00 91.70
22.00 48.40
41.40 178.70

112.70
59.40
218.70

4) Simpson's Method
n=4 ; p=5
I=
[ delta x / 3 ] [ f( x1) + 4 f(x2) + 2 f (x3) + 4 f (x4) + f (x5) ]
I=
[ delta x / 3 ] [ f( 1) + 4 f(1.5) + 2 f (2.0) + 4 f (2.5) + f ( 3.0 ) ]
I=
[ 0.5 / 3 ] [ 2 + 4 x 3.25 + 2 x 5 +
4 x 7.25 +
10 ]
I=
[ 0.1667 ] [ 64 ]
I=
10.669
Exact approximation ! !
Simpson yields EXACT result for f(x) of degree 3 or less
5) Averaging Method ; 4 Points
n=4;p=4
Averaging Method All 21 Points
I=
[ n delta x ] [ Average value of f(x) ]
I = 2 x ( 112.7 / 21 )
I=
[ 4 x 0.5 ] [ { f(1)+ f(1.5) + f(2.0) + f(2.5) } / 4 ]
I = 10.733
I=
[ 2 ] [ { 2 + 3.25 + 5 + 7.25 } / 4 ]
I=
2 x 4.375
I=
8.75
Identical to Reimann with only 4 points --- underestimated
But with 21 points the estimate is much improved to 10.733
6) Antiderivative and 2nd Fundamental Theorem
The Antiderivative F (x) = ( 1/3 ) x 3 + x + C
I=
I=
I=
I=

F (x) evaluated between 3 and 1


F(3) - F(1)
12 - 4/3
10.67
Exact Value

==> according to The 2nd Fundamental Theorem of Calculus

Numerical Solution Methods will always provide a result when AntiDifferentiation fails
P.Freda
8/14/2011
Assumption College

You might also like