This is a home work problem
$v = \sqrt{x^{2} + y^{2}} $
$w = \frac{y}{x} $
x and y are random variables with the following joint density function:
$f(x,y) = \frac{1}{2 \pi \sigma^{2}}exp[-\frac{1}{2 \sigma^{2}}(x^{2}+y^{2})]$
find f(v,w) as a function of f(x,y)
The following is my solution. Could someone please tell me if I am right and if not what I am doing wrong?
Change to polar coordinates:
$v = r \hspace{1cm}w = tan(\theta) $
inverse functions:
$v = r \hspace{1cm} $
$ arctan(w) = \theta_{1} \hspace{3mm}arctan(w) + \pi = \theta_{2} $
$$J(r, \theta) = det\begin{bmatrix}\frac{\partial v}{\partial r} & \frac{\partial v}{\partial \theta} \\\frac{\partial w}{\partial r} & \frac{\partial w}{\partial \theta} \end{bmatrix} = \begin{bmatrix}1 & 0 \\0 & sec^{2}(\theta) \end{bmatrix} = sec^{2}(\theta)$$
$\frac{\partial v}{\partial r} = 1 \hspace{5mm} \frac{\partial v}{\partial \theta} = 0 $
$\frac{\partial w}{\partial r} = 0 \hspace{5mm} \frac{\partial w}{\partial \theta} = sec^{2}(\theta) $
express the joint density function in polar coordinates
$f_{r \theta}(r, \theta) = \frac{1}{2 \pi \sigma^{2}}exp[-\frac{1}{2 \sigma^2} r^{2}]$
$$f_{vw}(v,w) = (f_{r \theta}(r, \theta_{1}) + f_{r \theta}(r, \theta_{2}))\frac{1}{|J(r, \theta)|}$$
there for
$$f_{vw}(v,w)= \frac{1}{\pi \sigma^2} exp[ -\frac{1}{2 \sigma^{2}}r^{2}]|cos^2(\theta)| = \frac{1}{\pi \sigma^2} exp[ -\frac{1}{2 \sigma^{2}}v^{2}] \frac{1}{w^{2}+1}$$
You map $(r, \theta) \to (v, w)$ using Jacobian but you forgot about the Jacobian to map $(x, y) \to (r, \theta)$, which is $r$. That should give you $v$ in the numerator.
Alternatively, without converting to polar coordinates,
$v = \sqrt{x^2+y^2}, w = \dfrac{y}{x}$
$J^{-1} = \begin{vmatrix} \frac{\partial v}{\partial x} & \frac{\partial v}{\partial y} \\ \frac{\partial w}{\partial x} & \frac{\partial w}{\partial y}\end {vmatrix} = \begin{vmatrix} \frac{x}{\sqrt{x^2+y^2}} & \frac{y}{\sqrt{x^2+y^2}} \\ -\frac{y}{x^2} & \frac{1}{x}\end {vmatrix}$
$ = \dfrac{\sqrt{x^2+y^2}}{x^2}$
Now note that $(x,y) \to (v,w)$ is not one-to-one mapping -
$y = wx, v^2 = x^2 + y^2 = x^2 (1+w^2)$
$x = \pm \dfrac{v}{\sqrt{1+w^2}}$
Using symmetry, we can multiple $|J|$ by $2$.
$f(v,w) = \dfrac{2v^2}{v (1+w^2)} \dfrac{1}{2 \pi \sigma^{2}} \ e^{- \left(\dfrac{v^2}{2 \sigma^{2}}\right)}$
$ \displaystyle = \dfrac{v}{\pi \sigma^2 (1+w^2)} e^{- \left( \dfrac{v^2}{2 \sigma^{2}} \right)}$