# Show that $|f''(\xi)|\leq2$ on the actual interval.

We want to compute an approximation for $\int_{-1}^1e^{-x^2} \ dx$ using trapezoid method. The trapezoid rule for an interval is

$$\frac{b-a}{2}(f(a)+f(b))=\int_a^bf(x)\ dx +\frac{f''(\xi)}{12}(b-a)^3, \quad \xi\in(a,b).$$

Show that $f''(\xi)\leq2$ on the actual interval.

The exam solutions say that

$$|f''(\xi)|=|(4x^2-2)e^{-x^2}|\leq |4x^2-2|, \tag1$$

thus $-2\le 4x^2-2 \le 2$ on $[-1,1]$.

Questions: Do you think this is a sufficient explanation from the lecturer? I have no idea where $4x^2-2$ came from and why $(1)$ holds to begin with.

$$\frac{d^2}{dx^2} [e^{-x^2}] = (4x^2 - 2)e^{-x^2}$$
Now $e^{-x^2}$ is bounded above by $1$, thus $|(4x^2 - 2)e^{-x^2}| \leq |4x^2 - 2|$, which is bounded by $2$ on the interval $[-1, 1]$.
If $f(x) =e^{-x^2}$, then $f'(x) =-2xe^{-x^2}$, and $f''(x) =-(2x(-2x)+2)e^{-x^2} =-(-4x^2+2)e^{-x^2} =(4x^2-2)e^{-x^2}$.