# Continuous distribution - expected value

Is it true that for continuous distribution $$E(X^a) = \int_{-\infty}^{+\infty} x^a\cdot g(x)dx$$ where $g(x)$ is probability density function?

-

Yes. This is called the Law of the Unconscious Statistician on Wikipedia. (I don't know where the name comes from exactly, and didn't learn it with a name.) Essentially it states that

$$E[g(X)] = \int_{-\infty}^\infty g(x) f(x) dx$$

where $f(x)$ is the probability density function of $X$. So in your case, since $g(X) = X^{\alpha}$, you get

$$E[X^\alpha] = \int_{-\infty}^\infty x^\alpha f(x) dx.$$

This is probably more than you wanted to know, but it's handy and will be useful if you ever deal with more complicated functions $g(X)$.

-
That's what I thought, but I wanted to be sure. Thank for help! –  Johnny Jan 3 '13 at 17:34
But the Law has a beautiful acronym LOTUS.... There is also a minor issue about whether or not the improper integral exists or works out to be the undefined form $\infty - \infty$ which is also likely more than the OP wants to know. –  Dilip Sarwate Jan 3 '13 at 17:43
Yeah, I thought about it but decided it would be overcomplicating it to write $g(X)^+$ and $g(X)^-$ and talk about what it means for an expectation to exist. At this rate we'll end up starting from measure theory. –  august Jan 3 '13 at 19:54

I think that that is true by definition.

-
The formal definition of the expectation is often quite different –  Ilya Jan 3 '13 at 17:21

Doesn't this result follow from the definition of expectation itself? For example the expectation of a function $g(X)$ is the value multiplied by probability of getting that value which is the same as the probability of getting $X=x$ which in turn is just the probability density function $f(x)$ of $X$. The integration between the $-\infty$ and $+\infty$ is to cover for all possible values of $x$.

-
For a continuous random variable $X$, for every $x$, the probability that $X=x$ is exactly zero, and not $f(x)$ (except for the values $x$ such that $f(x)=0$, of course). –  Did Jan 3 '13 at 19:48
If the expected value of $X$ is defined as $$E[X] = \int_{-\infty}^{\infty} x f_X(x)\,\mathrm dx$$ for continuous random variables that have a density function (whenever the integral exists, etc.: I am aware that there are more general as well as different definitions of expectation), then, if $h(X)$ is considered as a random variable $Y$, we have $$E[Y]=\int_{-\infty}^\infty yf_Y(y)\,\mathrm dy$$ while the result asked about says $$E[Y]=E[h(X)]=\int_{-\infty}^\infty h(x)f_X(x)\,\mathrm dx.$$ We need a theorem to say that both calculations give at the same result, and this theorem is LOTUS –  Dilip Sarwate Jan 3 '13 at 20:17