Why does $E[X]$ not equal the integral of $f(x)^2$

81 Views Asked by At

If $X$ is a random variable with the pdf $f(x)$ and $Y=g(X)$ how come $E[Y]$ is the integral of $g(x)f(x)$ but $E[X]$ is the intergral of $xf(x)$ ??

2

There are 2 best solutions below

0
On BEST ANSWER

Using the definition, for every positive function $g$ you have $$ Eg(X) = \int f(x)g(x) dx. $$ and if $E|g(X)|<\infty$ you have the same definition as well.

So if $g(x)=x$, as soon as $E|X|<\infty$ you have $$EX= \int x f(x) dx.$$

0
On

$\mathbb E(X)$ is the integral of $xf(x)\,dx$ because $\mathbb E(g(X))$ is the integral of $g(x)f(x)\,dx$.