Regla del trapecio
Para obtener la regla trapezoidal para aproximar \(\int_{a}^{b}f(x)~\mathrm{d}x\), sea \(x_{0} = a\), \(x_{1} = b\), \(h = b − a\) se utiliza el polinomio de Lagrange
\[
P_{1} = \frac{(x-x_{1})}{(x_{0}-x_{1})}~f(x_{0}) + \frac{(x-x_{0})}{(x_{1}-x_{0})}~f(x_{1}).
\]
Entonces
\[
\int_{a}^{b}f(x)~\mathrm{d}x = \int_{x_{0}}^{x_{1}}\left[ \frac{(x-x_{1})}{(x_{0}-x_{1})}~f(x_{0}) + \frac{(x-x_{0})}{(x_{1}-x_{0})}~f(x_{1}) \right]~\mathrm{d}x + \frac{1}{2}\int_{x_{0}}^{x_{1}} f''(\xi(x))(x-x_{0})(x-x_{1})~\mathrm{d}x.
\]
Aplicando el teorema del valor medio ponderado para integrales al término del error para algún \(\xi \in (x_{0} , x_{1} )\)
\[\begin{split}
\begin{aligned}
\int_{x_{0}}^{x_{1}} f''(\xi(x))(x-x_{0})(x-x_{1})~\mathrm{d}x &= f''(\xi) \int_{x_{0}}^{x_{1}}(x-x_{0})(x-x_{1})~\mathrm{d}x, \\
&= f''(\xi) \left[ \frac{x^{3}}{3} - \frac{(x_{1} + x_{0})}{2}x^{2} + x_{0}x_{1}x \right]_{x_{0}}^{x_{1}}, \\
&= - \frac{h^{3}}{6}f''(\xi).
\end{aligned}
\end{split}\]
Esto implica que
\[\begin{split}
\begin{aligned}
\int_{a}^{b}f(x)~\mathrm{d}x &= \left[ \frac{(x-x_{1})^{2}}{2(x_{0}-x_{1})}~f(x_{0}) + \frac{(x-x_{0})^{2}}{2(x_{1}-x_{0})}~f(x_{1}) \right]_{x_{0}}^{x_{1}} - \frac{h^{3}}{12}f''(\xi), \\
&= \frac{(x_{1}-x_{0})}{2}\left[f(x_{0}) + f(x_{1}) \right] - \frac{h^{3}}{12}f''(\xi).
\end{aligned}
\end{split}\]
Definiendo la variable \(h:=x_{1}-x_{0}\) obtenemos la siguiente regla
\[
\int_{a}^{b}f(x)~\mathrm{d}x = \frac{h}{2}\left[f(x_{0}) + f(x_{1}) \right] - \frac{h^{3}}{12}f''(\xi).
\]
Regla de Simpson
La regla de Simpson resulta de integrar en el intervalo \([a, b]\) el segundo polinomio de Lagrange con nodos equiespaciados \(x_{0} = a\), \(x_{2} = b\) y \(x_{1} = a + h\), donde \(h:= (b − a)/2\). Por lo tanto
\[
\int_{a}^{b}f(x)~\mathrm{d}x = \int_{x_{0}}^{x_{2}} \left[ \frac{(x-x_{1})(x-x_{2})}{(x_{0}-x_{1})(x_{0}-x_{2})}~f(x_{0}) + \frac{(x-x_{0})(x-x_{2})}{(x_{1}-x_{0})(x_{1}-x_{2})}~f(x_{1}) + \frac{(x-x_{0})(x-x_{1})}{(x_{2}-x_{0})(x_{2}-x_{1})}~f(x_{2}) \right]~\mathrm{d}x + \int_{x_{0}}^{x_{2}} \frac{(x-x_{0})(x-x_{1})(x-x_{2})}{6}~f^{(3)}(\xi(x))~\mathrm{d}x.
\]
Esta ecuación permite obtener un término de error de orden \(O(h^{4})\) que involucra a \(f^{(3)}\). No obstante, es posible deducir un término de orden superior que involucra a \(f^{(4)}\). Para ello suponga que \(f\) se expande en el tercer polinomio de Taylor alrededor de \(x_{1}\). Entonces, para cada \(x\) en \([x_{0}, x_{2}]\), existe un número \(\xi(x)\) en \((x_{0}, x_{2})\) con
\[
f(x) = f(x_{1}) + f'(x_{1})(x-x_{1}) + \frac{f''(x_{1})}{2}(x-x_{1})^{2} + \frac{f'''(x_{1})}{6}(x-x_{1})^{3} + \frac{f^{(4)}(\xi(x))}{24}(x-x_{1})^{4},
\]
y
\[
\int_{x_{0}}^{x_{2}}f(x)~\mathrm{d}x = \left[f(x_{1})(x-x_{1}) + \frac{f'(x_{1})}{2}(x-x_{1})^{2} + \frac{f''(x_{1})}{6}(x-x_{1})^{3} + \frac{f'''(x_{1})}{24}(x-x_{1})^{4} \right]_{x_{0}}^{x_{2}} + \frac{1}{24} \int_{x_{0}}^{x_{2}} f^{(4)}(\xi(x))(x-x_{1})^{4}~\mathrm{d}x.
\]
Para algún número \(x_{1} \in (x_{0},x_{2})\), el teorema de valor medio ponderado para integrales implica que
\[
\frac{1}{24} \int_{x_{0}}^{x_{2}} f^{(4)}(\xi(x))(x-x_{1})^{4}~\mathrm{d}x = \frac{f^{(4)}(\xi_{1})}{24}\int_{x_{0}}^{x_{2}} (x-x_{1})^{4}~\mathrm{d}x = \left. \frac{f^{(4)}(\xi_{1})}{120}(x-x_{1})^{5} \right|_{x_{0}}^{x_{2}}.
\]
Sin embargo, \(h=x_{2}-x_{1}=x_{1}-x_{0}\) entonces
\[
(x_{2}-x_{1})^{2}-(x_{0}-x_{1})^{2} = (x_{2}-x_{1})^{4} - (x_{0}-x_{1})^{4} = 0,
\]
mientras que
\[
(x_{2}-x_{1})^{3}-(x_{0}-x_{1})^{3} = 2h^{3}, \quad (x_{2}-x_{1})^{5}-(x_{0}-x_{1})^{5} = 2h^{5}.
\]
Por consiguiente
\[
\int_{x_{0}}^{x_{2}}f(x)~\mathrm{d}x = 2hf(x_{1}) + \frac{h^{3}}{3}f''(x_{1}) + \frac{f^{(4)}(\xi_{1})}{60}h^{5}.
\]
Reemplazando \(f''(x_{1})\), tenemos
\[\begin{split}
\begin{aligned}
\int_{x_{0}}^{x_{2}}f(x)~\mathrm{d}x &= 2hf(x_{1}) + \frac{h^{3}}{3} \left\{\frac{1}{h^{2}} \left[f(x_{0}) - 2f(x_{1}) + f(x_{2}) \right] - \frac{h^{2}}{12}f^{(4)}(\xi_{2}) \right\} + \frac{f^{(4)}(\xi_{1})}{60}h^{5}, \\
&= \frac{h}{3}\left[ f(x_{0}) + 4f(x_{1}) + f(x_{2}) \right] - \frac{h^{5}}{12}\left[ \frac{1}{3}f^{(4)}(\xi_{2}) - \frac{1}{5}f^{(4)}(\xi_{1}) \right]
\end{aligned}
\end{split}\]
Finalmente, considerando que los valores \(\xi_{1}\) y \(\xi_{2}\) de esta expresión pueden sustituirse por un valor común \(\xi \in (x_{0}, x_{2})\), tenemos
\[
\int_{x_{0}}^{x_{2}}f(x)~\mathrm{d}x = \frac{h}{3}\left[ f(x_{0}) + 4f(x_{1}) + f(x_{2}) \right] - \frac{h^{5}}{90}f^{(4)}(\xi).
\]