What is the variance of the number of heads that come up when a fair coin is flipped 10 times? So the answer to this is $5/2$. 

I get that $E(x)=5$ which means that $\big(E(x)\big)^2 = 25$, therefore meaning that $E(x^2) = 55/2$.

How do I compute $E(x^2)$ in this scenario?
Note that $X = X_1 + \ldots + X_{10}$, where 

$X_i=0$ if the $i$th flip is tails, and $1$ if the $i$th flip is heads.

Since the $X_i$'s are independent, we have

$Var(X) = Var(X_1 + \ldots + X_{10}) = Var(X_1) + \ldots + Var(X_{10})$.

Finally,

$Var(X_i) = E(X_i^2) - E(X_i)^2 = \frac{1}{2} - \frac{1}{4} = \frac{1}{4}$,

so that

$Var(X_1) + \ldots + Var(X_{10}) = 10*(\frac{1}{4}) = \frac{5}{2}$.
here $n=10$, $p=0.5$.

So, mean$= np= 5$

and Variance$= np(1-p)= 5(1-0.5)=2.5$