# Toronto Math Forum

## APM346-2016F => APM346--Tests => TT1 => Topic started by: Victor Ivrii on October 19, 2016, 10:30:41 PM

Title: TT1-P5
Post by: Victor Ivrii on October 19, 2016, 10:30:41 PM
Find the solution $u(x,t)$ to
\begin{align}
&u_t=u_{xx} && -\infty<x<\infty, \ t>0,\label{eq-5-1}\\[2pt]
&u|_{t=0}=\left\{\begin{aligned}
&0      && |x|>1,
\end{aligned}\right.\label{eq-5-2}\\
&\max |u|<\infty. \label{eq-5-3}
\end{align}
Calculate the integral.
Title: Re: TT1-P5
Post by: XinYu Zheng on October 19, 2016, 10:36:22 PM
Before we begin, we need one result:
$$\int z^2 e^{-z^2}\, dz$$
Changing variables, this can be written as
$$-\frac{1}{2}\int z\,d(e^{-z^2})$$
Integrate by parts, set $s=z$, $ds=dz$, $dv=d(e^{-z^2})$, $v=e^{-z^2}$ we have
$$-\frac{1}{2}ze^{-z^2}+\frac{1}{2}\int e^{-z^2}\,dz=\frac{\sqrt{\pi}}{4}erf(z)-\frac{1}{2} ze^{-z^2}$$

Now we begin the problem. The solution is
$$u(x,t)=\frac{1}{\sqrt{4\pi t}} \int_{-1}^1 e^{-\frac{(x-y)^2}{4t}}(1-y^2)\,dy=\frac{1}{\sqrt{4\pi t}} \left( \int_{-1}^1 e^{-\frac{(x-y)^2}{4t}}\,dy- \int_{-1}^1 y^2e^{-\frac{(x-y)^2}{4t}}\,dy\right)$$
From now on, define $a=(x+1)/\sqrt{4t}$ and $b=(x-1)/\sqrt{4t}$ for notational simplicity.
In the first integral, substitute $z=(x-y)/\sqrt{4t}$ so that $dz=-dy/\sqrt{4t}$, so that
$$\int_{-1}^1 e^{-\frac{(x-y)^2}{4t}}\,dy=-\sqrt{4t}\int_a^b e^{-z^2}\,dz=\frac{\sqrt{4\pi t}}{2}\left(erf(a)-erf(b)\right)$$
In the second integral, substitute the same thing. Note that $y^2=x^2-2xz\sqrt{4t}+4tz^2$. So we have
$$\int_{-1}^1 y^2e^{-\frac{(x-y)^2}{4t}}\,dy=-\sqrt{4t}\int_a^b x^2e^{-z^2}-2x\sqrt{4t} ze^{-z^2}+4tz^2 e^{-z^2}\,dz$$
Now integrate the three terms. The first one can be done using error function, the second one can be integrated directly, the third one using the result we obtained above:
$$\int_{-1}^1 y^2e^{-\frac{(x-y)^2}{4t}}\,dy=-\sqrt{4t}\left[ \frac{x^2\sqrt{\pi}}{2}\left(erf(b)-erf(a)\right)+x\sqrt{4t}\left(e^{-b^2}-e^{-a^2}\right)+4t\left(\frac{\sqrt{\pi}}{4}erf(b)-\frac{\sqrt{\pi}}{4}erf(a)-\frac{1}{2}\frac{x-1}{\sqrt{4t}}e^{-b^2}+\frac{1}{2}\frac{x+1}{\sqrt{4t}}e^{-a^2}\right)\right]$$
Now all that is left is to combine the two and simplify. In the end, one obtains
$$u(x,t)=\left(\frac{1}{2}-\frac{x^2}{2}-t\right)erf\left(\frac{x+1}{\sqrt{4t}}\right)+\left(\frac{x^2}{2}-\frac{1}{2}+t\right)erf\left(\frac{x-1}{\sqrt{4t}}\right)+\sqrt{\frac{t}{\pi}}\left[(x+1)e^{-\frac{(x-1)^2}{4t}}+(1-x)e^{-\frac{(x+1)^2}{4t}}\right]$$
Title: Re: TT1-P5
Post by: Victor Ivrii on October 20, 2016, 04:54:32 AM
:) But still please plug $a,b$ so formula will be self-contained