Solution (source code)

= Solution

The <fundamental theorem of calculus> differentiates the variable upper endpoint:
$$
I'(x)=\frac2{\sqrt\pi}e^{-x^2},\qquad
I''(x)=-\frac{4x}{\sqrt\pi}e^{-x^2},\qquad
I'''(x)=\frac{-4+8x^2}{\sqrt\pi}e^{-x^2}.
$$
At zero, $I(0)=0$, $I'(0)=2/\sqrt\pi$, $I''(0)=0$ and $I'''(0)=-4/\sqrt\pi$. The integrand is even, so its <integral> from zero is an <odd function>; all even coefficients in the <Maclaurin series> vanish. Hence
$$
\boxed{I(x)=\frac2{\sqrt\pi}\left(x-\frac{x^3}{3}\right)+O(x^5).}
$$
This is the local expansion of the <error function>.