Im trying to evaluate the improper integral $$\int_{0}^{\infty}\left( \frac{e^{i \omega t}+e^{-i \omega t}}{2}\right) e^{-st} dt$$, where $\omega$ and $s$ are real positive constants and $i=\sqrt{-1}$.
Using Euler's formula $e^{ix}=\cos x+i\sin x$, i get $$\int_{0}^{\infty}\cos(\omega t) e^{-st} dt$$ But im not sure where to go from here, or if thats the right direction?
Why not just integrate in the exponential form? If not, then you can use integration by parts (applied twice):
\begin{align} u = \cos(\omega t) && du = -\omega\sin(\omega t)dt \\ dv = e^{-st}dt && v = -\frac{1}{s}e^{-st} \end{align}
$$ \int\limits_0^\infty \cos(\omega t)e^{-st}dt = \left.-\frac{\cos(\omega t)}{s}e^{-st}\right|_0^\infty - \frac{\omega}{s}\int\limits_0^\infty\sin(\omega t)e^{-st}dt $$
Now do integration by parts again:
\begin{align} u = \sin(\omega t) && du = \omega\cos(\omega t)dt \\ dv = e^{-st}dt && v = -\frac{1}{s}e^{-st} \end{align}
$$ \int\limits_0^\infty \cos(\omega t)e^{-st}dt = \frac{1}{s} - \frac{\omega}{s}\left(\left.-\frac{\sin(\omega t)}{s}e^{-st}\right|_0^\infty + \frac{\omega}{s}\int\limits_0^\infty \cos(\omega t)e^{-st}dt\right) $$
Look, you have the same integral twice, so just collect it on one side:
$$ \left(1 + \frac{\omega^2}{s^2}\right)\int\limits_0^\infty \cos(\omega t)e^{-st}dt = \frac{1}{s} $$
Which now gives the integral:
$$ \int\limits_0^\infty \cos(\omega t)e^{-st}dt = \frac{s}{s^2 + \omega^2} $$