Solution (source code)

= Solution

Use the nonpolynomial <function> $f(x)=1+\sin x$ on $[-1,1]$. Its exact <integral> is
$$
\int_{-1}^1(1+\sin x)\,dx=2,
$$
because the <sine> is an <odd function>.

For every uniform <partition of an interval> with $N\geq1$ panels, the <quadrature nodes> satisfy $x_{N-j}=-x_j$. Their <composite trapezoidal rule> <quadrature weights> agree, so the two sampled sine values cancel. If there is a node at zero its sine value is already zero. The constant term is integrated exactly, giving
$$
\boxed{T_N(1+\sin x)=2\quad\text{for every }N\geq1.}
$$
This is <symmetric trapezoidal exactness for odd functions>, applied after adding a <constant function> so that the resulting <definite integral> is nonzero. It is exactness for this particular <integrand>, rather than a claim that every nonpolynomial <function> is integrated exactly.