Int 1 Merged

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

= [ 𝑒 2 − 0]

= 7.389
𝑥−3
(4) 𝑦 = ,4≤𝑥≤9
√𝑥

Solution:
1 𝑏
𝑀= ∫ 𝑓(𝑥) 𝑑𝑥
𝑏−𝑎 𝑎

1 9 𝑥−3
= ∫4 𝑑𝑥
9−4 √𝑥

1 9 𝑥 3
= ∫4 ( √𝑥 − √𝑥 ) 𝑑𝑥
5

1 9 3
= ∫4 ( √𝑥 − √𝑥 ) 𝑑𝑥
5

3
1 2 9
= [ 𝑥 2 − 6 √𝑥 ]
5 3 4
1 2 2
= [( ∗ 27 − 6 ∗ 3) − ( ∗ 8 − 6 ∗ 2)]
5 3 3

1 −20
= [0 − ( )]
5 3

4
=
3

4-6 Approximating Definite Integrals


The methods of the last few sections allow us to get exact answers for
definite integrals in a variety of cases. However, many functions do
not have elementary antiderivatives. To evaluate the definite integrals
of such functions, we cannot use the Fundamental Theorem; we must
use numerical methods.
We will develop all three methods for estimating

Midpoint Rule

We will divide the interval [𝒂, 𝒃] into 𝒏 subintervals of equal width,


𝒃−𝒂
ℎ=
𝒏

- 101 -
We will denote each of the intervals as follows,
[𝑥0 , 𝑥1 ], [𝑥1 , 𝑥2 ], … , [𝑥𝑛−1 , 𝑥𝑛 ] where 𝑥0 = 𝑎 and 𝑥𝑛 = 𝑏

Then for each interval let 𝒙∗𝒊 be the midpoint of the interval. We then
sketch in rectangles for each subinterval with a height of 𝒇(𝒙∗𝒊 ).

We can easily find the area for each of these rectangles and so for a
general 𝑛 we get that,

𝑏
∫𝑎 𝑓(𝑥) 𝑑𝑥 ≈ ℎ 𝑓(𝑥1∗ ) + ℎ 𝑓(𝑥2∗ ) + ⋯ + ℎ 𝑓(𝑥𝑛∗ )

We get the general Midpoint Rule.

𝑏
∫𝑎 𝑓(𝑥) 𝑑𝑥 ≈ ℎ ൤𝑓(𝑥1∗ ) + 𝑓(𝑥2∗ ) + ⋯ + 𝑓(𝑥𝑛∗ )൨

Trapezoid Rule

We will break up the interval [𝒂, 𝒃] into 𝒏 subintervals of width,


𝒃−𝒂
ℎ=
𝒏

- 102 -
Then on each subinterval we will approximate the function with a
straight line that is equal to the function values at either endpoint of
the interval.

