Topic: Integration Techniques

Subtopic: Numerical Integration

**Overview**

Recall Riemann Sums where we approximated the area under a curve by drawing rectangles and summing their area as the number of rectangles grew toward infinity. The act of using rectangles based on the left or right endpoint, or even based on the midpoint, caused some error in the area approximation. This error can be reduced by using a shape where the top of the rectangular strip more closely matches the curve such as a slanty line (which would make the rectangles into trapezoids) or a parabolic topper (used in Simpson's Rule). This is the idea behind the __Trapezoid Rule__ and __Simpson's Rule__, both being methods of __numerical integration__ where the definite integral is approximated using a numeric formula. These two formulas ("rules") are particular useful for approximating definite integrals that cannot be evaluated symbolically (e.g. their integrand's antiderivative is unknown).

**Objectives**

By the end of this topic you should know and be prepared to be tested on:

- 8.7.1 Approximate a definite integral symbolically using the Trapezoidal Rule
- 8.7.2 Approximate a definite integral symbolically using Simpson's Rule
- 8.7.3 Approximate a definite integral electronically using the Trapezoidal Rule and using Simpson's Rule
- 8.7.4 Compute absolute and relative errors given the computed numerical solution and actual exact solution to a definite integral
- 8.7.5 Use the appropriate formula to find the error associated with the Midpoint Rule, Trapezoidal Rule, and Simpson's Rule

**Terminology**

Terms you should be able to define: partition, error, absolute error, relative error, error bound, and the two numerical integration rules below.

Let `f(x)` be continuous on `[a,b]`. Partition `[a,b]` into `n` equal subintervals each having width `Delta x = (b-a)/n` such that `a = x_0 < x_1 < x_2 < ... < x_n = b` then `int_a^b f(x) dx` can be approximated by either of the following formulae.
`T_n = (Delta x)/2 [f(x_o) + 2f(x_1) + 2f(x_2) + ... + 2f(x_(n-1)) + f(x_n)]`
`S_n = (Delta x)/3 [f(x_o) + 4f(x_1) + 2f(x_2) + 4f(x_3) + 2f(x_4) + ... + 4f(x_(n-1)) + f(x_n)]` |

Suppose `c` is a computed numerical solution to a problem having an actual exact solution `x`. Two common measures of the error are
Assume `f''` is continuous on `[a,b]` and `k` is a Real number such that `|f''(x)| <= k`, for all `x` on `[a,b]`. When approximating the integral `int_a^b f(x) dx` by the Midpoint Rule with `n` subintervals, the absolute error, `E_M` satisfies the inequality `E_M <= (k(b-a))/24 (Delta x)^2 = (k(b-a)^3)/(24n^2)`.
Assume `f''` is continuous on `[a,b]` and `k` is a Real number such that `|f''(x)| <= k`, for all `x` on `[a,b]`. When approximating the integral `int_a^b f(x) dx` by the Trapezoidal Rule with `n` subintervals, the absolute error, `E_T`, satisfies the inequality `E_T <= (k(b-a))/12 (Delta x)^2 = (k(b-a)^3)/(12n^2)`.
Assume `f^"(4)"` is continuous on `[a,b]` and `k` is a Real number such that `|f^"(IV)"(x)| <= k`, for all `x` on `[a,b]`. When approximating the integral `int_a^b f(x) dx` by Simpson's Rule with `n` subintervals, the absolute error, `E_S`, satisties the inequality `E_S <= (k(b-a))/180 (Deltax)^4 = (k(b-a)^5)/(180n^4)`. |

**Mini-Lectures and Examples**

STUDY: Integration Techniques - Numerical Integration

**Supplemental Resources (required!)**

Evaluating numerical integration problems using these two rules can get quite messy. So while you need to know how to set-up and evaluate a numerical integration problem using the two rules, it is useful to check your work electronically using one of these two online calculators: Trapezoidal Rule Calculator and Simpson's Rule Calculator. They are particularly handy when the problem has a large n-value making the rules simply exhausting to solve symbolically. TIP: uncheck the "show steps" box so the decimal answer is readily available.

**Supplemental Resources (recommended)**

Krista King's Error Bounds for Midpoint, Trapezoidal, and Simpson's Rules is a down-to-earth readable explanation of the error formulae in action.

**Supplemental Resources (optional)**

Video: Numerical Integration, Selwyn Hollis's Video Calculus

Lesson: Approximating Definite Integrals, Dale Hoffman's Contemporary Calculus

Lesson: Approximating Definite Integrals, Paul Dawkins' Online Notes

rev. 2021-02-20