Find the solution of the diffusion equation for a given initial condition in terms of the error function

1.6k Views Asked by At

I'm given that the solution to the diffusion equation on $\mathbb{R}$ is $$u(x,t)=\frac{1}{\sqrt{4\pi Dt}} \int_\mathbb{R} e^{-\frac{(x-y)^2}{4Dt}} f(y) \, dy$$

I'm also given that $f(x)=\begin{cases} 1 & \text{if } 0<x<a \\ 0 & \text{otherwise}\end{cases}$

Now I need to find an explicit form for $u$ in terms of $\operatorname{erf}(x)$.

I have that $$u(x,t)=\frac{1}{\sqrt{4\pi Dt}} \int_0^a e^{-\frac{(x-y)^2}{4Dt}} \, dy$$

From here I guess I need to make a substitution to get the integrand in the form $e^{-r^2}$. Is this correct? If so, what substitution?

Following the suggestion given in the comments I have the following:

$r=\frac{x-y}{\sqrt{4Dt}}$ and therefore $\frac{dr}{dy}=-\frac{1}{\sqrt{4Dt}}$. Plugging these into the integral gives me $$u(x,t)=-\frac{1}{\pi}\int_{x/\sqrt{4Dt}}^{(x-a)/\sqrt{4Dt}}e^{-r^2} \, dr$$

1

There are 1 best solutions below

0
On BEST ANSWER

Starting out we have $$u(x,t) = \frac{1}{\sqrt{4D\pi t}}\int_{\mathbb{R}}e^{-\left(\frac{x-y}{\sqrt{4Dt}}\right)^2} f(y) dy $$ And through substitution and use of the definition of $f(y)$ which you've correctly done, obtained $$ u = -\frac{1}{\pi}\int^{\frac{x-a}{\sqrt{4Dt}}}_{\frac{x}{\sqrt{4Dt}}} e^{-r^2} dr = -\frac{1}{\pi}\int^{r(a)}_{r(0)} e^{-r^2}dr = -\frac{1}{\pi}\left(\operatorname{Erf}(r(a)) - \operatorname{Erf}(r(0)) \right) = -\frac{1}{\pi}\left(\operatorname{Erf}\left(\frac{x-a}{\sqrt{4Dt}}\right) - \operatorname{Erf}\left(\frac{x}{\sqrt{4Dt}}\right) \right)$$ This is because $$\int_a^b e^{-x^2} dx = \operatorname{Erf}(b) -\operatorname{Erf}(a) $$