how to use Inversion Theorem to check an integral? This is undoubtedly a simple question but I am stumped. This is a problem from Rudin, Real & Complex Analysis, chapter 10.
First I was asked to compute
$$\int_{-\infty}^\infty \frac{e^{itx}}{1+x^2}\text{d}x,$$
which using the Residue Theorem I deduced is $\pi e^{-t}$.
Next I was asked to use the Inversion Theorem of the Fourier Transform to check this answer. To that end I defined $f(x) = \frac{1}{1+x^2}$ and noted that
$$\hat{f}(-t)=\int_{-\infty}^\infty f(x)e^{itx}\text{d}x=\pi e^{-t}.$$
By the Inversion Theroem,
$$f(x)=\int_{-\infty}^\infty \hat{f}(t)e^{itx}\text{d}t=\int_{-\infty}^\infty \pi e^{(ix+1)t}\text{d}t.$$
But this integral clearly isn't defined.
Could someone point out where I have gone wrong? Thanks.
 A: The issue is that $\int_{-\infty}^\infty\frac{e^{itx}}{x^2+1}\,dx=\pi e^{-t}$ for $t>0$, but $\int_{-\infty}^\infty\frac{e^{itx}}{x^2+1}\,dx=\pi e^t$ for $t<0$ since for $t<0$, we close the contour in the lower-half plane and pick up the residue at $-i$.  
That is, the Fourier Transform of $\frac{1}{1+x^2}$ is given by
$$\int_{-\infty}^\infty\frac{e^{itx}}{x^2+1}\,dx=\pi e^{-|t|}$$
Then, we have
$$\begin{align}
\frac{1}{2\pi }\int_{-\infty}^\infty\pi e^{-|t|}e^{-itx}\,dt&=\frac{1}{2\pi }\int_{-\infty}^0 \pi e^{t}e^{-itx}\,dt+\frac{1}{2\pi }\int_{0}^\infty\pi e^{-t}e^{-itx}\,dt\\\\
&=\frac{1}{1+x^2}
\end{align}$$
A: The sign of $t$ is important here: the quick and dirty way to sort this out is to notice that $1/(1+x^2)$ is even, so the integral reduces to
$$ \int_{-\infty}^{\infty} \frac{\cos{tx}}{1+x^2} \, dx, $$
which is clearly an even function of $t$. You've worked it out assuming $t>0$, and so the result extends to negative $t$ simply by setting $\hat{f}(-t)=\hat{f}(t)$, so $\hat{f}(t) = \pi e^{-|t|}$ for all $t$.
To see what's gone wrong, look at the integral over the large semicircle that you have to make disappear to apply the Residue Theorem. $e^{itz}$ tends to zero as $\Im(z) \to \infty$ if and only if $t>0$. Hence one cannot close the contour in the upper half-plane if $t<0$: one instead has to use the lower half-plane (or change variables to $w=-z$ to have $e^{i(-t)w}$ in the numerator, which does $\to 0$ as $\Im(w) \to \infty$).
