Solution (source code)

= Solution

With step size $h=1/4$, the <composite trapezoidal rule> gives half weight to the two endpoints:
$$
T_4=\frac14\left[\frac{0^2+1^2}{2}+\left(\frac14\right)^2+\left(\frac12\right)^2+\left(\frac34\right)^2\right]
=\frac14\left(\frac12+\frac{1+4+9}{16}\right).
$$
Therefore
$$
\boxed{T_4=\frac{11}{32}=0.34375.}
$$
It exceeds the exact <definite integral> by $1/96$, as expected because $x^2$ is a <convex function> and each trapezoid lies above the curve.