# Where am I wrong in this variance calculation?

It is said that if $$X$$ and $$Y$$ are independent, then $$\operatorname{Var}[X+Y]=\operatorname{Var}[X]+\operatorname{Var}[Y]$$.

Given that $$Var[X]=E[X^{2}]-E^{2}[X]$$ then by substitution we arrive at $$Var[X+Y]=E[X^{2}]+2E[XY]+E[Y^{2}]-E^{2}[X]-E^{2}[Y]$$ if the random variables are independent then its clear that $$Var\left[X+Y\right]=Var\left[X\right]+Var\left[Y\right]+2E\left[X\right]E\left[Y\right]$$

This conclution is seemingly due to some wrong variable handling through these operations, but I am struggling to spot that out.

• $E^2[X+Y]=(E[X]+E[Y])^2$ is not equal to $E^2[X]+E^2[Y]$.
– Mark
Commented Apr 8 at 14:03
• How did you arrive at $E^2[X]$ being the same thing after substitution as $E^2[X]+E^2[Y]$? Perhaps this is a fault of your choice of notation. Recall that this is $(E[X])^2$. After substitution this is $(E[X]+E[Y])^2$... and you should know that $(a+b)^2$ is not the same thing as $a^2+b^2$ Commented Apr 8 at 14:04
• Commented Apr 8 at 14:04

$$E^2(X+Y) = (E(X+Y))^2 = (E(X)+E(Y))^2 = E^2(X) + 2E(XY) + E^2(Y)$$