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*}

your answer is correct indeed just a little mistake. in the first step:
$$P(Y \le y) = P( \sin x \le y ) \Rightarrow P(x_1 \le x \le x_2  )$$ as shown in figure below (sorry figure is for $y=\sin(x+\theta)$ but still is useful .just draw the figure for $\sin(x)$ in your imagination. also figure is from "Probability, Random Variables and Stochastic Processes" by Papoulis A. chapter 5 example 7. which is very similar to your problem).

since $\sin(x)$ intersects with each horizontal line two times. so we can now write the right answer as below:
$$P(Y \le y)= \frac{1}{2\pi} \int_0^{x_{1}}dx+\frac{1}{2\pi} \int_{x_{2}}^{2\pi}dx$$
and we have in mind that $x_2=\pi-\arcsin(y)=\pi-x_1$ so we get:
$$P(Y \le y)= \frac{1}{2\pi} \int_0^{x_{1}}dx+\frac{1}{2\pi} \int_{x_{2}}^{2\pi}dx = \frac{1}{2\pi}\times (x_{1}+2\pi-x_{2})=\frac{1}{2\pi}\times (x_{1}+\pi+x_{1}) \\ = \frac{1}{2\pi}\times (2x_{1}+\pi)=\frac{1}{2}+\frac{1}{\pi}\arcsin(y)$$
now by taking derivative with respect to $y$ we get:
$$f(y) = \frac{1}{\pi \sqrt{1 - y^2}}$$
EDIT
To answer the question in comments, when $y=a\sin(x+\theta)$ and $x$ is uniform on $(0,2\pi)$ and we want to find $F(y),f(y)$ i.e. CDF and PDF of $y$. We want to find $F(y)=P(Y\le y)$. To find where $Y\le y$ notice that according to the figure above, this happens in two intervals (when the sine figure is less than the $y$ line) which is $x\in (-\pi,x_0)$ and when $x \in (x_1,\pi)$. Therefore
$$P(Y \le y) = P((-\pi,x_0) \cup (x_1,\pi)) = P((-\pi,x_0)) + P((x_1,\pi))$$
The total length of this interval is $(x_0 - (-\pi)) + (\pi-x_1) = 2\pi + x_0 - x_1$ and $x_0 = \text{Arcsin}\left(\frac{y}{a}\right)-\theta , x_1 = \pi - \text{Arcsin}\left(\frac{y}{a}\right) - \theta $ which results from solving $y = a\sin(x+\theta)$. Substituting these in
$$P(Y \le y) = \frac{1}{2\pi}(2\pi + x_0 - x_1) = \frac{1}{2} + \frac{1}{\pi}\text{Arcsin}\left(\frac{y}{a}\right)$$.
Also please notice that since $x_1 = \pi - x_0 - 2\theta$ the length of the interval can also be written as $L = 2\pi + x_0 - x_1 = \pi + 2x_0 + 2\theta$ which results in the same solution.
