How do I calculate $u(w)=\int_0^\infty \frac{1-\cos(wt)}{t}\,e^{-t}\,dt$? How do I calculate 
$$u(w)=\int_0^\infty \frac{1-\cos(wt)}{t}\,e^{-t}\,dt$$
I tried to do it, I use partial integration but I get lost. Is there any nice simple way to calculate it?


Here is an approach that does not use Feynman's trick or the Generalized Frullani's Theorem, but rather uses integration by parts ("IBP") along with the well-known integral (See the NOTE at the end of THIS ANSWER$$\int_0^\infty \log(t)e^{-t}\,dt=-\gamma\tag1$$where $\gamma$ is the Euler-Mascheroni constant.  It is easy to see from $(1)$ that for $\text{Re}(s)>0$ $$\int_0^\infty \log(t)e^{-st}\,dt=-\frac{\gamma-\log(s)}s\tag2$$


First, by enforcing the substitution $x= t/w$ reveals that 
$$\int_0^\infty \frac{1-\cos(wx)}{x}e^{-x}\,dx=\int_0^\infty \frac{1-\cos(t)}{t}e^{-(1/w)t}\,dt$$

Letting $s=1/w$, we have  
$$\begin{align}
\int_0^{\infty} \left(\frac{1- \cos t}{t}\right)e^{-st}dt&=\int_0^{\infty} (1- \cos t)\left(\frac{d\log(t)}{dt}\right)e^{-st}dt\\\\
&=\int_0^{\infty} \left(e^{-st}- \frac12 e^{-(s+i)t}-\frac12 e^{-(s-i)t}\right)\left(\frac{d\log(t)}{dt}\right)\,dt\\\\
&\overbrace{=}^{IBP}-\int_0^{\infty} \log(t)\frac{d}{dt}\left(e^{-st}- \frac12 e^{-(s+i)t}-\frac12 e^{-(s-i)t}\right) dt\\\\
&=s\int_0^{\infty} \log(t)e^{-st}dt\\\\
&-\frac12(s+i)\int_0^{\infty} \log(t)e^{-(s+i)t}dt\\\\
&-\frac12(s-i)\int_0^{\infty} \log(t)e^{-(s-i)t}dt\\\\
&\overbrace{=}^{\text{Using} (2)}s\left(\frac{-\gamma-\log(s)}{s}\right)\\\\
&-\frac12 (s+i)\left(\frac{-\gamma-\log(s+i)}{s+i}\right)\\\\&-\frac12 (s-i)\left(\frac{-\gamma-\log(s-i)}{s-i}\right)\\\\
&=\frac12 \log\left(\frac{s^2+1}{s^2}\right)
\end{align}$$

Finally, replacing $s$ with $1/w$ yields the coveted result
$$\bbox[5px,border:2px solid #C0A000]{\int_0^\infty \frac{1-\cos(wx)}{x}e^{-x}\,dx=\frac12\log\left(1+w^2\right)}$$
