\begin{equation}
\int_{0}^{\infty}e^{-ax}\cos x dx
\end{equation}
You can use Laplace Transformation:
\begin{equation}
\int_{0}^{\infty}e^{-st}\cos{bt}dt
=\frac{s}{s^2+b^2}
\end{equation}
You can substitute values:
$s = a, b = 1$
$$\begin{align*}
f(a) = \frac{a}{a^2+1}
\end{align*}$$
Now, You want the value of $a$ for which $f(a)$ is max.
Differentiate the function and equate to zero:
$$\begin{align*}
f'(a)=\frac{d}{da}(\frac{a}{a^2+1}) = 0\\
=\frac{1-a^2}{(a^2+1)^2} = 0\\
\implies a =±1
\end{align*}$$
You can find the maximum value of is @ $a=1$ which is $f(a=1) = 0.5$
- Laplace Transform of $\cos{bt}$
Consider, $\cos{bt}=\operatorname{Re}\{e^{-ibt}\}$,
$$
\int_0^\infty e^{-at}\cos(bt)\,dt=
\operatorname{Re}\int_0^\infty e^{-(a+ib)t}\,dt=
\operatorname{Re}\left[-\frac{e^{-zt}}{z}\right]_0^\infty=
$$
$$
\operatorname{Re}\left\{\frac{1}{z}\right\}=
\operatorname{Re}\left\{\frac{a-ib}{||z||^2}\right\}=
\frac{a}{a^2+b^2}.
$$

You can substitute your values:
As $x\to\infty$ it $\to0$