Integral $\int_{0}^{\infty}e^{-ax}\cos (bx)\operatorname d\!x$ I want to evaluate the following integral via complex analysis $$\int\limits_{x=0}^{x=\infty}e^{-ax}\cos (bx)\operatorname d\!x \ \ ,\ \ a >0$$
Which function/ contour should I consider ?
 A: As Daniel Fischer pointed out, note that 
$$ \int_{0}^{+\infty} e^{-ax} \cos(bx) \; dx = \Re \Bigg( \int_{0}^{+\infty} e^{-ax} e^{ibx} \; dx \Bigg). $$
(where $\Re(z)$ denotes the real part of $z$). Then, 
$$ 
\begin{align*}
\int_{0}^{+\infty} e^{-ax} e^{ibx} \; dx & = {} \int_{0}^{+\infty} e^{-(a-ib)x} \; dx \\[1mm]
 & = \lim \limits_{M \to +\infty} \int_{0}^{M} e^{-(a-ib)x} \; dx \\[1mm]
 & = \lim \limits_{M \to +\infty} \left[ -\frac{1}{a-ib} e^{-(a-ib)x} \right]_{0}^{M} \\[1mm]
 & = \lim \limits_{M \to +\infty} \Big( -\frac{1}{a-ib} e^{-(a-ib)M} + \frac{1}{a-ib} \Big) \\[1mm]
 & = \frac{1}{a-ib} \\[1mm]
 & = \frac{a+ib}{\vert a-ib \vert^{2}}. \\
\end{align*}
$$
So, 
$$ \int_{0}^{+\infty} e^{-ax} \cos(bx) \; dx = \frac{a}{\vert a-ib \vert^{2}}. $$
A: Let us integrate the function $e^{-Az}$, where $A=\sqrt{a^2+b^2}$ on a circular sector in the first quadrant, centered at the origin and of radius $\mathcal{R}$, with angle $\omega$ which satisfies $\cos \omega = a/A$, and therefore $\sin \omega = b/A$.
Let this sector be called $\gamma$.
Since our integrand is obviously holomorphic on the whole plane we get:
$$
\oint_\gamma \mathrm{d}z e^{-Az} = 0.
$$
Breaking it into its three pieces we obtain:
$$
\int_0^\mathcal{R}\mathrm{d}x e^{-Ax}+\int_0^\omega \mathrm{d}\varphi i\mathcal{R}e^{i\varphi}e^{-A\mathcal{R}e^{i\varphi}}+\int_{\mathcal{R}}^0 \mathrm{d}r e^{i\omega}e^{-Are^{i\omega}}=0.
$$
The mid integral, as $\mathcal{R}\to\infty$ is negligible. So:
$$
\int_0^\infty\mathrm{d}xe^{-Ax}=\int_0^\infty\mathrm{d}r (\cos\omega+i\sin\omega)e^{-Ar(\cos\omega+i\sin\omega)}
$$
$$
\frac{1}{A}=\frac{1}{A}\int_0^\infty\mathrm{d}r(a+ib)e^{-r(a+ib)}
$$
$$
\int_0^\infty\mathrm{d}r(a+ib)e^{-ar} (\cos br - i\sin br) = 1
$$
Now let's call $I_c = \int_0^\infty\mathrm{d}re^{-ar}\cos br$ and $I_s = \int_0^\infty\mathrm{d}re^{-ar}\sin br$, then:
$$
aI_c-iaI_s+ibI_c+bI_s=1
$$
and by solving:
$$
aI_c+bI_s=1;\ \ \ \ -aI_s+bI_c=0
$$
$$
I_c=\frac{a}{a^2+b^2}; \ \ \ \ I_s=\frac{b}{a^2+b^2}.
$$
This method relies only on the resource of contour integration as you asked! 
A: First,you may use the definition of Lapace transform to get it or integration by parts twice.
For complex numbers your integrand is the real part of $\exp(-ax+ibx)$. Use this function to evaluate the unbounded integral then evaluate the bounded one 
