Random distributed variable - using PDF 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!
 A: 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$...
A: $Y= \phi(X) = X^2$ on the given interval is both decreasing and increasing, so you need multiply the result by 2. Obviously $Y \geq 0$. So to use the pdf of X you need
$$
G_{Y}(y) = P(Y \leq y) = P( \phi(X) \leq y)=P(-\phi^{-1}(y) \leq X \leq \phi(y)) = \int_{-\phi^{-1}(y)}^{\phi^{-1}(y)} f = F(\phi^{-1}(y)) - F(-\phi^{-1}(y)), \ y \geq 0 
$$
To get $g_{Y}(y)$, differentiate wrt to $y$:
$$
g(y) = \frac{1}{2 \sqrt{2 y}} f(\sqrt{y}) + \frac{1}{2 \sqrt{y}} f(-\sqrt{y})
$$
OR split the domain of $X$ into monotone decreasing and increasing intervals, and compute $g$ for each interval, but in this case derivative must be taken with aboslute sign:$|\frac{d \phi^{-1}(y)}{dy} |$.
EDIT: keep in mind on both intervals derivatives vary only in sign, so after taking the absolute value they become both positive, you can just double it: $2 | \frac{d \phi^{-1}(y)}{dy} |$.
A: You need to properly distinguish between (capital) $X$ and (lower-case) $x$ or you'll get very confused.
For every real number $x,$ we have $F_X(x) = \Pr(X\le x). $
Notice where $X$ (not $x$) appears in the line above, and where $x$ (not $X$) appears.
And notice the word "every". This means, for example, that $F_X(3.14) = \Pr(X\le 3.14).$ And similarly for any other number than $3.14.$ That is the role of the lower-case $x.$ The capital $X,$ on the other hand, the random variable. That's what the capital $X$ in the subscript means in the expression $F_X(x).$ The lower-case $x$ in that same expression has a different role—technically it is what is called a bound variable, and that is why it is permissible to use the word "every" with it in that way.
You have
\begin{align}
& F_Y(y) = \Pr(Y\le y) = \Pr(X^2 \le y) = F_{X^2}(y) \\[8pt]
\text{and } & \Pr(X^2 \le y) = \Pr(-\sqrt y \le X\le \sqrt y) \\[8pt]
= {} & F_X(\sqrt y) - F_X(-\sqrt y). 
\end{align}
Here we must be careful about one point: In general we have
$$
\Pr(a<X\le b) = \Pr(X\le b) - \Pr(X\le a).
$$
But here we had in effect $a\le X\le b$ rather than $a<X\le b.$ The reason why equality still holds is that this c.d.f. has no discontinuities (although the p.d.f. does).
Now the chain rule tells us:
\begin{align}
f_Y(y) & = \frac d {dy} F_Y(y) = \frac d {dy} \big( F_X(\sqrt y) - F_X(-\sqrt y) \big) \\[8pt]
& = f_X(\sqrt y) \cdot \frac d {dy} \sqrt y - f_X(-\sqrt y) \cdot \frac d {dy}(-\sqrt y).
\end{align}
And so on.
