Solving the diffusion equation on the whole line

562 Views Asked by At

I am studying for my PDEs exam and got stuck in one of the questions for the review:

Q: Solve the equation

$$u_t = ku_{xx}$$ $$u(x,0)=\phi(x)= \begin{cases} -1 & x<0 \\ +1 & x>0\end{cases}$$

Using the general formula:

$$u(x,t) = \frac{1}{\sqrt{4 \pi kt}}\int_{-\infty}^\infty e^{-(x-y)^2/4kt} \phi(y) \mathrm{d}y$$ $$= \frac{-2}{\sqrt{\pi}} \int_0^\infty e^{-(x-y)^2/4kt} \mathrm{d}y$$

and performing a change of variables $p=(x-y)/\sqrt{4kt}$

$$u(x,t)=-2\int_{\frac{x}{\sqrt{4kt}}}^{-\infty}e^{-p^2} \mathrm{d}p$$

I am unsure how to change the integral limits to get something representable in terms of the error function. I thought of doing another change of variables with $p = -p'$ but I am not sure it was correct.

Thank you

UPDATE:

I tried what the comment said and came up with the following:

$$u(x,t) = 2\int_{\frac{x}{\sqrt{4kt}}}^{-\infty}e^{-p^2} \mathrm{d}p$$

$$= 2 \sqrt{2\pi} \Phi(\frac{x}{\sqrt{4kt}})$$

$$= \sqrt{2 \pi} (1 + \mathrm{Erf} (\frac{x}{\sqrt{8\pi t}}))$$

Is this correct?

1

There are 1 best solutions below

0
On

To the updated question.

Is this correct?

Usually, one checks the result by substitution. I assume, you meant to write $$u(x,t)=\sqrt{2 \pi} (1 + \mathrm{Erf} (\frac{x}{\sqrt{\color{red}{4k} t}}))$$

First, we check the equation:

$$u_t=\sqrt{2 \pi} \frac{2}{\sqrt{\pi}} e^{-x^2/(4kt)} \frac{-x}{2\sqrt{4k}~t^{3/2}}=-\frac{x}{\sqrt{2} t^{3/2}} e^{-x^2/(4kt)}$$

$$u_x=\sqrt{2 \pi} \frac{2}{\sqrt{\pi}} e^{-x^2/(4kt)} \frac{1}{\sqrt{4k}~t^{1/2}}=\frac{\sqrt{2}}{t^{1/2}} e^{-x^2/(4kt)}$$

$$u_{xx}=-\frac{\sqrt{2}x}{2k~t^{3/2}}e^{-x^2/(4kt)}=-\frac{x}{\sqrt{2}k~t^{3/2}}e^{-x^2/(4kt)}$$

Comparing, we see that:

$$u_t=k u_{xx}$$

So the equation is satisfied.

Now we check the initial condition (using the properties of the error function):

$$\lim_{t \to 0} u(x,t)= \sqrt{2 \pi} \begin{cases} 2, & x>0 \\ 0, & x<0 \end{cases}$$

This is not correct, obviously the constant term and the normalization need to be changed to:

$$u(x,t)=\mathrm{Erf} (\frac{x}{\sqrt{4k t}})$$