The Trapezoid method for [[Quadrature]] is a numerical integration method that uses the [[Left-Endpoint Method]] and [[Right-Endpoint Method]] together.
$\large \begin{align}
A = h\pa{
\frac{1}{2}f(a) + f(a+h) +f(a+2h) + \cdots + f(b-h)+ \frac{1}{2}f(b)
}
\end{align}$
This method uses the average of the left endpoint and right endpoint method.
$\huge
T = \frac{L_{}+R}{2}
$
The logic behind this method is if $f'$ is positive then the [[Left-Endpoint Method]] will be too low, but the [[Right-Endpoint Method]] will be too high.
### [[Numerical Analysis Error Bounds|Error]]
Lets say we can model our [[Function]] as some quadratic function. Let $f(x)=k_{1}x+k_{2}x^{2}$ with some step side $h>0$.
$\huge \begin{align}
L&= b -a\\
n &= \frac{L}{h}
\end{align}
$
$\huge \begin{align}
f(0) &= 0\\
f(h) &= k_{1}h + k_{2}h^{2}\\
A_{T}&=\frac{1}{2}\pa{f(0)+f(h)} h \\
&= \frac{k_{1}h^{2}}{2} + \frac{k_{2}h_{3}}{2}
\end{align}$
The actual integral would equal:
$\huge
\int_{0}^{h}f(x)\d x = \frac{k_{1}h^{2}}{2}+ \frac{k_{2}h_{3}}{3}
$
Our error (for one step) would be the difference between these,
$\huge \begin{align}
\epsilon_{1} &= \pa{\frac{k_{1}h_{2}}{2}+\frac{k_{2}h_{3}}{3}} - \pa{\frac{k_{1}h_{2}}{2}+\frac{k_{2}h_{3}}{2}}\\
&= \frac{k_{2}h_{3}}{6}
\end{align}$
Or,
$\huge
\epsilon = \frac{h^{3}}{12} f''
$
For the general case,
$\huge \epsilon_{1} \leq \frac{h^{3}}{12}|f''_{\op{ext}}| $
The total error bounded would be:
$\huge
\epsilon \leq
n\frac{h^{3}}{12}|f_{\op{ext}}'' =
\frac{h^{2}L}{12}|f''_{\op{ext}}|
$