You don't need to compute the integrals to show that they're equal. First of all, for any bounded function $f$ on $[0,\infty)$, the integral
$$
\int_0^\infty e^{-x}f(x)\,dx
$$
converges absolutely, because, if $|f(x)|\le k$, we have $|e^{-x}f(x)|\le ke^{-x}$ and
$$
\int_0^\infty e^{-x}\,dx
$$
converges.
Now, integrating by parts,
$$
\int_0^{\infty}e^{-x}\cos x\,dx=
[e^{-x}\sin x]_0^{\infty}-\int_0^\infty (-e^{-x})\sin x\,dx=
\int_0^\infty e^{-x}\sin x\,dx
$$
because, clearly,
$$
\lim_{x\to\infty}e^{-x}\sin x=0.
$$