How can I show that for $a>0$, $Y=a \tan(X)$ and $Y'=a \tan(X/2)$ have the same distribution when $X$ Is $U(-\pi,\pi)$. It seems that this is true since the function $\tan$ takes all values from $-\infty$ to $\infty$ for $x \in (-\pi/2,\pi/2)$, which is the same as in the case of when $x \in (-\pi,\pi)$.
I am trying to solve exercise 11.8 in probability essentials where I want to compute the density of $f_Y(y)$ of $Y=a \tan(X)$ where, $X$ is $U(-\pi,\pi)$ distributed and $a>0$.
The problem is that I can write $\arctan (\tan x)=x$ only for $x \in (-\pi/2,\pi/2) $ inorder to use the formula in Corollary 11.2 in the books which says $f_Y(y)=f_X(h(y)) \vert h(y)'\vert$ where $h(x)=g^{-1}(x)$ and $Y=g(X)$.