Anda di halaman 1dari 7

Arkansas Tech University

MATH 2924: Calculus II


Dr. Marcel B. Finan
5 Numerical Approximation of Denite Integrals
Sometimes the integral of a function cannot be expressed with elementary
functions, i.e. polynomial, trigonometric, exponential, logarithmic, or a
suitable combination of these. For example, the functions sin(x
2
) and
sin x
x
dont have simple antiderivatives, i.e. it is not possible to write down a
simple analytic formula in terms of elementary fucntions. In cases like these
we still can nd an approximate value for the integral of such functions on
a nite interval.
Left- and Right-hand Riemann Sums
We already know that we can approximate a denite integral

b
a
f(x)dx by
a left- or right-hand Riemann sum for some nite n :
LEFT(f, n) =
n1

i=0
f(x
i
)x
and
RIGHT(f, n) =
n

i=1
f(x
i
)x
where x
0
, x
1
, , x
n
are n + 1 equally spaced points in [a, b] with x
0
=
a, x
n
= b and x
i
= a +ix, 0 i n where x =
ba
n
.
Example 5.1
Approximate

5
1
1
x
dx using a left- and right-hand Riemann sum with 4 in-
tervals, i.e. n = 4.
Solution.
We rst construct the following chart.
x
i
1 2 3 4 5
f(x
i
) 1
1
2
1
3
1
4
1
5
Thus,
1
LEFT(
1
x
, 4) =(f(1) +f(2) +f(3) +f(4))x
=(1 +
1
2
+
1
3
+
1
4
) 1 =
25
12
2.0833
and
RIGHT(
1
x
, 4) =(f(2) +f(3) +f(4) +f(5))x
=(
1
2
+
1
3
+
1
4
+
1
5
) 1 =
77
60
1.2833.
For comparison, we know that the exact value of the integral we are seeking
to approximate is

5
1
1
x
dx = ln5 1.6094.
Thus, for n = 4 the left- and right-hand Riemann sums give poor approx-
imations. Figures 5.1(a) and 5.1(b) illustrate why the left and right rules
are so inaccurate.
Figure 5.1
By drawing pictures of the geometric regions involved one can easily see that
LEFT(f, n)

b
a
f(x)dx RIGHT(f, n), when f(x) is increasing
2
and
RIGHT(f, n)

b
a
f(x)dx LEFT(f, n), when f(x) is decreasing.
So if f(x) is increasing then LEFT(f, n) is an underestimate while RIGHT(f, n)
is an overestimate. Similarly, when f is decreasing RIGHT(f, n) is an un-
derestimate and LEFT(f, n) is an overestimate.
Midpoint Approximation
Instead of using the left- or right-endpoints we use the midpoint. Recall
that the midpoint of an interval [x, y] is given by the midpoint formula
x+y
2
.
The midpoint approximation is given by
MID(f, n) =
n

i=1
f

x
i1
+x
i
2

x.
Example 5.2
Approximate

5
1
1
x
dx with the midpoint rule using 4 intervals.
Solution.
Let m
i
denote the midpoint of the interval [x
i1
, x
i
]. Then
m
i
1.5 2.5 3.5 4.5
f(m
i
)
2
3
2
5
2
7
2
9
Thus,
MID(
1
x
, 4) =(f(1.5) +f(2.5) +f(3.5) +f(4.5))x
=
2
3
+
2
5
+
2
7
+
2
9
1.5746.
This answer is fairly close to the exact answer. The midpoint rule approxi-
mates with rectangles on each subdivision that are partly above and partly
below the graph, so the errors tend to balance out. See Figure 5.2.
3
Figure 5.2
Note that if the graph of f(x) is concave down on [a, b] then MID(f, n) is
an overestimate of

b
a
f(x)dx since the midpoint rectangle and the trapezoid
constructed by drawing the tangent line to the graph at the midpoint have
the same area since the triangles ABC and CEF are equal. (See Figure 5.3)
Figure 5.3
On the other hand, if f(x) is concave up on [a, b] then MID(f, n) is an
underestimate of

b
a
f(x)dx. See Figure 5.4.
4
Figure 5.4
Trapezoid Rule
There is no reason why we should necessarily use rectangles to approximate

b
a
f(x)dx. We could use the function values of both endpoints of the interval
and approximate the interval by trapezoids instead. Recall that the area of
a trapezoid with base [x
i1
, x
i
] and sides f(x
i1
) and f(x
i
) is given by
f(x
i1
) +f(x
i
)
2
x.
Thus, the trapezoid approximation is given by
TRAP(f, n) =
n

i=1
f(x
i1
) +f(x
i
)
2
x =
LEFT(f, n) +RIGHT(f, n)
2
.
Example 5.3
Approximate

5
1
1
x
dx with the trapezoid rule using 4 intervals.
Solution.
Using the following chart
x
i
1 2 3 4 5
f(x
i
) 1
1
2
1
3
1
4
1
5
we can write
5
TRAP(
1
x
, 4) =(
f(1) +f(2)
2
+
f(2) +f(3)
2
+
f(3) +f(4)
2
+
f(4) +f(5)
2
)x
=
3
4
+
5
12
+
7
24
+
9
40
1.6833
This answer is fairly close to the exact answer.
Note that if the graph of f(x) is concave up then the area of each trapezoid is
larger than the area under the graph so that TRAP(f, n) is an overestimate
of

b
a
f(x)dx. See Figure 5.5(a). On the other hand, if the graph of f(x) is
concave down then the area fo each trapezoid is smaller than the area under
the graph so that TRAP(f, n) is an underestimate of the denite integral.
See Figure 5.5(b).
Figure 5.5
It follows from the above discussions that:
(i) If f(x) is concave up and increasing on [a,b] then
LEFT(f, n) MID(f, n)

b
a
f(x)dx TRAP(f, n) RIGHT(f, n).
(ii) If f(x) is concave up and decreasing on [a,b] then
RIGHT(f, n) MID(f, n)

b
a
f(x)dx TRAP(f, n) LEFT(f, n).
6
(iii) If f(x) is concave down and increasing on [a,b] then
LEFT(f, n) TRAP(f, n)

b
a
f(x)dx MID(f, n) RIGHT(f, n).
(iv) If f(x) is concave down and decreasing on [a,b] then
RIGHT(f, n) TRAP(f, n)

b
a
f(x)dx MID(f, n) LEFT(f, n).
7

Anda mungkin juga menyukai