Heat equation $u_t=u_{xx},u_x(t,0)=0,u(0,x)=e^{-x^2}$ I have this PDE problem on my exam.
$$u_t=u_{xx}$$
$$u_x(t,0)=0$$
$$u(0,x)=e^{-x^2}$$
First is normally to see that equation is heat equation and than look for idea how to solve it. (every PDE is a special case ;) )
So we learn in class how to solve PDE with Poisson formula, but Poisson formula has initial condition only $u(0,x)=f(x)$ not the part of $u_x$ so I decided to move on. The one more method is to use Fourier series and separation of variables, but this method is used to solve PDE on closed domain with homogeneous boundary condition which in this problem is not a case.
So I ask you for help.
 A: Long solution
Being the domain infinite in one variable you have to use the Fourier transform or, if you prefer, the Laplace transform. Let me show you how to do it, using Fourier transform. 
First off we take the Fourier transform of both sides of the PDE and get 
$$
\mathcal F\{u_t\} = \mathcal F\{u_{xx}\}\implies \frac{\partial}{\partial t} \hat{u}(k,t) = -k^2\hat{u}(k,t)
$$
This was done by using the simple property of derivation under Fourier transform (all properties are listed on the linked wikipedia page). The function $\hat u$ is the Fourier transform of $u$. Continuing with the solution, we now have a simpler PDE to which the solution is well known 
$$ 
\frac{\partial}{\partial t} \hat{u}(k,t) = -k^2\hat{u}(k,t) \\
\hat{u}(k,t) = c(k)e^{-k^2t} \tag 1
$$
where $c(k)$ is a function to be found by the initial conditions. If we take te Fourier transform of the initial condition we can find $c(k)$. In fact 
$$
\mathcal F\{u(x,0)\} = \mathcal F\{e^{-x^2}\} = \frac{1}{\sqrt{2\pi}}\int_{\mathbb R} e^{-ikx}e^{-x^2}\,\mathbb d x = e^{-\frac{k^2}{4}}
$$
A very well known Fourier transform is the one of the Gaussian function: indeed the transform of a Gaussian is itself a Gaussian (with some numeric factors depending on your definition of Fourier transform). You can evaluate it yourself, but there's a table in the wikipedia page.
Plugging this into the function found in $(1)$ what we get is 
$$
\hat{u}(k,0) = c = e^{-\frac{k^2}{4}}
$$
So our solution to the differential equation $(1)$ is 
$$
\hat{u}(k,t) = e^{-\frac{k^2}{4}}e^{-k^2 t} = e^{-\left(t+\frac{1}{4}\right)k^2}
$$
To go back to the function we just take the inverse Fourier transform of both sides 
$$
\mathcal F^-1\{\hat{u}(k,t)\} = \mathcal F^{-1}\left\{e^{-\left(t+\frac{1}{4}\right)k^2}\right\}\\
u(x,t) = \frac{1}{\sqrt{2\pi}}\int_{\mathbb R} e^{ikx}e^{-\left(t+\frac{1}{4}\right)k^2}\,\mathbb dk
$$
In our case we have that 
$$
\underbrace{\frac{c}{\sqrt{2\pi}}\int_{\mathbb R} e^{ikt}e^{-\left(t+\frac{1}{4}\right)k^2}\,\mathbb d k}_{\text{Inverse transform of }e^{-\left(t+\frac{1}{4}\right)k^2}} = \sqrt{\frac{2}{4t+1}}e^{-\frac{x^2}{4t+1}} = u(x,t)
$$
It follows clearly that 
$$
u_x(x,t) = -\frac{2x}{4t+1}\sqrt{\frac{2}{4t+1}}e^{-\frac{x^2}{4t+1}}\\[20pt]
\implies u_x(0,t) = 0
$$
So at the end, our solution to the problem is 
$$
u(x,t) = \sqrt{\frac{2}{4t+1}}e^{-\frac{x^2}{4t+1}} = \frac{2}{\sqrt{8t+2}}e^{-\frac{x^2}{4t+1}}
$$
the last step is totally not mandatory.
Faster solution
This solution requires you to know the Green's function on the standard heat equation 
$$
u_t = Du_{xx}
$$
which is 
$$
\mathcal G(x,x') = \frac{1}{\sqrt{4\pi D t}}e^{-\frac{(x-x')^2}{4Dt}} \tag 2
$$
From this you can easily find the solution by integration 
$$
u(x,t) = \int_{\mathbb R}\mathcal G(x,x')u(x',0)\,\mathbb d x' \tag 3
$$
Your initial condition is pretty convenient! If we plug it in $(3)$ with $(2)$ what we get is 
$$
u(x,t) = \frac{1}{\sqrt{4\pi D t}} \int_{\mathbb R}e^{-\frac{(x-x')^2}{4Dt}}e^{-x'^2}\,\mathbb d x'
$$
which upon closer inspection it is clearly a convolution between two Gaussians! And again, by a very cool property of the Gaussian, the convolution of two Gaussians is itself a Gaussian.
$$
\left( e^{-\frac{x^2}{4Dt}} * e^{-x^2}\right) = \color{red}{\frac{1}{\sqrt{2\pi}}}\frac{\sqrt{\pi}}{\sqrt{\frac{1}{4Dt}+1}} e^{-\frac{x^2}{4Dt +1 }}
$$
the red factor comes from the convolution theorem an the definition of Fourier transform that I'm using. Plugging $D=1$ you would get the solution.
A: The function
$$
              \frac{1}{2\sqrt{t}}e^{-x^2/4t}
$$
is a solution of the heat equation, and this is equal to $e^{-x^2}$ at $t=1/4$. So you can shift time:
$$
      u(x,t) = \frac{1}{2\sqrt{t+1/4}}e^{-x^2/4(t+1/4)}
$$
The shifted function remains a solution of $u_t=u_{xx}$ and $u(0,x)=e^{-x^2}$, with $u_x(t,0)=0$.
A: You have that the equation and the given conditions are even in space, i.e. it is invariant w.r.t. the transformation  $x\to -x$.
This allows us to write the solution as a infinite sum of even functions in space. For example, take the expansion in cosines:
$$u(x,t)=\int_{\mathbb{R}}{a(\lambda,t)\cos{(\lambda x)}\,d\lambda}$$
Now introduce this solution into your equation:
$$\int_{\mathbb{R}}\left(a_t(\lambda,t)+\lambda^2 a(\lambda,t)\right)\cos{(\lambda x)}\,d\lambda=0 \quad \forall x$$
Then we know that the equation within the brackets must vanish:
$$a_t(\lambda,t)+\lambda^2 a(\lambda,t)=0$$
Which gives:
$$a(\lambda,t) = c(\lambda)\exp{(-\lambda^2t)}$$
and the solution remains indeterminate up to the function $c(\lambda)$:
$$u(x,t)=\int_{\mathbb{R}}{c(\lambda)\exp{(-\lambda^2t)}\cos{(\lambda x)}\,d\lambda}$$
We now have an initial condition, that claims that:
$$u(x,0) = \int_{\mathbb{R}}{c(\lambda)\cos{(\lambda x)}\,d\lambda}=\exp{(-x^2)}$$
Which indicates that $c(\lambda)$ is the Fourier transform of $\exp{(-x^2)}$, i.e.:
$$c(\lambda) = \frac{1}{2\pi}\int_{\mathbb{R}}{\exp{(-y^2)}\cos{(\lambda y)}\,dy}$$
Being the complete solution:
$$u(x,t) = \int_{\mathbb{R}}{\left[\frac{1}{2\pi}\int_{\mathbb{R}}{\exp{(-y^2)}\cos{(\lambda y)}\,dy}\right]\exp{(-\lambda^2t)}\cos{(\lambda x)}\,d\lambda}$$
