Cálculo 2Techniques of Integration

Trapezoid and Simpson's Rules

Approximate integrals with trapezoids and parabolas.

Sin empezar Ir a la práctica

Esta lección aún no está traducida. Por ahora se muestra en inglés; la versión en español está en camino.

Many definite integrals have no exact antiderivative to use, and data from a sensor has no formula at all. You already approximated area with rectangles in Riemann sums. Two better shapes give much better estimates for the same work: trapezoids and parabolas.

Por qué funciona

Trapezoids. Over each subinterval, replace the curve by the straight segment joining its endpoints. A trapezoid of width $\Delta x$ has area $\frac{\Delta x}{2}(y_{i} + y_{i+1})$. Adding them, every inside point is counted twice: $$T_n = \frac{\Delta x}{2}\left[y_0 + 2y_1 + \cdots + 2y_{n-1} + y_n\right].$$ This is also the average of the left and right Riemann sums. Parabolas. Through three neighboring points at $x = -h, 0, h$, fit $y = Ax^{2} + Bx + D$. Its area is $$\begin{aligned} &\int_{-h}^{h}(Ax^{2} + Bx + D)\,dx \\ &= \frac{2Ah^{3}}{3} + 2Dh. \end{aligned}$$ Since $y_0 + y_2 = 2Ah^{2} + 2D$ and $y_1 = D$, that area equals $\frac{h}{3}(y_0 + 4y_1 + y_2)$. Each parabola uses two subintervals, so $n$ must be even, and chaining them gives Simpson's rule.

Idea clave

With $\Delta x = \frac{b - a}{n}$ and $y_i = f(a + i\,\Delta x)$: $$T_n = \frac{\Delta x}{2}\left[y_0 + 2y_1 + \cdots + 2y_{n-1} + y_n\right],$$ $$\begin{aligned} S_n = \frac{\Delta x}{3}\Big[&y_0 + 4y_1 + 2y_2 + 4y_3 + \cdots \\ &+ 2y_{n-2} + 4y_{n-1} + y_n\Big] \end{aligned}$$ with $n$ even. Error bounds: $|E_T| \le \frac{K(b - a)^{3}}{12n^{2}}$ with $|f''| \le K$; $\ |E_S| \le \frac{K(b - a)^{5}}{180n^{4}}$ with $|f^{(4)}| \le K$.

Ejemplo resuelto: Trapezoids

Estimate $\int_0^2 x^{2}\,dx$ with $T_4$.
  1. $\Delta x = 0.5$; the values at $0, 0.5, 1, 1.5, 2$ are $0, 0.25, 1, 2.25, 4$.
  2. $$\begin{aligned} T_4 &= \tfrac{0.5}{2}\big[0 + 2(0.25) + 2(1) \\ &\qquad + 2(2.25) + 4\big] \\ &= 0.25\cdot 11 = 2.75. \end{aligned}$$
  3. The exact value is $\frac{8}{3} \approx 2.667$. The trapezoids sit above this curve because it bends upward.

Respuesta: $2.75$

Ejemplo resuelto: Simpson

Estimate the same integral with $S_4$.
  1. Weights $1, 4, 2, 4, 1$: $$\begin{aligned} S_4 &= \tfrac{0.5}{3}\big[0 + 4(0.25) + 2(1) \\ &\qquad + 4(2.25) + 4\big] \\ &= \frac{1}{6}\cdot 16. \end{aligned}$$
  2. $S_4 = \frac{8}{3}$, exactly right. Simpson's rule is exact for every polynomial of degree 3 or less, since $f^{(4)} = 0$ makes its error bound 0.

Respuesta: $\frac{8}{3}$

Trapezoids for $\int_1^2 \frac{dx}{x} = \ln 2$. Compare the four rules in the table, then raise $n$: doubling $n$ cuts the trapezoid error to about a quarter.

Ejemplo resuelto: Where it matters

Estimate $\ln 2 = \int_1^2 \frac{dx}{x}$ with $S_4$.
  1. $\Delta x = \frac{1}{4}$; the values at $1, \frac{5}{4}, \frac{3}{2}, \frac{7}{4}, 2$ are $1, \frac{4}{5}, \frac{2}{3}, \frac{4}{7}, \frac{1}{2}$.
  2. $$\begin{aligned} S_4 &= \frac{1}{12}\left[1 + \frac{16}{5} + \frac{4}{3} + \frac{16}{7} + \frac{1}{2}\right] \\ &\approx 0.693254. \end{aligned}$$
  3. $\ln 2 \approx 0.693147$, so the error is about $0.0001$ with just five function values.

Respuesta: $S_4 \approx 0.69325$

Error común

Using Simpson's rule with an odd number of subintervals. Each parabola covers two subintervals, so with $n = 5$ one is left over and the $1, 4, 2, \ldots, 4, 1$ pattern breaks: it would end on a weight of 2 or start the pattern wrong. Check: the weight list must start and end with 1, and the 4's must sit at the odd-numbered points.

Práctica

Apruebas con 3 respuestas correctas, las 2 últimas seguidas. Cada respuesta correcta da 2 XP.

Cargando la práctica…

Se apoya en

Lleva a

Fuentes y lecturas

  • OpenStax Calculus Volume 2, Section 3.6: Numerical Integration
  • Paul’s Online Math Notes (Lamar University), Calculus II: Approximating Definite Integrals