<s>[INST] Probability Problem - Finding a pdf Below is a problem I did. However, I did not come up with the answer in book.
I am thinking that I might have the wrong limits for the integral. I am hoping
somebody can point out what I did wrong.
Bob
Problem
Let $Y = \sin X$, where $X$ is uniformly distributed over $(0, 2 \pi)$. Find
the pdf of $Y$.
Answer:
\begin{eqnarray*}
P(Y<=y_0) &=& P( \sin x <= y_0 ) = P( x <= \arcsin( y_0) ) \\
P(Y<=y_0) &=& \int_0^{\arcsin(y_0)} \frac{1}{2 \pi} dx =
    \frac{x}{2 \pi} \Big|_0^{\arcsin(y_0)} =
    \frac{\arcsin(y_0)}{2 \pi} - \frac{0}{2 \pi} \\
P(Y<=y_0) &=& \frac{\arcsin(y_0)}{2 \pi} \\
F(Y) &=& \frac{\arcsin(Y)}{2 \pi} \\
f(y) &=& \frac{1}{2 \pi \sqrt{1 - y^2}} \\
\end{eqnarray*}
However, the book gets:
\begin{eqnarray*}
f(y) &=& \frac{1}{\pi \sqrt{1 - y^2}} \\
\end{eqnarray*}
I believe that book is right because
\begin{eqnarray*}
\int_{-1}^{1} \frac{1}{\pi \sqrt{1 - y^2} } dy &=&
    \frac{\arcsin{y}}{\pi} \Big|_{-1}^{1} =
    \frac{\frac{\pi}{2}}{\pi} - \frac{-\frac{\pi}{2}}{\pi}  \\
\int_{-1}^{1} \frac{1}{\pi \sqrt{1 - y^2} } dy &=& 1 \\
\end{eqnarray*}
 [/INST] If $X$ is uniform in $(0,2\pi)$, then has cdf 
$$
F_X(x)=\begin{cases}
0 & x\le 0\\
\frac{x}{2\pi} & x\in (0,2\pi)\\
1 & x\ge 2\pi
\end{cases}
$$
The  random  variable $Y=\sin (X)$ takes  values  on $(-1,1)$. Hence, $\Bbb P(Y\le y) = 0$ for $y \le -1$ and $\Bbb P(Y\le y) = 1$ for $y \ge 1$. Let now $y \in (-1, 1)$. We have
$$
F_Y(y)=\Bbb P(Y\le y)=\Bbb P(\sin (X)\le y)
$$
The equation $\sin(x) = y$ has two solutions in the interval $(0, 2\pi)$: 


*

*$x = \arcsin(y)$ and $\pi-\arcsin(y)$ for $y > 0$ 

*$x = \pi-\arcsin(y)$ and $2\pi + \arcsin(y)$ for $y < 0$. 


Hence, $Y$ has positive values if $X$ takes values in $A_1=(0,\arcsin y)$ or $A_2=(\pi-\arcsin y,2\pi)$; $Y$ has negative values if $X$ takes values in $B=(\pi-\arcsin y,2\pi + \arcsin y)$. 

So we have for $-1<y<1$, 
$$
\Bbb P(Y\le y)=\begin{cases}
\Bbb P(X\in B)& -1<y< 0\\
\Bbb P(X\in A_1\cup A_2)=\Bbb P(X\in A_1)+\Bbb P(X\in A_2)& 0<y< 1\\
\end{cases}
$$
that is
$$
F_Y(y)=\begin{cases}
F_X(2\pi + \arcsin y) -F_X(\pi-\arcsin y)& -1<y< 0\\
F_X(\arcsin y) +1-F_X(\pi-\arcsin y)& 0<y< 1\\
\end{cases}
$$
and then
$$
F_Y(y)=\frac{\pi + 2 \arcsin(y)}{2\pi},\qquad y\in (-1,1)
$$
The distribution function of $Y$ is
$$
F_Y(y)=\begin{cases}
0 & y\le 0\\
\frac{\pi + 2 \arcsin(y)}{2\pi} & y\in (-1,1)\\
1 & y\ge 1
\end{cases}
$$
We differentiate the above expression to obtain the probability density:
$$
f_Y(y)=\begin{cases}
\frac{1}{\pi\sqrt{1-y^2}} & y\in (-1,1)\\
0 & y\notin (-1,1)
\end{cases}
$$
</s>