





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






8.7 Numerical integration AIM: Given a function f (x), we want to evaluate the definite integral ∫ (^) b
a
f (x) dx.
So far, we have learned many integration techniques. However, in some situations, it is impossible to find the exact value. Situation 1: There are many integrals of functions that do not have elementary antiderivatives. For instance, ∫ sin x^2 dx
1 + x^4 dx ∫ (^) ex x dx^
eex dx ∫ ex^2 dx
ln x dx ∫ ln (ln x) dx
∫ (^) sin x x dx ∫ (^) sin x x dx^
cos (ex) dx
These integrals look easy, but it can be proved that there is no way to express these integrals as finite combination of elementary functions.
Situation 2: When a function is determined from a scientific experiment through instrument readings or collected data, there may be no formula for the function.
In both cases, we need to find approximate values for definite integrals. How to find approximate values?
One method we already know: approximate by Riemann Sums:
∫ (^) b
a
f (x) dx ≈
∑^ n
k=
f (ck) ∆xk
However, Riemann Sums approximation is sometime not very efficient. We want better approximations. The Trapezoidal Rule
The exact value of the integral is (^) ∫ 2 1
x^2 dx = x^3 3
The Error is 299 128
The percentage error is 3841 /^73 = 0.0011 = 0.11%.
Error Estimates for the Trapezoidal rule
A result from advanced calculus says that if f ′′^ is continuous on [a, b], then ∫ (^) b
a
f (x)dx = T − b^ −^ a 12 · f ′′(c)(∆x)^2
for some number c between a and b. Thus, as ∆x approaches zero, the error defined by
ET = − b − a 12 · f ′′(c)(∆x)^2
approaches zero as the square of ∆x. Note that if |f ′′(x)| ≤ M on [a, b], then
b − a 12 · f ′′(c)(∆x)^2 |
= |b^ −^ a 12 · f ′′(c)(b^ −^ a n
b − a 12
b − a n
M (b − a)^3 12 n^2
Example: How many subdivisions should be used in the Trapezoidal Rule to approximate
ln 2 =
1
x dx
with an error whose absolute value is less than 10 −^4?
Simpson’s Rule: Approximation using parabolas
The area is then approximated by adding the areas under all the parabolas: ∫ (^) b
a
f (x)dx ≈ h 3 (y 0 + 4y 1 + y 2 ) + h 3 (y 2 + 4y 3 + y 4 ) + · · ·
h 3 (yn− 2 + 4yn− 1 + yn)
= h 3 (y 0 + 4y 1 + 2y 2 + 4y 3 + 2y 4 · · · + 2yn− 2 + 4yn− 1 + yn)
Note the pattern of the coefficients in the above rule:
1 , 4 , 2 , 4 , 2 , 4 , 2 , · · · , 4 , 2 , 4 , 1.
Error Estimates for Simpson’s Rule
A result from advanced calculus says that if the fourth derivative f (4)^ is continuous on [a, b], then ∫ (^) b
a
f (x)dx = S − b − a 180 · f (4)(c)(∆x)^4
for some number c between a and b. Thus, as ∆x approaches zero, the error defined by
ES = − b − a 180 · f (4)(c)(∆x)^4
approaches zero as the fourth power of ∆x. Note that if |f (4)(x)| ≤ M on [a, b], then
|ES | = |b^ −^ a 180 · f (4)(c)(∆x)^4 |
= | b − a 180 · f (4)(c)( b − a n
≤ b^ −^ a 180 · M (b^ −^ a n
M (b − a)^5 180 n^4.
Example: Use Simpson’s Rule with n = 4 to approximate
0 5 x (^4) dx.
Example: Use Simpson’s Rule with n = 8 to estimate
1 x (^2) dx. Compare the estimate with the exact value. Solution: Partition [1, 2] into 8 subintervals of equal length. x 1 98 54 118 32 138 74 158 2 y = x^2 1 81642516121649416964491622564