Finding density and distribution of $X=\tan(\theta)$?

1k Views Asked by At

Here is a problem I'm trying to solve and wanted to check if my solution was ok.

A searchlight is distance 1 from a wall. Let $Q$ denote the point on the wall directly opposite it and assume it scans along the wall so that at any given time, the angle, $\theta$, the beam of light makes with the perpendicular from the light to $Q$ is uniform on $(−\pi/2, \pi/2)$. Let $X\in \mathbb R$ be the position of the beam on the wall as measured from $Q$. Find the distribution and density functions for $X$.

My attempt: Drawing the picture, I believe $X=\tan(\theta)$ for $\theta \in (-\pi/2, \pi/2)$.The density of $\theta$, $f_{\theta}$, is $\frac{1}{\pi}$ on $(-\pi/2, \pi/2)$, $0$ everywhere else.

Taking $F_X,F_{\theta}$ to be the distribution functions of $X,\theta$:
\begin{align} F_X(x)=P(X\leq x)& =P(\tan(\theta)\leq x)\\ & =P(\theta \leq \arctan(x))\\ & =F_{\theta}(\arctan(x))\\ & =\int 1_{(-\infty, \arctan(x)]}\frac{1}{\pi} dy\\ & =\int_{-\pi/2}^{\arctan(x)}\frac{1}{\pi}dy\\ & =\frac{\arctan(x)}{\pi}+\frac{1}{2} \end{align}

Now taking the derivative of the distribution, $$f_X(x)=\frac{1}{\pi+\pi x^2}$$

Therefore we have $F_X(x)=\frac{\arctan(x)}{\pi}+\frac{1}{2}$, density $f_X(x)=\frac{1}{\pi+\pi x^2}$. It would be great if I could get this proof/calculation checked, and be corrected if/where I'm wrong.

Thank you.