Find the best linear prediction Let $X, Y \in \mathcal L^2$ with $\operatorname{Var}(X)=1$. 

Show that $\operatorname{\Bbb E}(Y-a-bX)^2$ is minimal for $ b= \operatorname{cov}(X,Y)$ and $a = \operatorname{\Bbb E} (Y-bX)$.

I know I could extend the expression and and find $a$ and $b$ via differentiation. Is there a simpler way though?
 A: $\newcommand{\e}{\operatorname{E}} \newcommand{\v}{\operatorname{var}}$
First let us recall that  $m\mapsto \e((W-m)^2)$ is minimized by $m=\e(W),$ thus:
\begin{align}
\e((W-m)^2) = {} & \e(W^2) - 2m\e(W) + m^2 \\[10pt]
= {} & \Big( m^2 -2m\e(W) + (\e(W))^2\Big) + \e(W^2) - (\e(W))^2 \\
& (\text{completing the square}) \\[10pt]
= {} & \Big( m-\e(W) \Big)^2 + \e(W^2) - (\e(W))^2.
\end{align}
This is as small as possible when that first square is $0,$ thus when $m=\e(W).$
Therefore, whatever is the value of $b$ that we end up with, we should have $a=\e(Y-bX).$
Next,
\begin{align}
\e((Y-a-bX)^2) = {} & \operatorname{var}(Y-a-bX) \\
& (\text{This holds if } a = \e(Y-bX).) \\[10pt]
= {} & \v(Y) + b^2\v(X) -2b\operatorname{cov}(X,Y) \\[10pt]
= {} & \v(X)\left( b^2 - 2b \frac{\operatorname{cov}(X,Y)}{\v(X)} + \left(\frac{\operatorname{cov}(X,Y)}{\v(X)}\right)^2 \right) +\v(Y) - \frac{(\operatorname{cov}(X,Y))^2}{\v(X)} \\
& (\text{completing the square again}) \\[10pt]
= {} & \v(X) \left( b - \frac{\operatorname{cov}(X,Y)}{\v(X)} \right)^2 + \v(Y) - \frac{(\operatorname{cov}(X,Y))^2}{\v(X)}. 
\end{align}
Again, this is minimized by making the square $0.$
