The pdf of $\tan X$ when $X$ is Uniform

probabilityprobability distributionsstatistics

Let $X$ be a random variable with pdf

$$ f(x) = \begin{cases} \frac{1}{\pi}, & \text{if } -\frac{\pi}{2} < x <\frac{\pi}{2} \\ 0, & \text{elsewhere} \end{cases} $$

Find the pdf of $Y = \tan(x)$.

My attempt:

$$F_Y(y) = P(Y\le y) = P(\tan(x)\le y) = P(x\le \tan^{-1}(y))=F_X(\tan^{-1}y) = \begin{cases} 0,&\text{if } x<-\frac{\pi}{2} \\ \frac{1}{\pi}{\tan^{-1}y}, & \text{if } -\frac{\pi}{2} \leq x <\frac{\pi}{2} \\ 1, & \text{if } x\geq \frac{\pi}{2} \end{cases}$$

$$ f_Y(y) = \begin{cases} \frac{1}{\pi} \frac{1}{1+x^2}, & \text{if } -\frac{\pi}{2} < x <\frac{\pi}{2} \\ 0, & \text{elsewhere} \end{cases} $$

Am I on the right path?

Best Answer

\begin{align}F_Y(y) &= P(Y\le y) \\&= P(\tan(\color{red}X)\le y) \\&= P(X\le \tan^{-1}(y))\\&=F_X(\tan^{-1}y) \\&= \frac{1}{\pi}\left({\tan^{-1}y}+\frac{\pi}2 \right)\end{align}

$$ f_Y(y) = \frac{1}{\pi} \frac{1}{1+y^2} $$

Related Question