# Finding joint pdf of $(U,V)$, where $U$ and $V$ are transformations of independent $N(0,1)$ random variables.

Suppose $$X$$ and $$Y$$ are independent standard normal random variables. Let $$U = X^2 + Y^2$$ and $$V = \frac{X}{\sqrt{X^2 + Y^2}}$$. (a) Find the joint pdf of $$U$$ and $$V$$. (b) Show that $$U$$ and $$V$$ are independent.

For this question, I calculated the modulus of the Jacobian of transformation to be $$\frac{1}{2\sqrt{1-v^2}}$$. Then, on multiplying with the joint pdf of $$X$$ and $$Y$$, I get the joint pdf to be $$f_{U,V}(u,v) = f_X(\sqrt{U}V)f_Y(\sqrt{U-UV^2})\frac{1}{\sqrt{1-v^2}}$$. However, upon substituting the normal pdfs and working through the calculations in part (b), I cannot seem to get $$f_{U,V}(u,v) = f_{U}f_{V}$$. On the right hand side I get $$\frac{e^{-u^2/2}}{8\pi\sqrt{1-v^2}}$$ - a factor of a half different to the left hand side. I used limits of $$0 \leq u \leq \infty$$ and $$-1 \leq v\leq 1$$ for the integrals on the right hand side. Clearly something is wrong, so can anyone give a full solution?

I think it might just be a typo on your part, but the factor with $$u$$-dependence should be $$e^{-u/2},$$ not $$e^{-u^2/2}.$$

The Jacobian method gets the wrong answer here (or, rather, you are misapplying it). The reason is that the coordinate transformation is not one-to-one. Notice that $$U$$ and $$V$$ do not change when $$Y\to -Y.$$

It might help to consider the simpler problem that is extremely related. Let $$A$$ be uniform on $$(0,2\pi)$$ and then consider the distribution of $$B = \cos(A).$$ Note that the Jacobian gets the wrong answer here too. And a simpler but less related example would be for $$A$$ uniform on $$(-1,1)$$ and $$B=A^2.$$ Do you see how to use symmetry to fix the problem in each case?

The reason the first example is "extremely related" is that note that in polar coordinates $$U=R^2$$ and $$V=\cos(\Theta).$$ Note if you took your second variable to be $$\Theta$$ rather than $$\cos(\Theta),$$ the transformation would be one-to-one (except for the singularity at $$R=0,$$ but that doesn't cause an issue). And intuitively, don't we expect the angle to be uniformly distributed here?

It is clear from the definition of $$U$$ and $$V$$ that a polar transformation would be useful.

Changing variables $$(X,Y)\to (R,\Theta)$$, you get the joint density of $$(R,\Theta)$$:

$$f_{R,\Theta}(r,\theta)=\frac{r}{2\pi}e^{-r^2/2}\mathbf1_{r>0\,,\,0<\theta<2\pi}$$

This was a one-to-one transformation.

But now if you consider the transformation $$(R,\Theta)\to(U,V)$$ such that $$U=R^2$$ and $$V=\cos\Theta$$, this is no longer one-to-one. Because for $$v=\cos\theta$$ and $$0<\theta<2\pi$$, you get two preimages for $$\theta$$, namely $$\theta=\cos^{-1}v$$ and $$\theta=2\pi-\cos^{-1}v$$, with $$-1. Let $$J_1$$ and $$J_2$$ be the two jacobians of transformation, one for each preimage.

Then we see that $$|J_1|=|J_2|=\frac{1}{2\sqrt{u}\sqrt{1-v^2}}$$

So by the transformation formula, density of $$(U,V)$$ takes the form

\begin{align} f_{U,V}(u,v)&=f_{R,\Theta}(\sqrt u,\cos^{-1}v)|J_1|+f_{R,\Theta}(\sqrt u,2\pi-\cos^{-1}v)||J_2| \\&=2\times \frac{\sqrt u}{2\pi}e^{-u/2}\frac{1}{2\sqrt{u}\sqrt{1-v^2}}\mathbf1_{u>0\,,\,|v|<1} \\&=\frac{1}{2}e^{-u/2}\mathbf1_{u>0}\frac{\mathbf1_{|v|<1}}{\pi\sqrt{1-v^2}} \end{align}