# Where am I going wrong when doing this transformation for a pdf?

I have the pdf of $X$: $f(x) = 2x \ \ \ \text{if}\ \ \ 0<x<1$ and $0$ elsewhere. Then I am asked to the get the expectation: $$E\left(\frac{1}{X}\right)$$ to which I get the following: $$E\left(\frac{1}{X}\right) = \int_0^1 \left(\frac{1}{x}\right)(2x)dx = 2$$ From there I am asked to do the transformation of $Y = \frac{1}{X}$ so I then use the transformation: $$f_Y(y) = f_X(g^{-1}(y)) \mid J \mid$$ to which I get that: $$f_Y(y) = \frac{2}{y^3}$$ The only problem is that the integral from 0 to 1 does not exist for this... This is where I am stuck and do not know what I did wrong. I figured this would work considering that $f_X(x)$ is an open interval which does not contain 0. Which is why I don't know what to do to change this any suggestions would be greatly appreciated

• But $Y$ takes values from $1$ to $\infty$! – RideTheWavelet Oct 13 '17 at 3:41
• I see my mistake now thank you – Robert Oct 13 '17 at 3:44

$Y$ has all it's probability in the interval $[1,+\infty)$, since $$P(Y\geq 1)=P\left(\tfrac1X \geq 1>0\right)=P(X\leq 1)=1.$$
So the function that you found is indeed a pdf cause its integral from $1$ to $+\infty$ adds up to $1$ (check it!).