I have this PDF ($X$ is a random variable):
$$f(x)=\begin{Bmatrix} \frac{1}{8}x+\frac{1}{2} & \text{if } {-2}<x<2\\0 & \text{else} \end{Bmatrix}$$
And I need to calculate the PDF of $Y = X^2$
I know that $P(Y \leq X) = P(X^2 \leq X) = P(X \leq \sqrt{X}) = F(\sqrt{X})$
and that $f(x) = F'(X)$
But I am stuck from here, how do I differentiate $F$ ? because using the chain rule I know that:
$F'(\sqrt{X}) = \frac{1}{2\sqrt{X}} F'(X) = \frac{1}{2\sqrt{X}} f(X)$
and then what? I multiply $f(x)$ that I have with $\frac{1}{2\sqrt{X}}$ ?? that does not seem right!
I would appreciate your help! Thank you!
Let's rewrite this a little more carefully and it will become clear. $Y = X^2$ so let's find the CDF of $Y$: $$ \begin{split} F_Y(y) &= \mathbb{P}[Y \le y] \\ &= \mathbb{P}[X^2 \le y] \\ &= \mathbb{P}\left[|X| \le \sqrt{y}\right] \\ &= \mathbb{P}\left[-\sqrt{y} \le X \le \sqrt{y}\right] \\ &= F_X\left(\sqrt{y}\right) - F_X\left(-\sqrt{y}\right) \end{split} $$ and therefore, the pdf would be $$ \begin{split} f_Y(y) &= F_Y'(y) \\ &= \frac{d}{dy} \left[ F_X\left(\sqrt{y}\right) - F_X\left(-\sqrt{y}\right)\right] \\ &= \frac{f_X\left(\sqrt{y}\right)}{2\sqrt{y}} + \frac{f_X\left(-\sqrt{y}\right)}{2\sqrt{y}} \\ &= \frac{f_X\left(\sqrt{y}\right) + f_X\left(-\sqrt{y}\right)}{2\sqrt{y}} \\ \end{split} $$ But you have to be careful with intervals on which $y$ is defined. For example, if $y > 2$, then $F_X(y)=1$ and if $y < -2$ then $F_X(y) = 0$...