# Expectation of a random variable with function

fX(x) = 1/3*x^2 for x in [-1,2] and 0 otherwise

Y = X^2 Find E(Y)

My solution:

$$fX(x) = 1/3*x^2 So FX(x) = x^3/9$$

$$p(Y < y) =$$

$$p(x^2 < y) =$$

$$p (x < √y) =$$

$$FX(√y) = (√y^3)/9 = FY(y)$$ So

$$fY(y) = 1/9*y^(1/2) = 1/6 * y ^(1/2)$$

so $$E(x) = \int (1/6y^(1/2)y dy) = 1/15$$

What's wrong with this?

• As for the math question, note that $X$ can be negative. Apr 8, 2019 at 1:09

Your calculation of $$F_X(x) = \Pr[X \le x]$$ is wrong because $$X \in [-1,2]$$. Instead, $$\int_{t=\color{red}{-1}}^x f_X(t) \, dt = \int_{t=-1}^x \frac{t^2}{3} \, dt = \left[\frac{t^3}{9} \right]_{t=-1}^x = \frac{x^3 + 1}{9},$$ consequently $$F_X(x) = \begin{cases} 0, & x < -1 \\ \frac{x^3 + 1}{9}, & -1 \le x \le 2 \\ 1, & x > 2. \end{cases}$$
You calculation of $$F_Y$$ is also incorrect for the same reason; i.e. $$X$$ may be negative. However, it is not necessary to compute $$f_Y$$ or $$F_Y$$ explicitly. We simply compute $$\operatorname{E}[Y] = \operatorname{E}[X^2] = \int_{x=-1}^2 x^2 f_X(x) \, dx = \int_{x=-1}^2 \frac{x^4}{3} \, dx = \left[ \frac{x^5}{15} \right]_{x=-1}^2 = \frac{33}{15} = \frac{11}{5}.$$