PDF of function of X I'm learning about functions of random variables and am trying to work out an example I made up. If $y = \sin(x)$ and $x$ has domain $[0, 4\pi]$, is the following the correct expression for the pdf of $y$:
$$\begin{align*}
f_Y(y) &= \frac{d}{dy}F_Y(y)\\
&= \frac{d}{dy}[F_X(2\pi) - F_X(\pi) + F_X(4\pi) - F_X(3\pi)]\\
&= \frac{d}{dx}F_X(2\pi)\left|\frac{dg^{-1}(y)}{dy}\right| - \frac{d}{dx}F_X(\pi)\left|\frac{dg^{-1}(y)}{dy}\right| + \frac{d}{dx}F_X(4\pi)\left|\frac{dg^{-1}(y)}{dy}\right| - \frac{d}{dx}F_X(3\pi)\left|\frac{dg^{-1}(y)}{dy}\right|\\
&=f_X(2\pi)\left|\frac{1}{\sqrt{1-0}}\right| - f_X(\pi)\left|\frac{1}{\sqrt{1-0}}\right| + f_X(4\pi)\left|\frac{1}{\sqrt{1-0}}\right| - f_X(3\pi)\left|\frac{1}{\sqrt{1-0}}\right|\\
&= f_X(2\pi) - f_X(\pi) + f_X(4\pi) - f_X(3\pi)\\
\end{align*}$$
 A: Draw a picture.
Although you can apply a standard formula for changes of variable, this one is tricky because the transformation $X\to Y$ is not one-to-one.  Often the most convenient and reliable method is to compute the distribution function (CDF) and then differentiate it.
The distribution function of $Y=\sin(X)$ is, by definition,
$$F_Y(y) = \Pr(Y \le y) = \Pr(\sin(X) \le y) = \Pr(\{X\,|\, \sin(X) \le y\}).$$
The latter probability is with respect to $X$.  The graph of $\sin$ has been emphasized where its height is less than or equal to $y$.  The values of $X$ where this occurs, shown in thick blue along the axis, show the set $\{x\in[0,4\pi]\,|\, \sin(x) \le y\}$.

When $0 \lt y$, this set consists of three disjoint intervals $\newcommand{s}{\sin^{-1}y}[0, \s]$, $[\pi -\s, 2\pi + \s]$, and $[3\pi - \s, 4\pi]$.  Because they are disjoint, the chance that $X$ lies within this union is the sum of the chances of each interval:
$$\eqalign{
\Pr(\sin(X) \le y) &= F_X(\s) - F_X(0) \\
&+ F_X(2\pi + \s) - F_X(\pi - \s)\\
&+1 - F(3\pi - \s).
}$$
The value $1 = F_X(4\pi)$ appeared because the range of $X$ is $[0, 4\pi]$.  However, we may not replace $F_X(0)$ by $0$ because possibly $X$ has nonzero probability there.
When $y \lt 0$, the set $\{X \in[0,4\pi]\,|\, \sin(X) \le y\}$ is the union of just two disjoint intervals:

By emulating the preceding argument, you should have no trouble writing down an expression for their probability in terms of $F_X$.
The PDF, when it exists, is the derivative of $F_Y$.  In the first case
$$f_Y(y) = \frac{d}{dy} F_Y(y) = \frac{d}{dy}\left(F_X(\s) - F_X(0) + F_X(2\pi + \s) \cdots - F(3\pi - \s)\right).$$
Apply the Chain Rule, recognizing that $\frac{d}{dy}\s = 1/\sqrt{1-y^2}$:
$$f_Y(y) = \frac{1}{\sqrt{1-y^2}}\left(f_X(\s) + f_X(\pi-\s) + f_X(2\pi+\s) + f_X(3\pi-\s)\right)$$
This formula can be understood for all $y$ provided we replace $f_X(\s)$ by $f_X(4\pi + \s)$ whenever $y \lt 0$.  Equivalently, and much more generally (with no restrictions on the range of $X$),
$$f_Y(y) = \frac{1}{\sqrt{1-y^2}}\sum_{i=-\infty}^\infty f_X(2i \pi + \s) + f_X((2i+1)\pi - \s).$$
