A random variable X is distributed by Cauchy Distribution when the density function of X is f(x) = $\frac{1}{\pi}\frac{1}{(1+x^2)}$. The characteristic function of X is defined by $$\phi(x)=\int_{-\infty}^\infty{f(x)e^{itx}dx},\;t\in {R}$$ Thus, $$\phi(x)=\int_{-\infty}^\infty\frac{1}{\pi}\frac{1}{(1+x^2)}{e^{itx}dx}$$
By the Residue theorem, it should be possible to prove that $$\phi(x) = e^{-\vert t\vert}$$
I found this mentioned in another question and have been trying to produce this proof. I am new to complex analysis, and after calculating residues I cannot derive the integral into $\phi(x) = e^{-\vert t\vert}$. My process so far is as below:
Let $f(z) = \frac{e^{itz}}{(1+z^2)}$. $f(z)$ has two simple poles, ${z_0}=-i$ and ${z_1}=i$. Evaluate $f(z)$ on two semicircle-shaped contours, one in the positive imaginary direction and another in the negative imaginary direction.
Using the formula for limit form of residues, I find that $Res(f(z),-i) = \frac{e^t}{-2\pi i}$ and $Res(f(z),i) = \frac{e^{-t}}{2\pi i}$. The Residue theorem states that $\int_{\gamma}{f(z)}dz$ = ${2\pi i}{\sum_{r=0}^n}Res(f,z_r)$ where $n$ is the total number of poles.
Inputting the residues from above into the Residue theorem yields
$$\int_{-\infty}^\infty\frac{e^{itz}}{(1+z^2)}dz={2\pi i}{\frac{e^t}{-2\pi i}}+{2\pi i}{\frac{e^{-t}}{2\pi i}}$$
How does this equal to $e^{-\vert t\vert}$? Have I simply miscalculated the residues? I am genuinely interested in the solution and any help is appreciated.