I am currently trying to solve a problem and can't figure it out. I have done this before, but I can't remember all of the details and can't find a reference example.
Let's say I have a pdf
$$f(x)=\frac{x^2}{16}\,\,\text{ for }-2\le x\le 2\,;\,0\text{ otherwise }$$
and I want to find the expected value for $Y = X^2$.
With LOTUS I would do the following
$$E[X^2]=\int_{-\infty}^\infty x^2f_X(x)\,dx$$
So in this specific case, I would calculate
$$E[Y]=E[X^2]=\int_{-2}^2 x^2\cdot\frac{x^2}{16}\,dx=\int_{-2}^2 \frac1{16}x^4\,dx=\left(\frac1{80}2^5-\frac1{80}(-2)^5\right)$$
However, there are two things I am confused with and I can't remember or find a good example:
I do have the feeling I need to transform the boundaries. Maybe I am wrong...
If the the boundaries go from negative to positive, I have the feeling that the last term $\left(\frac1{80}2^5-\frac1{80}(-2)^5\right)$ is wrong. The closest thing I could find was Find expected value using CDF but maybe you could shed some light on it.
Thanks for the help!