Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Although this is not actually homework, it's an exercise from the book;

I want to rewrite the variance,

\begin{equation*} var[f]=E[(f(x)-E[f(x)])^2] \end{equation*}


\begin{equation*} E[f(x)^2]-E[f(x)]^2. \end{equation*}

I'm not sure how it reduces, and it has had me stumped for a while. The answer would be nice. Any insight [a brief, yet, interesting explanation] would be great.

Thanks in advance

share|cite|improve this question
The notation f(x) only adds obscurity. Is that an arbitrary (deterministic) function of the random variable x ? If so, just write replace 'f(x)' by 'y' and start from there. – leonbloy Oct 19 '10 at 14:14
up vote 6 down vote accepted

Let $X = f(x)$ denote the random variable in question. Let $\mu = E(f(x))$. Then, you are looking to prove the following

$E((X-\mu)^2) = E(X^2)-\mu^2$

Let me outline the steps needed to prove this and you can try to fill in the gaps.

  1. Expand the LHS algebraically and use linearity of expectation to split it into $3$ different terms.
  2. Note that $\mu$ is a constant and $E(aX)$ is related in a simple way to $E(X)$ when $a$ is a constant.

These two steps combined should get you to the right hand side.

share|cite|improve this answer
Thank you. $E[(X-\mu)^2]=E[X^2]-\muE[X]+\mu^2$ What I hadn't noticed was that $E[X] = \mu$ and the expression reduces quite nicely. – sova Oct 19 '10 at 17:52
Also, I had trouble noticing that $E[E[f(x)]]=E[f(x)]$, is a good way to think of the expectation operator as turning its argument into a constant? Or lowering the dimensionality, if it were something like $E_x[f(x,y)]$ ? – sova Oct 19 '10 at 18:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.