polar transformation of uniform distribution if $x$ and $y$ are two independent random variables with uniform distribution in (0,1) , then what is the distribution of random variables $r$ and $\theta$ with definitions: 
$$r=\sqrt({x^2}+{y^2}) $$
$$\theta = \arctan \frac yx$$
And what I have done is finding regions of $r$ and $\theta$ . I think:
region of $r$ : circle C=((0,0),$\sqrt 2$)
region of $\theta$ : (0 , $\frac \pi2$)
but I could not proceed anymore.
thanks in advance.
 A: For the probability density function of $r$, you need to compute the integral
$$p(r)=\int_0^1\int_0^1 dx dy\delta\left(r-\sqrt{x^2+y^2}\right)\ .$$
Calling $f(x)=r-\sqrt{x^2+y^2}$, you first need to identify the roots $f(x^*)=0$ that lie within $(0,1)$. There is only one, $x^*=\sqrt{r^2-y^2}$. Therefore your integral is equivalent to
$$
p(r)=\int_0^1\int_0^1 dx dy\frac{\delta(x-\sqrt{r^2-y^2})}{|f'(x^*)|}=r\int_0^1\int_0^1 dx dy\frac{\delta(x-\sqrt{r^2-y^2})}{\sqrt{r^2-y^2}}\ .
$$
Now you can use the Dirac delta to kill the $x$ integral. Note that, in doing so, you need to impose that $0<\sqrt{r^2-y^2}<1$ and $0<y<1$, resulting in: if $0<r<1$, $0<y<r$, and if $1<r<\sqrt{2}$, then $\sqrt{r^2-1}<y<1$. Hence
$$
p(r)=r\left[\mathbb{1}_{0<r<1}\int_{0}^r dy\frac{1}{\sqrt{r^2-y^2}}+\mathbb{1}_{1<r<\sqrt{2}}\int_{\sqrt{r^2-1}}^1 dy\frac{1}{\sqrt{r^2-y^2}}\right]
$$
$$
=r\left[\frac{\pi}{2}\mathbb{1}_{0<r<1}+\mathbb{1}_{1<r<\sqrt{2}}(\mathrm{arccsc}(r)-\mathrm{arctan}\left(\sqrt{r^2-1}\right))\right]\ ,
$$
which is correctly normalized, $\int_0^\sqrt{2}dr\ p(r)=1$.
Similarly for $P(\theta)$
$$
P(\theta)=\int_0^1\int_0^1 dx dy\delta\left(\theta-\mathrm{arctan}(y/x)\right)\ .
$$
Define your function $g(y)=\theta-\arctan(y/x)$, whose only zero for $\theta\in [0,\pi/2]$ is at $y^*=x\tan\theta$. Therefore
$$
P(\theta)=\int_0^1\int_0^1 dx dy\frac{\delta(y-x\tan\theta)}{|g'(y*)|}=(1+\tan^2\theta)\int_0^1\int_0^1 dx dy\ |x|\delta(y-x\tan\theta)\ .
$$
Now, we can kill the $y$-integral by imposing that $0<|x|\tan\theta<1$ and $0<x<1$, resulting in
$$
P(\theta)=(1+\tan^2\theta)\left[\mathbb{1}_{0<\tan\theta<1}\int_0^1 dx\ x+\mathbb{1}_{\tan\theta>1}\int_0^{\cot\theta} dx\ x\right]=
$$
$$
=(1+\tan^2\theta)\left[\frac{1}{2}\mathbb{1}_{0<\theta<\pi/4}+\mathbb{1}_{\pi/4<\theta<\pi/2}\frac{1}{2}\cot^2\theta\right]\ ,
$$
which is correctly normalized, $\int_0^{\pi/2}d\theta P(\theta)=1$.