Each of these objects is a trapezoid (hence the rule's name…) and as


we can see some of them do a very good job of approximating the
actual area under the curve and others don’t do such a good job.

The area of the trapezoid in the interval [𝑥𝑖−1 , 𝑥𝑖 ] is given by,



𝐴𝑖 = [ 𝑓(𝑥𝑖−1 ) + 𝑓(𝑥𝑖 )]
2

So, if we use 𝒏 subintervals the integral is approximately,


𝑏 ℎ ℎ
∫𝑎 𝑓(𝑥) 𝑑𝑥 ≈ [ 𝑓(𝑥0 ) + 𝑓(𝑥1 )] + [ 𝑓 (𝑥1 ) + 𝑓(𝑥2 )] + ⋯ +
2 2

[ 𝑓(𝑥𝑛−1 ) + 𝑓(𝑥𝑛 )]
2

Upon doing a little simplification we arrive at the general Trapezoid


Rule.
𝑏 ℎ
∫𝑎 𝑓(𝑥) 𝑑𝑥 ≈ ൤𝑓 (𝑥0 ) + 2 𝑓(𝑥1 ) + ⋯ + 2 𝑓(𝑥𝑛−1 ) + 𝑓(𝑥𝑛 )൨
2

Note that all the function evaluations, with the exception of the first
and last, are multiplied by 2.

- 103 -
Simpson’s Rule

This is the final method we’re going to take a look at and in this case
we will again divide up the interval [𝒂, 𝒃] into 𝑛 subintervals
. However unlike the previous two methods we need to require
that 𝑛 be even. The reason for this will be evident in a bit. The width
of each subinterval is,
𝒃−𝒂
ℎ=
𝒏

For Simpson’s Rule we are going to approximate the function with a


quadratic and we’re going to require that the quadratic agree with
three of the points from our subintervals. Each of the approximations
is colored differently so we can see how they actually work.

Notice that each approximation actually covers two of the


subintervals. This is the reason for requiring 𝒏 to be even. Some of
the approximations look more like a line than a quadratic, but they
really are quadratics. Also note that some of the approximations do
a better job than others. It can be shown that the area under the
approximation on the interval [𝑥𝑖−1 , 𝑥𝑖 ] and [𝑥𝑖 , 𝑥𝑖+1 ] is,

𝐴𝑖 = [ 𝑓(𝑥𝑖−1 ) + 4 𝑓(𝑥𝑖 ) + 𝑓(𝑥𝑖+1 )]
3

If we use 𝒏 subintervals the integral is then approximately,


𝑏 ℎ
∫𝑎 𝑓(𝑥 ) 𝑑𝑥 ≈ [ 𝑓(𝑥0 ) + 4 𝑓(𝑥1 ) + 𝑓(𝑥2 )] +
3

- 104 -

[ 𝑓(𝑥2 ) + 4 𝑓(𝑥3 ) + 𝑓(𝑥4 )] + ⋯ +
3

[ 𝑓(𝑥𝑛−2 ) + 4 𝑓(𝑥𝑛−1 ) + 𝑓(𝑥𝑛 )]
3

We arrive at the general Simpson’s Rule.

𝑏 ℎ
∫𝑎 𝑓(𝑥) 𝑑𝑥 ≈ ൤𝑓 (𝑥0 ) + 4 𝑓(𝑥1 ) + 2 𝑓(𝑥2 ) + ⋯ +
3

2 𝑓(𝑥𝑛−2 ) + 4 𝑓 (𝑥𝑛−1 ) + 𝑓(𝑥𝑛 )൨

In this case notice that all the function evaluations at points with odd
subscripts are multiplied by 4 and all the function evaluations at
points with even subscripts (except for the first and last) are
multiplied by 2. If you can remember this, this is a fairly easy rule to
remember.

Note: Error = |Approximation − Exact integral |


Example 4.38 Using 𝑛 = 4 and all three rules to approximate the
2 2
value of the following integral: ∫0 𝑒 𝑥 𝑑𝑥
Solution: Mathematic gives the following value for this integral.
2 2
∫0 𝑒 𝑥 𝑑𝑥 = 16.4526
𝑏−𝑎 2−0
∵ 𝑛 = 4, 𝑎 = 0 , 𝑏 = 2 ℎ= = = 0.5
𝑛 4

The subintervals will be,∴


[0,0.5], [0.5,1], [1,1.5], [1.5,2].

Midpoint Rule

We construct the following chart.


𝑥𝑖∗ 0.25 0.75 1.25 1.75
- 105 -
∗ 2
𝑓 (𝑥𝑖∗ ) = 𝑒 (𝑥𝑖 ) 1.0645 1.7551 4.7707 21.3809
2 2
∫0 𝑒 𝑥 𝑑𝑥 ≈ ℎ ൤𝑓(𝑥1∗ ) + 𝑓(𝑥2∗ ) + 𝑓(𝑥3∗ ) + 𝑓(𝑥4∗ )൨

≈ 0.5 ൤1.0645 + 1.7551 + 4.7707 + 21.3809൨

= 14.4856
Error = |14.4856 − 16.4526| = 1.967

We construct the following chart.


𝑥𝑖∗ 0 0.5 1 1.5 2
∗ 2
𝑓(𝑥𝑖∗ ) = 𝑒 (𝑥𝑖 ) 1 1.2840 2.7183 9.4877 54.5982

Trapezoid Rule

2 2 ℎ
∫0 𝑒 𝑥 𝑑𝑥 ≈ 2 ൤𝑓(𝑥0 ) + 2 (𝑓(𝑥1 ) + 𝑓(𝑥2 ) + 𝑓(𝑥3 )) + 𝑓(𝑥4 )൨
0.5
≈ ൤1 + 2 (1.2840 + 2.7183 + 9.4877) + 54.5982൨
2

= 20.6446
Error = |20.6446 − 16.4526 | = 4.192

Simpson’s Rule

2 2 ℎ
∫0 𝑒 𝑥 𝑑𝑥 ≈ 3 ൤𝑓(𝑥0 ) + 4 (𝑓(𝑥1 ) + 𝑓(𝑥3 )) + 2( 𝑓(𝑥2 )) + 𝑓(𝑥4 )൨
0.5
≈ ൤1 + 4 (1.2840 + 9.4877) + 2(2.7183) + 54.5982൨
3

= 17.3536
Error = |17.3536 − 16.4526 | = 0.901

- 106 -
The best approximation in this case is from the Simpson’s Rule. To
get a better estimation we would need to use a larger 𝑛. So, for
completeness sake here are the estimates for some larger value of 𝑛.

Example 4.39 Calculate the following approximations to


10 1
∫2 𝑑𝑥 with 𝑛 = 8. Using
𝑥

(i) Trapezoid Rule


(ii) Simpson’s Rule
10 1
Solution: The exact value of ∫2 𝑑𝑥
𝑥
10
= [𝑙𝑛|𝑥 | ]
2
= [ln 10 − ln 2]
= 1.6094
∵ 𝑛 = 8, 𝑎 = 2 , 𝑏 = 10
𝑏−𝑎 10−2
∴ ℎ= = =1
𝑛 8

We construct the following chart.

𝑥 2 3 4 5 6 7 8 9 10
1 1 1 1 1 1 1 1 1
𝑓(𝑥)
2 3 4 5 6 7 8 9 10

Trapezoid Rule
- 107 -
10 1 ℎ
∫2 𝑑𝑥 ≈ ൤𝑓(𝑥0 ) + 2 (𝑓(𝑥1 ) + ⋯ + 𝑓(𝑥7 )) + 𝑓(𝑥8 )൨ ≈
𝑥 2
1 1 1 1 1 1 1 1 1 1
[ +2( + + + + + + ) + 10]
2 2 3 4 5 6 7 8 9

= 1.6290
Error = |1.6290 − 1.6094 | = 0.0196

Simpson’s Rule

10 1 ℎ
∫2 𝑑𝑥 ≈ ൤𝑓(𝑥0 ) + 4 (𝑓(𝑥1 ) + 𝑓(𝑥3 ) + 𝑓(𝑥5 ) + 𝑓(𝑥7 )) +
𝑥 3

2(𝑓(𝑥2 ) + 𝑓(𝑥4 ) + 𝑓(𝑥6 )) + 𝑓(𝑥8 )൨

1 1 1 1 1 1 1 1 1
≈ ൤1 + 4 ( + + + )+ 2( 4 + + ) + 10൨
3 3 5 7 9 6 8

= 1.6108
Error = |1.6108 − 1.6094| = 0.0014

𝜋 1 𝑑𝑥
Example 4.40 Find the value of 𝜋 form = ∫0 using the Simpson’s
4 1+𝑥 2
Rule and 𝑛 = 5.

Solution:
1−0 1 𝑏−𝑎
= = = 0.2 ℎ =
5 5 𝑛

We construct the following chart.


𝑥 0 0.2 0.4 0.6 0.8 1
𝑓(𝑥) 1 0.9615 0.8621 0.7353 0.6098 0.5
𝜋 1 𝑑𝑥
∴ = ∫0
4 1+𝑥 2

- 108 -

You might also like