<s>[INST] Compute $ \min_{a,b,c \in \mathbb{R}} \int_{-1}^1 |e^x-a-bx-cx^2|^2dx $ The question is the following:

Compute 
  $$ \min_{a,b,c \in \mathbb{R}} \int_{-1}^1 |e^x-a-bx-cx^2|^2dx $$

I tried to expand the integral, and it gives me:
$$
\int_{-1}^1 |e^x-a-bx-cx^2|^2dx=  2a^2+\frac{2}{3}(2ac+b^2)+\frac{2}{e}(a-2b+5c)-2e(a+c)+\frac{2}{5}c^2+\frac{1}{2}(e^2-e^{-2}) 
$$
Here I have no idea how to proceed.
I also consider the following: we can rewrite
$$ \min_{a,b,c \in \mathbb{R}} \int_{-1}^1 |e^x-f(x)|^2dx $$
where
$$
f(x) = a+bx+cx^2
$$
So the question is basically to find a degree 2 polynomial to approximate $e^x$ as close as possible. But  this idea seems to be off the subject I learned. Thanks for any help and hint. 
 [/INST] Hint.
You can compute the derivative of $f(a,b,c):=\int_{-1}^{1} | e^x - a - bx - cx^2 |^2 dx$ with respect to $a$, $b$ and $c$ and set them to zero to find the values of $a,b$ and $c$ that minimise that expression.
Values for comparison

 We have $\frac{df(a,b,c)}{da} = 4 a + \frac{4c}{3} - 2( e - e^{-1})$ and $\frac{df(a,b,c)}{db} = \frac{4 b}{3} - 4 e^{-1}$. The latter gives us $b = 3 e^{-1}$. Finally, $\frac{df(a,b,c)}{dc} = \frac{4 a}{3} + \frac{4 c}{5} - 2 e + 10e^{-1}$. According to WolframAlpha we have $a = \frac{3 (11 - e^2)}{4 e}$ and $c = \frac{15 (e^2 - 7)}{4 e}$. This yields $f(a,b,c) =  36 - \frac{259}{2 e^2} - \frac{5 e^2}{2} \approx 0.00144$.

Edit Notice that we have $a \approx 0.996$, $b \approx 1.104$ and $c \approx 0.537$, so $a + bx + c x^2 \approx 1 + x + \frac{1}{2} x^2$, which are the first three terms of the Taylor series for $e^x$.
</s>