# Given $X\sim\text{Unif}(0,2\pi)$, find the probability density function of $Y = \sin(X)$

Given $$X\sim\text{Unif}(0,2\pi)$$, find the probability density function of the derived RV $$Y = \sin(X)$$.

I attempted the equation as follows however I am confused how to get the range of the PDF as well as the integration limit.

My attempt is here • You wrote that $X$ is exponentially distributed, but the work seems to say it is uniform on 0 to $2\pi$. Apr 6, 2021 at 16:07
• oh yeah my bad.. its uniformly, changing it now... Apr 6, 2021 at 16:09
• Please use MathJax for typesetting instead of pictures. Apr 6, 2021 at 16:47
• And do search the site: math.stackexchange.com/q/118108/321264, math.stackexchange.com/q/1026366/321264. Apr 6, 2021 at 16:53

Solution 1. The range of $$Y=\sin X$$ with $$X\in[0,2\pi]$$ is $$[-1,1]$$ not $$[0,0]$$ because $$\sin$$ is not monotone. You can draw the graph of $$\sin$$ with $$X\in[0,2\pi]$$ to see the range.

For $$y\in[0,1]$$, $$Y=\sin X\leq y\iff 0\leq X\leq\arcsin y\quad\text{or}\quad\pi-\arcsin y\leq X\leq 2\pi.$$ Thus, \begin{align*} F_Y(y)&=P(Y\leq y)=P(0\leq X\leq\arcsin y)+P(\pi-\arcsin y\leq X\leq 2\pi) \\ &=\frac{\arcsin y}{2\pi}+\frac{\pi+\arcsin y}{2\pi}=\frac{1}{2}+\frac{\arcsin y}{\pi}. \end{align*} For $$y\in[-1,0)$$, $$Y=\sin X\leq y\iff\pi-\arcsin y\leq x\leq 2\pi+\arcsin y.$$ Thus. \begin{align*} F_Y(y)&=P(Y\leq y)=P(\pi-\arcsin y\leq x\leq 2\pi+\arcsin y) \\ &=\frac{\pi+2\arcsin y}{2\pi}=\frac{1}{2}+\frac{\arcsin y}{\pi}. \end{align*} Therefore, $$F_Y(y)=\begin{cases} 1, & y>1; \\ \displaystyle\frac{1}{2}+\frac{\arcsin y}{\pi}, & y\in[-1,1]; \\ 0, & y<-1. \end{cases}$$ Consequently, $$f_Y(y)=\begin{cases} 1/(\pi\sqrt{1-y^2}), & y\in[-1,1]; \\ 0, & \text{Otherwise}. \end{cases}$$

Solution 2. Of course we can use the transformation formula on r.v.'s to obtain the density of $$Y$$. Nonetheless, since $$sin$$ is not monotone, we have to use a generalized version of transformation formula. Here is Theorem 2.1.8 abstracted from Statistical Inference by George Casella:

Theorem 2.1.8. Let $$X$$ have pdf $$f_X(x)$$, let $$Y=g(X)$$, and define the sample space $$\mathcal{X}=\{x\mid f_X(x)>0\}$$. Suppose there exists a partition $$A_0,A_1,\ldots,A_k$$ of $$\mathcal{X}$$ such that $$P(X\in A_0)=0$$ and $$f_X(x)$$ is continuous on each $$A_i$$. Further, suppose there exist functions $$g_1(x),\ldots,g_k(x)$$, defined on $$A_1,\ldots,A_k$$, respectively, satisfying: i) $$g(x)=g_i(x)$$ for $$x\in A_i$$, ii) $$g_i(x)$$ is monotone on $$A_i$$, iii) The set $$\mathcal{Y}=\{y\mid y=g_i(x)\ \text{for some}\ x\in A_i\}$$ is the same for each $$i=1,\ldots,k$$, and iv) $$g_i^{-1}(y)$$ has a continuous derivative on $$\mathcal{Y}$$ for each $$i=1,\ldots,k$$. Then $$f_Y(y)=\begin{cases} \sum_{i=1}^{k}{f_X(g_i^{-1}(y))}\left|\frac{d}{dy}g_i^{-1}(y)\right|, & y\in\mathcal{Y}; \\ 0, & \text{Otherwise}. \end{cases}$$

Intuitively we would observe that the function $$\sin X$$ is monotone on $$A_1=[0,\pi/2]$$, $$A_2=(\pi/2,3\pi/2]$$, $$A_3=(3\pi/2,2\pi]$$. However, the condition iii) is violated as the ranges for $$x\in A_i$$ are not equal: $$\sin(A_1)=[0,1]$$, $$\sin(A_2)=[-1,1]$$ and $$\sin(A_3)=[-1,0]$$. To apply the theorem, we have to split $$A_2$$ into $$A_{2,1}=[\pi/2,\pi]$$ and $$A_{2,3}=[\pi,3\pi/2]$$ so that we can apply theorem to $$\mathcal{Y}_1=[0,1]$$ ($$A_1$$ and $$A_{2,1}$$) and $$\mathcal{Y}_3=[-1,0]$$ ($$A_{2,3}$$ and $$A_3$$) separately.

For $$y\in[0,1]$$, we have \begin{align*} g_1^{-1}(y)&=\arcsin y; \\ g_{2,1}^{-1}(y)&=\pi-\arcsin y. \end{align*} Thus, $$f_Y(y)=\frac{1}{2\pi}\cdot\frac{1}{\sqrt{1-y^2}}+\frac{1}{2\pi}\cdot\left|-\frac{1}{\sqrt{1-y^2}}\right|=\frac{1}{\pi\sqrt{1-y^2}}.$$

Likewise for $$y\in[-1,0]$$, \begin{align*} g_{2,3}^{-1}(y)&=\pi-\arcsin y; \\ g_3^{-1}(y)&=2\pi+\arcsin y. \end{align*} This entails $$f_Y(y)=\frac{1}{2\pi}\cdot\left|-\frac{1}{\sqrt{1-y^2}}\right|+\frac{1}{2\pi}\cdot\frac{1}{\sqrt{1-y^2}}=\frac{1}{\pi\sqrt{1-y^2}}.$$

Together, we have the same result as before.

The following picture illustrates how I obtained the inverse function: • Is there a way to use the monotonicity of $\sin x$ on subintervals of a partition of $[-1,1]$?
– Anon
Apr 6, 2021 at 16:40
• @Kaind Of course yes. In George Cassella's Statistic Inference, Theorem 2.1.8 sketches the idea of such type of transformation. I will update my answer to include this approach. Apr 6, 2021 at 16:44
• how did u get π−arcsiny ≤ X ≤2 π. Apr 6, 2021 at 16:53
• @JeffreyAnders Please see the picture attached in my answer. Apr 6, 2021 at 17:23
• I take $y\in[0,1]$ for example. Imagine you draw a horizontal line with $y$-intercept $y$. It will naturally intersect the graph at two points, which are symmetric about $\pi/2$. In particular, by the definition of $\arcsin$, the $x$-coordinate of the left point is $\arcsin y$, so the $x$-coordinate of the right point is $\pi-\arcsin y$. By the graph, we can see that $Y=\sin X\leq y$ implies $0\leq X\leq\arcsin y$ and $\pi-\arcsin y\leq X\leq 2\pi$. The analysis is the same for $y\in[-1,0]$. Apr 6, 2021 at 18:19