# distribution of $X^2 + Y^2$

Suppose $X$ and $Y$ are independent uniform distributions between $(0,1)$. What is the distribution of $X^2 + Y^2$?

I derived that the pdf of $X^2$ is $\frac{1}{2\sqrt{x}}$ for $0\leq x \leq 1$. How can I continue from here?

• You do the same for $Y^2$ and then you got the sum by convolution statweb.stanford.edu/~susan/courses/s116/node114.html – aflous Apr 24 '14 at 13:51
• thanks, so I need to evaluate $\frac{1}{4} \int_{0}^1 \frac{1}{\sqrt{z-y}} \frac{1}{\sqrt{y}} dy$. The integral seems not trivial. Can you give me some hint? – neticin Apr 24 '14 at 14:12

Set $Z=X^2+Y^2$. Since $X$ and $Y$ are continuous and independent random variables, $$f_Z(z)=\int_{-\infty}^\infty f_{X^2}(x)f_{Y^2}(z-x)\mathrm dx.$$ Observe that $f_{X^2}(x)f_{Y^2}(z-x)=0$ if $x\not\in[\max\{0,z-1\},\min\{1,z\}]$. So we have that $$f_Z(z)= \begin{cases} \int_0^zf_{X^2}(x)f_{Y^2}(z-x)\mathrm dx&\text{if }0\le z\le1,\\ \int_{z-1}^1f_{X^2}(x)f_{Y^2}(z-x)\mathrm dx&\text{if }1\le z\le2. \end{cases}$$ Now $$\frac14\int_0^z\frac1{\sqrt{x(z-x)}}\mathrm dx=\frac\pi4$$ and $$\frac14\int_{z-1}^1\frac1{\sqrt{x(z-x)}}\mathrm dx=\frac12\arctan\biggl(\frac1{\sqrt{z-1}}\biggr)-\frac12\arctan(\sqrt{z-1})$$ since $$\biggl(2\arctan\biggl(\frac{\sqrt x}{\sqrt{z-x}}\biggr)\biggr)'=\frac{1}{\sqrt{x(z-x)}}$$ (I used Integral Calculator to find this antiderivative).
You can view this one geometrically: For each $r > 0$, what is the area of the set $\{(x,y) \in [0,1] \times [0,1]: x^2 + y^2 > r\}$?
We have $$f_{X,Y}(x,y)=f_{X}(x)f_{Y}(y)=1\quad;\text{ for }0\le x\le1,\ 0\le y\le1$$ Let $U=X^2+Y^2$ and $V=X^2$, then $Y=\sqrt{U-V}$ and $X=\sqrt{V}$. The Jacobian is $\dfrac{1}{4\sqrt{v(u-v)}}$. The corresponding regions are $\text{R : }0\le\sqrt{v}\le1$ and $0\le\sqrt{u-v}\le1$. The joint pdf of $\ U$ and $V$ is $$f_{U,V}(u,v)=f_{X,Y}(x,y)\cdot|J|=\dfrac{1}{4\sqrt{v(u-v)}}$$ and the marginal pdf of $U$ is $$f_U(u)=\int_R f_{U,V}(u,v)\ dv=\left\{ \begin{array}{l l} \dfrac14\int_{v=0}^u \dfrac{1}{\sqrt{v(u-v)}}\ dv&\quad;\text{ for }0\le u\le1\\ \\\\\\\\ \dfrac14\int_{v=u-1}^1 \dfrac{1}{\sqrt{v(u-v)}}\ dv&\quad;\text{ for }1\le u\le2. \end{array} \right.$$ To evaluate the integral, write $$\dfrac{1}{\sqrt{v(u-v)}}=\frac1u\left(\dfrac{\sqrt{u-v}}{\sqrt{v}}+\dfrac{\sqrt{v}}{\sqrt{u-v}}\right)$$ and you can use this technique.
• "Could you please take a look my answer @Did in case I made a mistake. Thanks. :)" Wrong Jacobian, use $1/(4\sqrt{v(u-v)})$ instead. – Did Apr 24 '14 at 16:03