Solving integrals looks like Fourier integrals(2) I'm wondering how to obtain this integral:
$$\int_0^\infty \frac{e^{-w^2 t}}{1+w^2} \cos(w x)\ dw$$
I've tried to set this integral a function of $t$ ($f(t)$) then I calculate the derivative of $f(t)$ (with respect to $t$),and set the result $k(x)$ and again calculate the derivation with respect to $x$, the result is some integral that is easy to obtain. So I returned this way and get $k(x)$,then $f'(t)$, but the result was something more difficult to integrate (with respect to $t$).Do you have any idea?
 A: PART $1$:
Motivated by the insightful comment posted by @Winther, let the function $f(x,t)$ be given 
$$f(x,t)=\int_0^\infty \cos(wx)\,e^{-w^2t}\,dw \tag 1$$
where in order for $(1)$ to converge, we must have $t>0$. 
First, we note that the integrand in $(1)$ is an even function of $w$.  Therefore, we can write
$$f(x,t)=\frac12 \int_{-\infty}^\infty \cos(wx)\,e^{-w^2t}\,dw \tag 2$$
Next, using Euler's Identity, $e^{iz}=\cos z+i\sin z$ in $(2)$ yields
$$\begin{align}
f(x,t)&=\frac12 \text{Re}\left(\int_{-\infty}^\infty e^{iwx}\,e^{-w^2t}\,dw \right) \tag 3\\\\
&=\frac12 e^{-x^2/4t}\text{Re}\left(\int_{-\infty}^\infty e^{-t\left(w-\frac{ix}{2t}\right)^2}\,dw \right)\tag 4
\end{align}$$
where in going from $(3)$ to $(4)$ we simply completed the square in the argument of the exponential.  
Next, we move to the complex plane.  First, we enforce the substitution $w\to z+i\frac{x}{2t}$ in the integral on the right-hand side of $(4)$ to reveal
$$\begin{align}
\int_{-\infty}^\infty e^{-t\left(w-\frac{ix}{2t}\right)^2}\,dw&=\int_{-\infty-i\frac{x}{2t}}^{\infty-i\frac{x}{2t}}e^{-tz^2}\,dz\tag 5\\\\
\end{align}$$
Then, we invoke Cauchy's Integral Theorem in $(5)$ to find that  
$$\begin{align}
\int_{-\infty}^\infty e^{-t\left(w-\frac{ix}{2t}\right)^2}\,dw&=\int_{-\infty}^\infty e^{-tx^2}\,dx \tag 6 \\\\
&=\sqrt{\frac{\pi}{t}} \tag 7
\end{align}$$
Note that in arriving at $(6)$, we tacitly used the fact that
$$\lim_{R\to \infty}\int_{-x/(2t)}^{0}e^{-t(\pm R+iy)^2}\,idy=0$$
Thus, using $(7)$ in $(4)$ yields
$$\bbox[5px,border:2px solid #C0A000]{f(x,t)=\sqrt{\frac{\pi}{4t}} e^{-x^2/4t}}$$

PART $2$:
Now, recall the $f$ is a solution to the differential equation 
$$I'(t)-I(t)=-f(x,t) \tag 8$$
The solution to $(8)$ can be written 
$$\begin{align}
I(t)&=-\int_0^te^{t-t'}f(x,t')\,dt'+\frac{\pi}{2}e^{t-x}\\\\
&=-\frac{\sqrt{\pi}}{2}e^{t}g(x,t)+\frac{\pi}{2}e^{t-x}
\end{align}$$
where $g(x,t)$ is the integral given by
$$g(x,t)=\int_0^t \frac{e^{-(t'+\frac{x^2}{4t'})}}{\sqrt{t'}}\,dt' \tag 9$$
Substituting $t'=u^2$ into $(9)$ yields
$$\begin{align}
g(x,t)&=2\int_0^{\sqrt{t}} e^{-(u^2+\frac{x^2}{4u^2})}\,du\\\\
&=2\int_0^{\sqrt{t}} e^{-(u+\frac{x}{2u})^2+x}\,du\\\\
&=\int_0^{\sqrt{t}} e^{-(u+\frac{x}{2u})^2+x}\,du+\int_0^{\sqrt{t}} e^{-(u-\frac{x}{2u})^2-x}\,du\\\\
&=\int_0^{\sqrt{t}} e^{-(u+\frac{x}{2u})^2+x}\,\left(1-\frac{x}{2u^2}\right)\,du+\int_0^{\sqrt{t}} e^{-(u-\frac{x}{2u})^2-x}\left(1+\frac{x}{2u^2}\right)\,du\\\\
&=-e^{x}\int_{(2t+x)/2\sqrt{t}}^{\infty}e^{-z^2}\,dz+e^{-x}\int_{-\infty}^{(2t-x)/2\sqrt{t}}e^{-z^2}\,dz\\\\
&=-\frac{\sqrt{\pi}}{2}\left(e^{x}\text{erfc}\left(\frac{2t+x}{\sqrt{t}}\right)+e^{-x}\text{erfc}\left(\frac{2t-x}{\sqrt{t}}\right)\right)+\sqrt{\pi}e^{-x}
\end{align}$$
Putting it all together, we obtain 
$$\bbox[5px,border:2px solid #C0A000]{I(t)=\frac{\pi}{4}\left(e^{t+x}\text{erfc}\left(\frac{2t+x}{\sqrt{t}}\right)+e^{t-x}\text{erfc}\left(\frac{2t-x}{\sqrt{t}}\right)\right)}$$
and we are done!
