transformation of random variable when given function is not invertible Let $X$ be a random variable with density function given by
$$
\begin{eqnarray}
f_X(x) =\left\{
\begin{array}{cc}
 \frac{2x}{\pi^2}  & \text{for} \quad  0 < x < \pi \\
        0  &    \text{otherwise}.
\end{array}
\right.
\end{eqnarray}
$$
Find the distribution of $Y = \sin(X)$.

$$F_Y(a)=P(\sin(X)\leq a)=\bigg( \int_0^{\sin^{-1}(a)} f_X(x) dx\bigg) + \bigg( \int_{\pi-\sin^{-1}(a)}^{\pi} f_X(x) dx\bigg)
$$
$$=\bigg( F_X(\sin^{-1}(a))- F_X(0)\bigg) +\bigg( F_X(\pi) -F_X(\pi-\sin^{-1}(a))\bigg)
$$
$$=\bigg( \frac{(\sin^{-1}(a))^2}{\pi^2}- 0\bigg) +\bigg( 1-\frac{(\pi-\sin^{-1}(a))^2}{\pi^2}\bigg)
$$
$$=1-\frac{(\pi-\sin^{-1}(a))^2}{\pi^2} + \frac{(\sin^{-1}(a))^2}{\pi^2}
$$
$$=1-\frac{\pi^2-2\pi\sin^{-1}(a)}{\pi^2} 
$$
$$=\frac{2\sin^{-1}(a)}{\pi} 
$$
so 
$$f_Y(a)=\frac{2}{\pi\sqrt{1-a^2}} \quad a\in[0,1]
$$

another way
$$
f_Y(y)=|\frac{d \sin^{-1}(y)}{dy}|f_X(\sin^{-1}(y))+|\frac{d( \pi-\sin^{-1}(y))}{dy}|f_X(\pi-\sin^{-1}(y))
$$
$$
f_Y(y)=|\frac{1}{\sqrt{1-y^2}}|f_X(\sin^{-1}(y))+|\frac{1}{\sqrt{1-y^2}}|f_X(\pi-\sin^{-1}(y))
$$
$$
=|\frac{1}{\sqrt{1-y^2}}|\frac{2\sin^{-1}(y))}{\pi^2}+|\frac{1}{\sqrt{1-y^2}}|\frac{2(\pi-\sin^{-1}(y))}{\pi^2}
$$
