Solution (source code)

= Solution

Let $h=(b-a)/n$, $x_j=a+jh$, and $m_j=a+(j+\tfrac12)h$. The <composite midpoint rule> and <composite trapezoidal rule> are
$$
M_n=h\sum_{j=0}^{n-1}f(m_j),\qquad
T_n=h\left[\frac{f(a)+f(b)}2+\sum_{j=1}^{n-1}f(x_j)\right].
$$
For <composite Simpson's rule> with $2n$ strips, the spacing is $h/2$. Its odd-indexed nodes are the $m_j$ and its even interior nodes are the $x_j$. Consequently
$$
\begin{aligned}
S_{2n}
&=\frac h6\left[f(a)+f(b)+4\sum_{j=0}^{n-1}f(m_j)+2\sum_{j=1}^{n-1}f(x_j)\right]\\
&=\boxed{\frac23M_n+\frac13T_n}.
\end{aligned}
$$
This is an identity between the <quadrature rules>, not an approximation involving an omitted <quadrature error>.