Complex integral with exponential and tangent Suppose that $k \in \mathbb{R}.$ Evaluate as a function of $k$ the integral
$$I(k) : = \int_{-\pi/2}^{\pi/2} e^{i \ k \ \mathrm{tan}(\phi)} d \phi.$$
Any suggestions on how to approach this problem? I thought about changing the integrand into a function of $z \in \mathbb{C}$ since $z=re^{i \theta}$, but that didn't seem to lead to anything fruitful. I also thought about using the fact that $e^{i \theta} = \mathrm{cos(\theta)} +  i \ \mathrm{sin(\theta)}$. Thanks.
 A: Change variables to $t=\tan{\phi}$. Then $d\phi = \frac{dt}{1+t^2}$, and the integral becomes
$$ \int_{-\infty}^{\infty} \frac{e^{ik t}}{1+t^2} \, dt, $$
which can be done in a myriad of ways: differentiation under the integral sign, Jordan's lemma, the representation
$$ \frac{1}{1+t^2} = \int_0^{\infty} e^{-\lambda(1+t^2)} \, d\lambda $$
and interchanging the order of integration...
A: First assume that $k\gt0$.
After the change of variables that Chappers mentions, we can evaluate the resulting integral using the contour $\gamma=[-R,R]\cup Re^{i[0,\pi]}$
$$
\begin{align}
\int_{-\infty}^\infty\frac{e^{ikt}}{1+t^2}\,\mathrm{d}t
&=\int_\gamma\frac{e^{ikz}}{1+z^2}\,\mathrm{d}z\tag{1}\\
&=\int_\gamma\frac1{2i}\left(\frac1{z-i}\color{#A0A0A0}{-\frac1{z+i}}\right)e^{ikz}\,\mathrm{d}z\tag{2}\\[3pt]
&=\frac{2\pi i}{2i}e^{-k}\tag{3}\\[9pt]
&=\pi e^{-k}\tag{4}
\end{align}
$$
Explanation:
$(1)$: the integral along $Re^{i[0,\pi]}$ vanishes as $R\to\infty$
$(2)$: use partial fractions and note that the singularity at $z=-i$ is outside $\gamma$
$(3)$: the residue of $\frac{e^{ikz}}{z-i}$ at $z=i$ is $e^{-k}$
$(4)$: simplification
Next, note that the integral is even in $k$. Therefore, for $k\in\mathbb{R}$,
$$
\int_{-\infty}^\infty\frac{e^{ikt}}{1+t^2}\,\mathrm{d}t=\pi e^{-|k|}
$$
