# deriving pdf with two methods, with two different results

I have this problem to determine a density function $$f_{Y}(y)$$ of $$Y$$ given $$X$$ as a random variable with uniform distribution on $$[−1, 1]$$ and $$Y = X^2$$. So: $$f_X(x) = \frac{1}{2}$$ for $$x \in [-1, 1]$$. I approached this problem with two different ways, 1) through determining first the $$F_Y$$ as the $$CDF$$, then derive from it $$PDF$$ 2) by transformation.

For the first method I got $$f_Y(y) = \frac{1}{2\sqrt(y)}$$ for $$y \in ]0, 1]$$ This seems correct. However, for transformation method, I tried the following:

$$g(x) = x^2$$ and $$g'(x) = 2x$$

$$x_1 = g^{-1}(y) = \sqrt(y)$$

so $$f_Y(y) = \frac{f_X(x_1)}{|g'(x_1)|} = \frac{1/2}{2\sqrt(y)} = \frac{1}{4\sqrt(y)}$$

Also, there is the example of $$Y = X^3$$, then:

$$g(x) = x^3$$ and $$g'(x) = 3x^2$$

$$x_1 = g^{-1}(y) = \sqrt(y)$$

so $$f_Y(y) = \frac{f_X(x_1)}{|g'(x_1)|} = \frac{1/2}{3\sqrt(y)^2} = \frac{1}{6\sqrt(y)^2}$$ but the correct answer is $$\frac{1}{3\sqrt(y)^2}$$

• No, the answer with the 6 is correct: $\int_{-1}^1 x^{-2/3} dx=3 - (-3)=6$.
– Ian
Dec 8, 2022 at 16:09
• Right, the one with 3 would be correct in case the interval is $[0, 1]$, then $f_X(x) = 1$
– Papa
Dec 8, 2022 at 16:39

This idea that you proposed only works if the transform $$g(\cdot)$$ is one to one.

https://www.math.arizona.edu/~jwatkins/f-transform.pdf

This is why the following reasoning is incorrect, for instance, if $$g(x)=x^2$$

\begin{align} f_Y(y)&=f_X(g^{-1}(y))\Big| \frac{d}{dy}g^{-1}(y) \Big| \\ &= \frac{1}{2} \Big| \frac{1}{2} y^{-1/2} \Big| \end{align}

The correct would be

\begin{align} F_Y(y) &= P(Y \leq y) = F_X(\sqrt{y})- F_X(-\sqrt{y}) \\ f_Y(y)&= \frac{1}{2\sqrt{y}}(f_X(\sqrt{y})+f_X(-\sqrt{y})) = \frac{1}{2\sqrt{y}} \end{align}

• For $X^3$ where the transform should be one to one, also doesn't work
– Papa
Dec 8, 2022 at 14:48
• please, check the PDF pointed in the answer, and let us know what doesn't work Dec 8, 2022 at 14:50
• I gave the example
– Papa
Dec 8, 2022 at 14:57