Let $X: \Omega \rightarrow \Bbb R$ be a random variable. Prove that $$\min_{a \in \Bbb R} E((X - a)^2) = Var(X)$$
First, we note that $E((X - a)^2) = E(X^2 - 2aX + a^2) = E(X^2) - 2aE(X) + a^2$.
In order to minimize the function, we have to take the first derivate, which is $2E(X) - 2a$. Now, we have to solve
$$2E(X) - 2a = 0$$
This is obviously only true for $a = E(X)$, so there is no other possible root. In order to show that this is indeed the minimum, we calculate the second derivative, which is $2 > 0$, hence, this is a minimal turning point trivially.
Is that the correct solution?