Why the p.d.f. is zero

density functionprobability

If $X_1$ and $X_2$ are random sample taken from standard normal distribution. Let $Y_1=\dfrac{X_1}{X_2}$ and $Y_2=X_2$. Show that $Y_1$ has Cauchy distribution with p.d.f. $$g(y_1)=\dfrac{1}{\pi (1+y_1^2)}, \text{ for } -\infty<y_1<\infty.$$

To show that $Y_1$ has Cauchy distribution, I use Jacobian transformation.

First, I find the inverse of $Y_1$ and $Y_2$, that is
$X_1=Y_1Y_2$ and $X_2=Y_2$.

Now I find the Jacobian determinant.
\begin{eqnarray}
\vert J\vert = \left\vert
\begin{matrix}
y_2&y_1\\
0&1
\end{matrix}
\right\vert
=y_2
\end{eqnarray}

$X$ is standard normal distribution have p.d.f.
$$
f(x)=\dfrac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}x^2}, -\infty<x<\infty.
$$

Now I find the joint p.d.f. as below.
\begin{eqnarray}
g(y_1,y_2)&=&f(x_1,x_2)\vert J\vert\\
&=&f(y_1y_2,y_2)y_2\\
&=&f(y_1y_2)f(y_2)y_2\\
&=&\dfrac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}(y_1y_2)^2}\dfrac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}(y_2)^2}y_2\\
&=& \dfrac{1}{2\pi}y_2e^{-\frac{1}{2}y_2^2(y_1^2+1)}
\end{eqnarray}

To find the p.d.f of $Y_1$, now I find the marginal p.d.f.

\begin{eqnarray}
g(y_1)&=&\int \limits_{-\infty}^{\infty} \dfrac{1}{2\pi}y_2e^{-\frac{1}{2}y_2^2(y_1^2+1)}dy_2\\
&=&\dfrac{e^{y_1^2+1}}{2\pi}\left[e^{-\frac{1}{2}y_2^2}\right]_{-\infty}^{\infty}\\
&=&0
\end{eqnarray}

Why the p.d.f of $Y_1$ is zero? Am I wrong?

Best Answer

Two issues:

You must take the absolute value of the Jacobian determinant, so $|y_2|$. This means you need to split your integral up into $(-\infty,0]$ and $[0,\infty)$, which will just be twice the integral over $[0,\infty)$ by symmetry.

Second, you can't factor $e^{y_1^2+1}$ out of $e^{-\frac{1}{2}y_2(y_1^2+1)}$ because that's not how exponent rules work. Instead, you'll have to treat $y_1^2+1$ as a constant and recognize the antiderivative ought to be $A(y_1)e^{-\frac{1}{2}y_2(y_1^2+1)}$ for some constant $A(y_1)$ (well, constant with respect to $y_2$).