I am studying measure theory expectation and I encountered the following problem.
Let $X\sim\exp(1)$. Calculate $EX^n$ for every $n\in \mathbb{N}$.
We know that the density function is $\exp(-x)$ when $x\ge0$ and zero otherwise. I am having a hard time understanding measure theory expectation and how I am supposed to take it into account in this problem. Shouldn't the expectation be
$$\int_\Omega x^n\exp(-x)dx$$
but to be honest, I don't know how to go on from here either.
The probability density function is $$f(x)=\begin{cases} e^{-x} \space\space \space \space \space x\geq0, \\0\space\space\space\space\space\space\space\space\space x<0\end{cases}$$
as you correctly mentioned. Now to compute the required expectation we use the Gamma function:
$$\Gamma(z)=\int_{0}^{\infty}x^{z-1}e^{-x}dx,\space\space\space \Re(z)>0.$$
Moreover for any positive integer $z$ we have $\Gamma(z)=(z-1)!.$
Thus the required expectation is given by $$\mathbb E(X^{n})=\int_{-\infty}^{\infty}x^nf(x)dx=\int_{0}^{\infty}x^ne^{-x}dx$$ $$=\int_{0}^{\infty}x^{(n+1)-1}e^{-x}dx=\Gamma(n+1)=n! $$
since $n\in\mathbb N$.