Find $a > 0$ such that $\int_{0}^{\infty}e^{-ax}\cos(x)dx$ has the greatest value possible. Then find the greatest value of the expression. I'm struggling with improper integrals (Calc I). I've calculated the following:
If $a = 0$:
$$\int_{0}^{\infty}\cos(x)dx =\lim\limits_{R\to\infty} \int_{0}^{R}\cos(x)dx =\lim\limits_{R\to\infty} \sin(R) $$
Which diverges?
If $a > 0$:
$$\int_{0}^{\infty}e^{-ax}\cos(x)dx = \lim\limits_{R\to\infty}\int_{0}^{R}e^{-ax}\cos(x)dx = \lim\limits_{R\to\infty}\left[\frac{a}{a+1}+\left(\frac{\sin(R)-a\cos(R)}{a^{2}+1}\right)e^{-aR}\right] $$
But what happens to this expression? Does it equal $\frac{a}{a+1}$, and how can I decide the greatest area from this? (That is if the expression I got is correct...)
 A: For $a > 0$ the integral evaluates to $\frac{a}{a^2+1}$ (you forgot a square in the denominator of the first fraction). Now set $g(a) = \frac{a}{a^2+1}$, $a \in (0, \infty)$ and find its derivative. Using that you can find that the maximum value is $\frac{1}{2}$, achieved when $a=1$.
A: You can actually continue your method to get the correct solution! You want to evaluate the limit
$$
\lim_{R\to\infty} \left[\frac{a}{a^{\color{red}{2}}+1} + \left(\frac{\sin(R)-a\cos(R)}{a^{2}+1}\right)e^{-aR}\right]
$$
By the harmonic addition theorem, $\sin(R)-a\cos(R)$ can be written as $$\sin(R)-a\cos(R)=-\sqrt{a^{2}+1}\cos\left(R+\arctan\left(\frac{1}{a}\right)\right) $$
But since $-1\le \cos(x) \le 1$ for all $x$, by the squeeze theorem you get:
$$
\begin{align*}
0=  \lim_{R\to\infty}- \sqrt{a^2+1}e^{-aR} \le \lim_{R\to\infty} \left(\sin(R)-a\cos(R)\right)e^{-aR}\le \lim_{R\to\infty}\sqrt{a^2+1}e^{-aR}=0 
\end{align*}
$$
since $e^{-x}\to 0$ as $x \to \infty$. This means that your integral evaluates to
$$
\int_{0}^{\infty} e^{-ax}\cos(x) \, dx =\frac{a}{a^2+1} + \frac{1}{a^2+1} \underbrace{\lim_{R\to\infty} \left(\sin(R)-a\cos(R)\right)e^{-aR}}_{0} =\frac{a}{a^2+1}
$$
and from here, as others have pointed out, you just need to differentiate to get that the maximum is at $a=1$ which gives the maximum value of the integral $\frac{1}{1^2+1} = \frac{1}{2}$.
A: $$I=\int_{0}^{\infty}e^{-ax}\cos(x)dx=\Re \int_{0}^{\infty}e^{-ax}e^{ix}dx=\Re \int_{0}^{\infty}e^{-(a-i)x}dx=\Re\left(\frac 1{a-i}\right)$$
$$I=\Re\left(\frac{a}{a^2+1}+\frac{i}{a^2+1}\right)=\frac{a}{a^2+1}$$
A: Let us write this integral under the more general form:
$$\int_{0}^{\infty}e^{-sx}\cos(Ax)\,dx \ \text{with} \ A=1$$
This integral is classical : it is the Laplace Transform (see formula 8 here) of $\cos(At)$ for $A=1$, i.e. can be expressed as
$$F(s)=\dfrac{s}{s^2+A^2}=\dfrac{s}{s^2+1}$$
which is maximal for the value $s=1$ which annihilates $F'(s)=\frac{1-s^2}{(s^2+1)^2}$ (the variations of $F$ are increasing before $s=1$ and decreasing for $s>1).
For this value $s=1$, we have
$$F(1)=\dfrac{1}{2}$$
