Finding a Distribution When Introducing an Auxiliary Random Variable Let (X,Y) be uniform on the unit ball; that is,
$f_{(X,Y)}(x,y)=\begin{cases}
\frac{1}{\pi}, &\text{if $x^{2}+y^{2}\leq 1$}\\
0, &\text{otherwise.}
\end{cases}$
Find the distribution of $R=\sqrt{X^{2}+Y^{2}}$.
(Hint: introduce the auxiliary random variable $S=\arctan(\frac{Y}{X})$.)
Any help you could give would be greatly appreciated!
 A: This solution will ignore then hint for the sake of presenting a method that is often useful in calculating probabilities -- writing the probability as an expectation.  We can first notice that if $t \in \mathbb{R}$ then $P(R \leq t) = 0$ unless $t \geq 0$ and $P(R \leq t) = 1$ whenever $t > 1$ (why!?).  So, the only "interesting" stuff happens for $0 \leq t \leq 1$. Now, with $t$ in this range we have $P(R \leq t) = P(X^2+Y^2 \leq t^2)$. From here consider the function
$$
g(x,y) = 
\begin{cases}
1 & x^2 + y^2 \leq t^2 \\
0 & \text{otherwise}
\end{cases}
$$
That is, $g$ is the characteristic function of the disc $x^2+y^2 \leq t^2$. Then
$$
P(X^2+Y^2 \leq t^2) = E[g(X,Y)] = \iint_{\mathbb{R}^2} g(x,y)f_{X,Y}(x,y)dxdy
$$ 
Now,
$$
\iint_{\mathbb{R}^2} g(x,y)f_{X,Y}(x,y)dxdy = \frac{1}{\pi}\iint_{\{(x,y):x^2+y^2\leq t^2\}} dxdy
$$
where the last equality comes from the fact that 
$$
g(x,y)f_{X,Y}(x,y) = 
\begin{cases}
1/\pi & x^2 + y^2 \leq t^2 \\
0 & \text{otherwise}
\end{cases}
$$ You will recognize that the last double integral gives the area of the disc of radius $t$, so putting these pieces together we get the equality
$$
P(R \leq t) = \frac{1}{\pi}\iint_{\{(x,y):x^2+y^2\leq t^2\}} dxdy = \frac{\pi t^2}{\pi} = t^2. 
$$
We have now found the cumulative distribution function of $R$
$$
F_R(t) = P(R \leq t) = \begin{cases}
0 & t < 0 \\
t^2 & 0 \leq t \leq 1 \\
1 & t > 1
\end{cases}
$$
So, the density of $R$ is $f_R(t) = F'_R(t)$, leaving us with
$$
f_R(t) = \begin{cases}
0 & t < 0 \text{ or } t > 1 \\
2t & 0 \leq t \leq 1
\end{cases}
$$
A: Let $g(x,y)=(\sqrt{x^2+y^2},\arctan(\frac yx))$ 
if we write $r=\sqrt{x^2+y^2}$ then ($0\le r\le1$) and $\theta=\arctan(\frac yx)$ then the inverse of $g$ would be;
$g^{-1}(r,\theta)=(r\cos\theta, r\sin\theta)$,  
$g$ is not injective and
$h^{-1}(r,\theta)=(-r\cos\theta, -r\sin\theta)$ would be a second inverse.
The Jacobian of $g^{-1}$ is given by $|J_{g^{-1}}|=\bigg|det\begin{bmatrix}cos\theta & sin\theta\\-r\sin\theta & r\cos\theta\end{bmatrix}\bigg|=|r|=r$
Hence
$f_{(R,\Theta)}(r,\theta)=r\mathbf 1_{(0,1)}(r)\bigg(f_{X,Y}(r\cos\theta, r\sin\theta)+f_{X,Y}(-r\cos\theta, -r\sin\theta)\bigg)$ 
$\displaystyle=r\frac{1}{\pi}+\frac{1}{\pi}=\frac{2r\mathbf 1_{(0,1)}(r)}{\pi}$ 
We want to find the marginal density, Therefore
$\displaystyle f_R(r)=\int\limits_{-\pi/2}^{\pi/2}\frac{2r\mathbf 1_{(0,1)}(r)}{\pi}d\theta=2r\mathbf 1_{(0,1)}(r)$
