Let $u(t)=t^2$. Find the best approximation $v(t)$ in the form of $v(t)= ct+d $ (with $c,d\in\mathbb{R}$) to $u(t)$ in $L^1[0,1]$.
So we need to find
$$\inf\limits_{c,d\in\mathbb{R}} \int_0^1 \left|t^2-ct-d\right|dt$$
I've tried to approach this problem from different angles: completing the square, taking derivatives $\frac{\partial}{\partial c}$ and $\frac{\partial}{\partial d}$, but nothing has been helpful so far.
Would appreciate a hint.
As user7530 commented, consider the roots $$t^2-ct-d=0 \implies t_{1,2}=\frac{1}{2} \left(c\pm\sqrt{c^2+4 d}\right)$$ So $$I=\int_0^1 \left|t^2-ct-d\right|\,dt=\int_0^{t_1}(t^2-ct-d)\,dt-\int_{t_1}^{t_2}(t^2-ct-d)\,dt+\int_{t_2}^{1}(t^2-ct-d)\,dt$$
Compute each of these three integrals; for sure, the formulae are not the most pleasant but the total is quite nice $$I=\frac{1}{3} c^2 \sqrt{c^2+4 d}+\frac{4}{3} d \sqrt{c^2+4 d}-\frac{c}{2}-d+\frac{1}{3}$$ Now, compute $\frac{\partial I}{\partial c}$ and $\frac{\partial I}{\partial d}$ which, after simplication, are nice and simple. Set these equal to $0$ and solve.
I am sure that you can take it from here.