# Suppose $Y\backsim N(0, 1)$ and $X\backsim N(0, Y^{-2})$. Show that $X$ has the standard Cauchy distribution.

Here is my thought process:

$$f_Y(t) = \frac{1}{\sqrt{2\pi}}e^-\frac{t^2}{2}$$

$$X\backsim N(0, t^{-2})$$

$$f_{X|Y}(s|t) = \frac{t}{\sqrt{2\pi}}e^-\frac{s^2t^2}{2}$$

$$f_X(s) = \int_{-\infty}^\infty f_{X|Y}(s|t)f_Y(t)dt$$

$$f_X(s) = \int_{-\infty}^\infty \frac{t}{2\pi}e^{-\frac{t^2}{2}(s^2+1)}dt$$

This integral is unsolvable.

What am I doing wrong?

I know the standard Cauchy distribution should be $$f_X(s) = \frac{1}{\pi(1 + s^2)}$$

If $$X \mid Y \sim \operatorname{Normal}(0, Y^{-2}),$$ then the variance of $$X \mid Y$$ is $$1/Y^2 > 0$$, and the conditional density of $$X \mid Y$$ is $$f_{X \mid Y}(s \mid t) = \frac{|t|}{\sqrt{2\pi}} e^{-s^2 t^2/2}.$$ You must have absolute values here because if $$Y < 0$$, your expression would give you a negative density.
Then $$f_{X \mid Y}(s \mid t) f_Y(t) = \frac{|t|}{\sqrt{2\pi}} e^{-s^2 t^2/2} \cdot \frac{1}{\sqrt{2\pi}} e^{-t^2/2} = \frac{1}{2\pi} |t| e^{-(s^2 + 1) t^2/2}.$$ Hence $$f_S(s) = \int_{t=-\infty}^\infty f_{X \mid Y}(s \mid t) f_Y(t) \, dt = \frac{1}{2\pi} \int_{t=-\infty}^\infty |t| e^{-(s^2 + 1) t^2/2} \, dt = \frac{1}{\pi} \int_{t=0}^\infty t e^{-(s^2 + 1) t^2/2} \, dt,$$ where we have removed the absolute value by noting the symmetry of the integrand about $$t = 0$$. Now let $$u = t \sqrt{s^2 + 1}, \quad t = \frac{u}{\sqrt{s^2 + 1}}, \quad dt = \frac{du}{\sqrt{s^2 + 1}}.$$ Then $$f_S(s) = \frac{1}{\pi} \int_{u=0}^\infty \frac{u}{\sqrt{s^2 + 1}} e^{-u^2/2} \cdot \frac{1}{\sqrt{s^2 + 1}} \, dt = \frac{1}{\pi (s^2 + 1)} \int_{u=0}^\infty u e^{-u^2/2} \, du.$$ With the substitution $$v = u^2/2$$, $$dv = u \, du$$, we obtain $$f_S(s) = \frac{1}{\pi (s^2 + 1)} \int_{v=0}^\infty e^{-v} \, dv = \frac{1}{\pi (s^2 + 1)} \bigl[-e^{-v}\bigr]_{v=0}^\infty = \frac{1}{\pi(s^2 + 1)},$$ which is the Cauchy density centered at $$0$$, as claimed.
$$X\sim N(0,1/Y^2)$$ implies $$X\sim Z/|Y|$$ where $$Z\sim N(0,1)$$ is independent of $$Y$$. Therefore using $$\frac{\Gamma(a)\Gamma(b)}{\Gamma(a+b)}=\int_0^{\infty}\frac{u^{a-1}}{(1+u)^{a+b}},\ \Gamma(p)\Gamma(1-p)=\frac{\pi}{\sin \pi p}$$ we get
$$E(|X|^s)=\frac{\Gamma(\frac{1}{2}+s)\Gamma(\frac{1}{2}-s)}{\Gamma(1/2)^2}=\frac{2}{\pi}\int_{0}^{\infty}\frac{x^s}{1+x^2}dx$$ showing that $$X$$ is Cauchy standard since $$X\sim -X$$.