[Math] Heat equation $u_t=u_{xx},u_x(t,0)=0,u(0,x)=e^{-x^2}$

fourier seriesheat equationlinear-pdeparabolic pdepartial differential equations

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.

Best Answer

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.

Related Question