I'm doing the something that results in following integral: $f(z) = \int_{-\infty}^\infty \frac{1}{2\pi}x\exp\left(\frac{-x^2}{2}\left(1+z^2\right)\right) dx$ Then since $f(z)$ is even we get: $f(z) = \int_{0}^\infty \frac{1}{\pi}x\exp\left(\frac{-x^2}{2}\left(1+z^2\right)\right) dx$ Which gives $ f(z) = \frac{1}{\pi} \frac{1}{1+z^2}$
I can't seem to understand why would I get $0$ if I evaluate the first line directly and substituting in the limits as $\infty$ and ${-\infty}$ without using the fact that the function is even? Am I missing something trivial?
PS. This calculation is from calculating the ratio distribution of X/Y where X, Y IID standard normal. The working agrees with my lecturer's notes & the answer's supposed to Cauchy(0,1)
PPS. Thanks for the replies so far. I got as far as that $f(z)$ is even as a function of $z$ but the integrand is odd as a function of $x$. So why is the answer Cauchy (0,1) and not $0$ (according to my professor & online sources eg wiki)?