Solution (source code)

= Solution

Exactness on the <polynomial> <basis> $1,x,x^2$ requires
$$
a_0+a_1+a_2=0,\qquad-a_0+a_2=0,\qquad a_0+a_2=2.
$$
Solving gives
$$
\boxed{a_0=1,\qquad a_1=-2,\qquad a_2=1.}
$$
Thus the approximation is the unit-spacing centered second difference, $\mu(f)=f(-1)-2f(0)+f(1)$.