4.1.6 Semi-infinite domain

4.1.6.1 [235] left end constant (general case)
4.1.6.2 [236] left end constant (special case)
4.1.6.3 [237] Logan p. 76. Left end general function of time (general case)
4.1.6.4 [238] Left end function of time (special case)
4.1.6.5 [239] nonhomogeneous BC
4.1.6.6 [240] I.C. not zero
4.1.6.7 [241] nonhomogeneous BC
4.1.6.8 [242] nonhomogeneous BC
4.1.6.9 [243] nonhomogeneous B.C.
4.1.6.10 [244] Unit triangle I.C.
4.1.6.11 [245] I.C. not at \(t=0\)
4.1.6.12 [246] Diffusion with advection
4.1.6.13 [247] Practice exam problem

4.1.6.1 [235] left end constant (general case)

problem number 235

Added July 6, 2019 Solve the heat equation for \(x>0,t>0\) \[ u_t = k u_{xx} \] The boundary conditions are \(u(0,t)=A\) and initial conditions \(u(x,0)=0\)

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[x, t], t] == k*D[u[x, t], {x, 2}]; 
bc  = u[0, t] == A; 
ic  = u[x, 0] == 0; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], {x, t}, Assumptions -> {k>0,x > 0,t>0}], 60*10]];
 

\[\left \{\left \{u(x,t)\to \frac {A x E_{\frac {1}{2}}\left (\frac {x^2}{4 k t}\right )}{2 \sqrt {\pi } \sqrt {k t}}\right \}\right \}\]

Maple

restart; 
interface(showassumed=0); 
pde := diff(u(x,t),t)=k*diff(u(x,t),x$2); 
ic  := u(x,0)=0; 
bc  := u(0,t)=A; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde,ic,bc],u(x,t)) assuming k>0,x>0,t>0),output='realtime'));
 

\[u \left (x , t\right ) = -A \erf \left (\frac {x}{2 \sqrt {k}\, \sqrt {t}}\right )+A\]

Hand solution

Solving \begin {align} u_{t} & =ku_{xx\qquad }t>0,x>0\tag {1}\\ u\left ( 0,t\right ) & =A\nonumber \\ u\left ( x,0\right ) & =0\nonumber \end {align}

And \(u\left ( x,t\right ) <\infty \) as \(x\rightarrow \infty \). This means \(u\left ( x,t\right ) \) is bounded. This conditions is always needed to solve these problems.

Let \(U\left ( x,s\right ) \) be the Laplace transform of \(u\left ( x,t\right ) \). Defined as \[\mathcal {L}\left ( u,t\right ) =\int _{0}^{\infty }e^{-st}u\left ( x,t\right ) dt \] Applying Laplace transform to the original PDE (1) gives\[ sU\left ( x,s\right ) -u\left ( x,0\right ) =kU_{xx}\left ( x,s\right ) \] But \(u\left ( x,0\right ) =0\), therefore the above becomes\[ U_{xx}-\frac {s}{k}U=0 \] The solution to this differential equation is\[ U\left ( x,s\right ) =c_{1}e^{\sqrt {\frac {s}{k}}x}+c_{2}e^{-\sqrt {\frac {s}{k}}x}\] Since \(u\left ( x,t\right ) \) is bounded in the limit as \(x\rightarrow \infty \) and \(k>0\), therefore it must be that \(c_{1}=0\) to keep the solution bounded. The above simplifies to\begin {equation} U\left ( x,s\right ) =c_{2}e^{-\sqrt {\frac {s}{k}}x}\tag {2} \end {equation} At \(x=0\,,u\left ( 0,t\right ) =A\). Therefore \(U\left ( 0,s\right ) =\mathcal {L}\left ( u\left ( 0,t\right ) \right ) =\mathcal {L}\left ( A\right ) =\frac {1}{s}A\). Hence at \(x=0\) the above gives\[ \frac {1}{s}A=c_{2}\] Therefore (2) becomes\begin {equation} U\left ( x,s\right ) =\frac {A}{s}e^{-\sqrt {\frac {s}{k}}x}\tag {3} \end {equation} From tables, the inverse Laplace transform of the above is (since \(x>0,k>0\))\begin {align*} u\left ( x,t\right ) & =A\operatorname {erfc}\left ( \frac {x}{2\sqrt {kt}}\right ) \\ & =A\left ( 1-\operatorname {erf}\left ( \frac {x}{2\sqrt {kt}}\right ) \right ) \end {align*}

____________________________________________________________________________________

4.1.6.2 [236] left end constant (special case)

problem number 236

Added July 6, 2019 Solve the heat equation for \(x>0,t>0\) \[ u_t = k u_{xx} \] The boundary conditions are \(u(0,t)=A\) and initial conditions \(u(x,0)=0\), using \begin {align*} A &=60\\ k &=\frac {1}{10} \end {align*}

Mathematica

ClearAll["Global`*"]; 
k=1/10; A=60; 
pde =  D[u[x, t], t] == k*D[u[x, t], {x, 2}]; 
bc  = u[0, t] == A; 
ic  = u[x, 0] == 0; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], {x, t}], 60*10]];
 

\[\{\{u(x,t)\to \fbox {$\text {Indeterminate}\text { if }x\leq 0$}\}\}\] It fail if assumption \(x>0\) is given. A bug

Maple

restart; 
k:=1/10; 
A:=60; 
pde := diff(u(x,t),t)=k*diff(u(x,t),x$2); 
ic  := u(x,0)=0; 
bc  := u(0,t)=A; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde,ic,bc],u(x,t)) assuming x>0),output='realtime'));
 

\[u \left (x , t\right ) = -60 \erf \left (\frac {\sqrt {10}\, x}{2 \sqrt {t}}\right )+60\]

Hand solution

Solving on semi-infinite domain \begin {align*} u_{t} & =ku_{xx}\qquad t>0,x>0\\ u\left ( 0,t\right ) & =A\\ u\left ( x,0\right ) & =0 \end {align*}

With \(A=60,k=\frac {1}{10}\)

The general problem above was solved in 4.1.6.1 on page 791 and the solution is\[ u\left ( x,t\right ) =A\left ( 1-\operatorname {erf}\left ( \frac {x}{2\sqrt {kt}}\right ) \right ) \] Substituting the specific values given above into this solution gives\[ u\left ( x,t\right ) =60\left ( 1-\operatorname {erf}\left ( \frac {x}{2\sqrt {\frac {t}{10}}}\right ) \right ) \] Animation is below

Source code used for the above

____________________________________________________________________________________

4.1.6.3 [237] Logan p. 76. Left end general function of time (general case)

problem number 237

This is problem at page 76 from David J Logan text book.

Solve the heat equation for \(x>0,t>0\) \[ u_t = k u_{xx} \] The boundary conditions are \(u(0,t)=f(t)\) and initial conditions \(u(x,0)=0\)

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[x, t], t] == k*D[u[x, t], {x, 2}]; 
bc  = u[0, t] == f[t]; 
ic  = u[x, 0] == 0; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], {x, t}, Assumptions -> {t > 0, x > 0,k>0}], 60*10]]; 
sol =  sol /. {K[2] -> z}
 

\[\left \{\left \{u(x,t)\to \frac {x \text {Integrate}\left [\frac {f(z) e^{-\frac {x^2}{4 k t-4 k z}}}{(t-z)^{3/2}},\{z,0,t\},\text {Assumptions}\to \text {True}\right ]}{2 \sqrt {\pi } \sqrt {k}}\right \}\right \}\]

Maple

restart; 
interface(showassumed=0); 
pde := diff(u(x,t),t)=k*diff(u(x,t),x$2); 
ic  := u(x,0)=0; 
bc  := u(0,t)=f(t); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde,ic,bc],u(x,t)) assuming t>0,x>0,k>0),output='realtime'));
 

\[u \left (x , t\right ) = \frac {x \left (\int _{0}^{t}\frac {{\mathrm e}^{\frac {x^{2}}{4 \left (-t +\zeta \right ) k}} f \left (\zeta \right )}{\left (t -\zeta \right )^{\frac {3}{2}}}d \zeta \right )}{2 \sqrt {\pi }\, \sqrt {k}}\]

Hand solution

Solving on semi-infinite domain \begin {align} u_{t} & =ku_{xx}\qquad t>0,x>0\tag {1}\\ u\left ( 0,t\right ) & =f\left ( t\right ) \nonumber \\ u\left ( x,0\right ) & =0\nonumber \end {align}

With \(k>0\) and \(u\left ( x,t\right ) <\infty \) as \(x\rightarrow \infty \). This means \(u\left ( x,t\right ) \) is bounded. This conditions is always needed to solve these problems.

Let \(U\left ( x,s\right ) \) be the Laplace transform of \(u\left ( x,t\right ) \). Defined as \[\mathcal {L}\left ( u,t\right ) =\int _{0}^{\infty }e^{-st}u\left ( x,t\right ) dt \] Applying Laplace transform to the original PDE (1) gives\[ sU\left ( x,s\right ) -u\left ( x,0\right ) =kU_{xx}\left ( x,s\right ) \] But \(u\left ( x,0\right ) =0\), therefore the above becomes\[ U_{xx}-\frac {s}{k}U=0 \] The solution to this differential equation is\[ U\left ( x,s\right ) =c_{1}e^{\sqrt {\frac {s}{k}}x}+c_{2}e^{-\sqrt {\frac {s}{k}}x}\] Since \(u\left ( x,t\right ) \) is bounded in the limit as \(x\rightarrow \infty \) and \(k>0\), therefore it must be that \(c_{1}=0\) to keep the solution bounded. The above simplifies to\begin {equation} U\left ( x,s\right ) =c_{2}e^{-\sqrt {\frac {s}{k}}x}\tag {2} \end {equation} At \(x=0\,,u\left ( 0,t\right ) =f\left ( t\right ) \). Therefore \(U\left ( 0,s\right ) =\mathcal {L}\left ( f\left ( t\right ) \right ) =F\left ( s\right ) \). Hence at \(x=0\) the above gives\[ F\left ( s\right ) =c_{2}\] Therefore (2) becomes\begin {equation} U\left ( x,s\right ) =F\left ( s\right ) e^{-\sqrt {\frac {s}{k}}x}\tag {3} \end {equation} By convolution, the above becomes\begin {equation} u\left ( x,t\right ) =f\left ( t\right ) \circledast G\left ( x,t\right ) \tag {4} \end {equation} Where \(G\left ( x,t\right ) \) is the inverse transform of \(e^{-\sqrt {\frac {s}{k}}x}\) which is \(\frac {xe^{\frac {-x^{2}}{4kt}}}{2\sqrt {k\pi }t^{\frac {3}{2}}}\). Hence (4) becomes\begin {align*} u\left ( x,t\right ) & =f\left ( t\right ) \circledast \frac {xe^{\frac {-x^{2}}{4kt}}}{2\sqrt {k\pi }t^{\frac {3}{2}}}\\ & =\frac {x}{2\sqrt {k\pi }}\int _{0}^{t}\frac {f\left ( \tau \right ) }{\left ( t-\tau \right ) ^{\frac {3}{2}}}e^{\frac {-x^{2}}{4k\left ( t-\tau \right ) }}d\tau \end {align*}

For \(k=1\)\[ u\left ( x,t\right ) =\frac {x}{2\sqrt {\pi }}\int _{0}^{t}\frac {f\left ( \tau \right ) }{\left ( t-\tau \right ) ^{\frac {3}{2}}}e^{\frac {-x^{2}}{4\left ( t-\tau \right ) }}d\tau \]

____________________________________________________________________________________

4.1.6.4 [238] Left end function of time (special case)

problem number 238

Added July 7, 2019 Solve the heat equation for \(x>0,t>0\) \[ u_t = k u_{xx} \] The boundary conditions are \(u(0,t)=\sin (t)\) and initial conditions \(u(x,0)=0\) using \(k=\frac {1}{10}\)

Mathematica

ClearAll["Global`*"]; 
k=1/10; 
pde =  D[u[x, t], t] == k*D[u[x, t], {x, 2}]; 
bc  = u[0, t] == Sin[t]; 
ic  = u[x, 0] == 0; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], {x, t}, Assumptions -> {t > 0, x > 0}], 60*10]];
 

\[\left \{\left \{u(x,t)\to \sqrt {\frac {5}{2 \pi }} x \text {Integrate}\left [\frac {\sin (K[2]) e^{-\frac {5 x^2}{2 (t-K[2])}}}{(t-K[2])^{3/2}},\{K[2],0,t\},\text {Assumptions}\to \text {True}\right ]\right \}\right \}\]

Maple

restart; 
interface(showassumed=0); 
k:=1/10; 
pde := diff(u(x,t),t)=k*diff(u(x,t),x$2); 
ic  := u(x,0)=0; 
bc  := u(0,t)=sin(t); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde,ic,bc],u(x,t)) assuming t>0,x>0),output='realtime'));
 

\[u \left (x , t\right ) = -\frac {\sqrt {10}\, x \left (\int _{0}^{t}-\frac {{\mathrm e}^{-\frac {5 x^{2}}{2 \zeta }} \sin \left (t -\zeta \right )}{\zeta ^{\frac {3}{2}}}d \zeta \right )}{2 \sqrt {\pi }}\]

Hand solution

Solving

\begin {align} u_{t} & =ku_{xx}\qquad t>0,x>0\tag {1}\\ u\left ( 0,t\right ) & =f\left ( t\right ) \nonumber \\ u\left ( x,0\right ) & =0\nonumber \end {align}

Using \(k=\frac {1}{10}\) and \(f\left ( t\right ) =\sin \left ( t\right ) \).

The general solution was solved in problem 4.1.6.3 on page 803 and the solution was found to be\[ u\left ( x,t\right ) =\frac {x}{2\sqrt {k\pi }}\int _{0}^{t}\frac {f\left ( \tau \right ) }{\left ( t-\tau \right ) ^{\frac {3}{2}}}e^{\frac {-x^{2}}{4k\left ( t-\tau \right ) }}d\tau \] Replacing the given values above, the solution becomes\[ u\left ( x,t\right ) =\sqrt {\frac {5}{2}}\frac {x}{\sqrt {\pi }}\int _{0}^{t}\frac {\sin \left ( \tau \right ) }{\left ( t-\tau \right ) ^{\frac {3}{2}}}e^{\frac {-5x^{2}}{2\left ( t-\tau \right ) }}d\tau \] We could also use the following form of the solution\[ u\left ( x,t\right ) =\sqrt {\frac {5}{2}}\frac {x}{\sqrt {\pi }}\int _{0}^{t}\frac {\sin \left ( t-\tau \right ) }{\tau ^{\frac {3}{2}}}e^{\frac {-5x^{2}}{2\tau }}d\tau \] Animation is below

Source code used for the above

____________________________________________________________________________________

4.1.6.5 [239] nonhomogeneous BC

problem number 239

Solve the heat equation \[ \frac { \partial u}{\partial t} = k \frac { \partial ^2 u}{\partial x^2} \] For \(x>0\) and \(t>0\). The boundary conditions is \(u(0,t)=1\) and And initial condition \(u(x,0)=0\)

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[x, t], t] == k*D[u[x, t], {x, 2}]; 
bc  = u[0, t] == 1; 
ic  = u[x, 0] == 0; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], {x, t}, Assumptions -> {t > 0, k > 0, x > 0}], 60*10]];
 

\[\left \{\left \{u(x,t)\to \frac {x E_{\frac {1}{2}}\left (\frac {x^2}{4 k t}\right )}{2 \sqrt {\pi } \sqrt {k t}}\right \}\right \}\]

Maple

restart; 
interface(showassumed=0); 
pde := diff(u(x,t),t)=k*diff(u(x,t),x$2); 
ic  := u(x,0)=0: 
bc  := u(0,t)=1; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde,ic,bc],u(x,t),HINT = boundedseries) assuming t>0,x>0,k>0),output='realtime'));
 

\[u \left (x , t\right ) = \mathrm {erfc}\left (\frac {x}{2 \sqrt {k t}}\right )\]

____________________________________________________________________________________

4.1.6.6 [240] I.C. not zero

problem number 240

Added December 20, 2018.

From https://www.mapleprimes.com/posts/209970-Exact-Solutions-For-PDE-And-Boundary--Initial-Conditions-2018

Solve the heat equation for \(u(x,t)\) \[ \frac { \partial u}{\partial t}= \frac {1}{4} \frac { \partial ^2 u}{\partial x^2} \] With initial condition \[ u(x,t_0)= 10; \] And boundary conditions \[ u(-x_0,t) = 0 \] For \(x>|x_0|\) and \(t>|t_0|\).

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[x, t], t] == (1/4)*D[u[x, t], {x, 2}]; 
bc  = u[-x0, t] == 0; 
ic  = u[x, t0] == 10; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], x, t, Assumptions -> {t > Abs[t0], x > Abs[x0]}], 60*10]];
 

\[\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} 10 \text {erf}\left (\frac {x+\text {x0}}{\sqrt {t-\text {t0}}}\right ) & x+\text {x0}>0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}\] due to IC/BC not zero

Maple

restart; 
pde := diff(u(x, t), t) = (1/4)*(diff(u(x, t), x$2)); 
bc  := u(-x0, t) = 0; 
ic  := u(x, t0) = 10; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde, bc,ic],u(x,t)) assuming x>abs(x0), t>abs(t0)),output='realtime'));
 

\[u \left (x , t\right ) = 10 \erf \left (\frac {x +\mathit {x0}}{\sqrt {t -\mathit {t0}}}\right )\]

____________________________________________________________________________________

4.1.6.7 [241] nonhomogeneous BC

problem number 241

Solve the heat equation

\[ \frac { \partial u}{\partial t} = k \frac { \partial ^2 u}{\partial x^2} \] For \(x>0\) and \(t>0\). The boundary conditions is \(u(0,t)=\mu \) and And initial condition \(u(x,0)=\lambda \)

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[x, t], t] == k*D[u[x, t], {x, 2}]; 
bc  = u[0, t] == lambda; 
ic  = u[x, 0] == mu; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], {x, t}, Assumptions -> {t > 0, k > 0, x > 0}], 60*10]];
 

\[\left \{\left \{u(x,t)\to \mu \text {erf}\left (\frac {x}{2 \sqrt {k t}}\right )+\frac {\lambda x E_{\frac {1}{2}}\left (\frac {x^2}{4 k t}\right )}{2 \sqrt {\pi } \sqrt {k t}}\right \}\right \}\]

Maple

restart; 
interface(showassumed=0); 
pde := diff(u(x,t),t)=k*diff(u(x,t),x$2); 
ic  := u(x,0)=mu: 
bc  := u(0,t)=lambda; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde,ic,bc],u(x,t),HINT = boundedseries) assuming t>0,x>0,k>0),output='realtime'));
 

\[u \left (x , t\right ) = \mu +\left (\lambda -\mu \right ) \mathrm {erfc}\left (\frac {x}{2 \sqrt {k t}}\right )\]

____________________________________________________________________________________

4.1.6.8 [242] nonhomogeneous BC

problem number 242

From Mathematica DSolve help pages. Solve the heat equation for \(u(x,t)\) on half the line \(x>0\) and \(t>0\) \[ \frac { \partial u}{\partial t}= \frac { \partial ^2 u}{\partial x^2} \] With initial condition \[ u(x,0)= \cos x \] And boundary conditions \[ u(0,t)= 1 \]

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[x, t], t] == D[u[x, t], {x, 2}]; 
ic  = u[x, 0] == Cos[x]; 
bc  = u[0, t] == 1; 
sol =  AbsoluteTiming[TimeConstrained[FullSimplify[DSolve[{pde, ic, bc}, u[x, t], {x, t}]], 60*10]];
 

\[\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {\text {Integrate}\left [\left (e^{-\frac {(x-K[1])^2}{4 t}}-e^{-\frac {(x+K[1])^2}{4 t}}\right ) \cos (K[1]),\{K[1],0,\infty \},\text {Assumptions}\to \text {True}\right ]+\sqrt {t} x \text {Integrate}\left [\frac {e^{-\frac {x^2}{4 (t-K[2])}}}{(t-K[2])^{3/2}},\{K[2],0,t\},\text {Assumptions}\to \text {True}\right ]}{2 \sqrt {\pi } \sqrt {t}} & x>0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}\]

Maple

restart; 
pde := diff(u(x, t), t)=diff(u(x, t), x$2); 
ic  := u(x,0)=cos(x); 
bc  := u(0,t)=1; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,ic,bc],u(x,t)) assuming t>0 and x>0),output='realtime'));
 

\[u \left (x , t\right ) = -\frac {\erf \left (\frac {2 i t -x}{2 \sqrt {t}}\right ) {\mathrm e}^{-i x -t}}{2}+\frac {\erf \left (\frac {2 i t +x}{2 \sqrt {t}}\right ) {\mathrm e}^{i x -t}}{2}-\erf \left (\frac {x}{2 \sqrt {t}}\right )+1\]

____________________________________________________________________________________

4.1.6.9 [243] nonhomogeneous B.C.

problem number 243

Solve the heat equation for \(u(x,t)\) on half the line \(x>0\) and \(t>0\) \[ u_t = k u_{xx} \] With initial condition \[ u(x,0)=0 \] And boundary conditions \(u(0,t)=t\). Solution is bounded at infinity.

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[x, t], t] == k*D[u[x, t], {x, 2}]; 
ic  = u[x, 0] == 0; 
bc  = u[0, t] == t; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[x, t], {x, t}, Assumptions -> {k > 0, x > 0, t > 0}], 60*10]];
 

\[\left \{\left \{u(x,t)\to \frac {\left (2 k t+x^2\right ) \operatorname {Erfc}\left (\frac {x}{2 \sqrt {k t}}\right )-\frac {2 x \sqrt {k t} e^{-\frac {x^2}{4 k t}}}{\sqrt {\pi }}}{2 k}\right \}\right \}\]

Maple

restart; 
interface(showassumed=0); 
pde := diff(u(x, t), t)=k*diff(u(x, t), x$2); 
ic  := u(x,0)=0; 
bc  := u(0,t)=t; 
assume(x>0); 
assume(t>0); 
assume(k>0); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,ic,bc],u(x,t))),output='realtime'));
 

\[u \left (x , t\right ) = -\frac {2 \sqrt {k}\, t x \,{\mathrm e}^{-\frac {x^{2}}{4 k t}}+\sqrt {\pi }\, \left (\erf \left (\frac {x}{2 \sqrt {k}\, \sqrt {t}}\right )-1\right ) \left (2 k \,t^{\frac {3}{2}}+\sqrt {t}\, x^{2}\right )}{2 \sqrt {\pi }\, k \sqrt {t}}\]

____________________________________________________________________________________

4.1.6.10 [244] Unit triangle I.C.

problem number 244

From Mathematica DSolve help pages. Solve the heat equation for \(u(x,t)\) on half the line \(x>0\) and \(t>0\) \[ u_t= u_{xx} \] With initial condition \[ u(x,0)= \text {UnitTriagle[x-3]} \] And boundary conditions \[ \frac { \partial u}{\partial x}(0,t)= 0 \]

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[x, t], t] == D[u[x, t], {x, 2}]; 
ic  = u[x, 0] == UnitTriangle[x - 3]; 
bc  = Derivative[1, 0][u][0, t] == 0; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[x, t], {x, t}], 60*10]];
 

\[\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {1}{2} \left (\frac {\text {erf}\left (\frac {| x-4| }{2 \sqrt {t}}\right ) (x-4)^2}{| 4-x| }+(x+2) \text {erf}\left (\frac {x+2}{2 \sqrt {t}}\right )-2 (x+3) \text {erf}\left (\frac {x+3}{2 \sqrt {t}}\right )+(x+4) \text {erf}\left (\frac {x+4}{2 \sqrt {t}}\right )-\frac {2 (x-3)^2 \text {erf}\left (\frac {| x-3| }{2 \sqrt {t}}\right )}{| 3-x| }+\frac {(x-2)^2 \text {erf}\left (\frac {| x-2| }{2 \sqrt {t}}\right )}{| 2-x| }+\frac {2 \left (e^{-\frac {(x-4)^2}{4 t}}-2 e^{-\frac {(x-3)^2}{4 t}}+e^{-\frac {(x-2)^2}{4 t}}+e^{-\frac {(x+2)^2}{4 t}}-2 e^{-\frac {(x+3)^2}{4 t}}+e^{-\frac {(x+4)^2}{4 t}}\right ) \sqrt {t}}{\sqrt {\pi }}\right ) & x>0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}\]

Maple

restart; 
pde := diff(u(x, t), t)=diff(u(x, t), x$2); 
ic  := u(x,0)=piecewise( x>2 and x<3,-2+x, x>3 and x<4, 4-x, 0); 
bc:=(D[1](u))(0,t)=0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,ic,bc],u(x,t)) assuming t>0 and x>0),output='realtime'));
 

\[u \left (x , t\right ) = \frac {t \,{\mathrm e}^{-\frac {\left (x -4\right )^{2}}{4 t}}-2 t \,{\mathrm e}^{-\frac {\left (x -3\right )^{2}}{4 t}}+t \,{\mathrm e}^{-\frac {\left (x -2\right )^{2}}{4 t}}+t \,{\mathrm e}^{-\frac {\left (x +2\right )^{2}}{4 t}}-2 t \,{\mathrm e}^{-\frac {\left (x +3\right )^{2}}{4 t}}+t \,{\mathrm e}^{-\frac {\left (x +4\right )^{2}}{4 t}}+\frac {\left (\left (x -4\right ) \erf \left (\frac {x -4}{2 \sqrt {t}}\right )+\left (-2 x +6\right ) \erf \left (\frac {x -3}{2 \sqrt {t}}\right )+\left (x -2\right ) \erf \left (\frac {x -2}{2 \sqrt {t}}\right )+\left (x +2\right ) \erf \left (\frac {x +2}{2 \sqrt {t}}\right )+\left (-2 x -6\right ) \erf \left (\frac {x +3}{2 \sqrt {t}}\right )+\left (x +4\right ) \erf \left (\frac {x +4}{2 \sqrt {t}}\right )\right ) \sqrt {\pi }\, \sqrt {t}}{2}}{\sqrt {\pi }\, \sqrt {t}}\]

____________________________________________________________________________________

4.1.6.11 [245] I.C. not at \(t=0\)

problem number 245

Added December 20, 2018.

Taken from https://www.mapleprimes.com/posts/209970-Exact-Solutions-For-PDE-And-Boundary--Initial-Conditions-2018

Solve for \(u(x,t)\) for \(t>0,x>0\) \[ u_t= \frac {1}{4} u_{xx} \] With initial condition \[ u(x,t_0)= 10 e^{-x^2} \] And boundary conditions \[ \frac { \partial u}{\partial x}(x_0,t)= 0 \]

Mathematica

ClearAll["Global`*"]; 
pde =  D[u[x, t], t] == (1*D[u[x, t], {x, 2}])/4; 
ic  = u[x, t0] == 10*Exp[-x^2]; 
bc  = Derivative[1, 0][u][x0, t] == 0; 
sol =  AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[x, t], {x, t}, Assumptions -> {x > 0, t > 0}], 60*10]];
 

\[\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {5 \left (e^{-\frac {x^2}{t-\text {t0}+1}} \left (\text {erf}\left (\frac {x+(-t+\text {t0}-1) \text {x0}}{\sqrt {t^2-2 \text {t0} t+t+(\text {t0}-1) \text {t0}}}\right )+1\right )+e^{-\frac {(x-2 \text {x0})^2}{t-\text {t0}+1}} \operatorname {Erfc}\left (\frac {x+(t-\text {t0}-1) \text {x0}}{\sqrt {(t-\text {t0}) (t-\text {t0}+1)}}\right )\right )}{\sqrt {t-\text {t0}+1}} & x>\text {x0} \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}\]

Maple

restart; 
pde := diff(u(x, t), t) = 1/4*(diff(u(x, t), x$2)); 
bc  := eval( diff(u(x,t),x),x=x0)=0; 
ic  := u(x,t0)=10*exp(-x^2); 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc,ic],u(x,t)) assuming x>0,t>0),output='realtime'));
 

\[u \left (x , t\right ) = -\frac {5 \left (-\erf \left (\frac {x +\left (-t +\mathit {t0} -1\right ) \mathit {x0}}{\sqrt {t -\mathit {t0}}\, \sqrt {t -\mathit {t0} +1}}\right ) {\mathrm e}^{\frac {x^{2}}{-t +\mathit {t0} -1}}-{\mathrm e}^{\frac {x^{2}}{-t +\mathit {t0} -1}}+\left (\erf \left (\frac {-\mathit {t0} \mathit {x0} +x +\left (t -1\right ) \mathit {x0}}{\sqrt {t -\mathit {t0}}\, \sqrt {t -\mathit {t0} +1}}\right )-1\right ) {\mathrm e}^{-\frac {\left (x -2 \mathit {x0} \right )^{2}}{t -\mathit {t0} +1}}\right )}{\sqrt {t -\mathit {t0} +1}}\]

____________________________________________________________________________________

4.1.6.12 [246] Diffusion with advection

problem number 246

Added April 5, 2019.

Solve for \(u(x,t)\) in \[ u_t = u_{xx} - u_x \]

For \(t>0,x>0\). With boundary conditions \(u(0,t)=0\) and intitial conditions \(u(x,0)=f(x)\)

Mathematica

ClearAll["Global`*"]; 
pde = D[u[x, t], t] == D[u[x, t], {x, 2}] - D[u[x, t], x]; 
ic  = u[x, 0] == f[x]; 
bc  = u[0, t] == 0; 
sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[x, t], {x, t}, Assumptions -> {x > 0, t > 0}], 60*10]];
 

\[\left \{\left \{u(x,t)\to e^{\frac {x}{2}-\frac {t}{4}} \left (\begin {array}{cc} \{ & \begin {array}{cc} \frac {\text {Integrate}\left [e^{-\frac {K[1]}{2}} \left (e^{-\frac {(x-K[1])^2}{4 t}}-e^{-\frac {(x+K[1])^2}{4 t}}\right ) f(K[1]),\{K[1],0,\infty \},\text {Assumptions}\to \text {True}\right ]}{2 \sqrt {\pi } \sqrt {t}} & x>0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right )\right \}\right \}\]

Maple

restart; 
pde := diff(u(x,t),t)=diff(u(x,t),x$2)- diff(u(x,t),x); 
ic  := u(x,0)=f(x); 
bc  := u(0,t)=0; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde, ic, bc], u(x, t))assuming t>0,x>0),output='realtime'));
 

\[u \left (x , t\right ) = \left (\mathcal {L}^{-1}\left (\frac {\int \frac {\sqrt {{\mathrm e}^{\sqrt {4 s +1}\, x}}\, f \left (x \right )}{\sqrt {{\mathrm e}^{x}}}d x}{\sqrt {4 s +1}\, \sqrt {{\mathrm e}^{\sqrt {4 s +1}\, x}}}, s , t\right )-\mathcal {L}^{-1}\left (\frac {\left (\int \frac {f \left (x \right )}{\sqrt {{\mathrm e}^{x}}\, \sqrt {{\mathrm e}^{\sqrt {4 s +1}\, x}}}d x \right ) \sqrt {{\mathrm e}^{\sqrt {4 s +1}\, x}}}{\sqrt {4 s +1}}, s , t\right )+\mathcal {L}^{-1}\left (\frac {\int _{}^{0}\frac {f \left (\textit {\_a} \right )}{\sqrt {{\mathrm e}^{\textit {\_a}}}\, \sqrt {{\mathrm e}^{\sqrt {4 s +1}\, \textit {\_a}}}}d \textit {\_a}}{\sqrt {4 s +1}\, \sqrt {{\mathrm e}^{\sqrt {4 s +1}\, x}}}, s , t\right )-\mathcal {L}^{-1}\left (\frac {\int _{}^{0}\frac {\sqrt {{\mathrm e}^{\sqrt {4 s +1}\, \textit {\_a}}}\, f \left (\textit {\_a} \right )}{\sqrt {{\mathrm e}^{\textit {\_a}}}}d \textit {\_a}}{\sqrt {4 s +1}\, \sqrt {{\mathrm e}^{\sqrt {4 s +1}\, x}}}, s , t\right )\right ) {\mathrm e}^{\frac {x}{2}}\]

____________________________________________________________________________________

4.1.6.13 [247] Practice exam problem

problem number 247

Added May 23, 2019.

From Math 5587 midterm I, Fall 2016, practice exam, problem 13.

Solve for \(u(x,t)\) with IC \(u(x,0)=x^2+1\) and BC \(u_t(0,t)=1\) for \(x>0,t>0\) \begin {align*} u_{t} = u_{xx} \end {align*}

Mathematica

ClearAll["Global`*"]; 
pde = D[u[x, t], t] == D[u[x,t],{x,2}]; 
ic  = u[x,0]==x^2+1; 
bc  = u[0,t]==1; 
sol = AbsoluteTiming[TimeConstrained[DSolve[{pde,ic,bc}, u[x, t], {x, t}], 60*10]];
 

\[\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \frac {\text {Integrate}\left [\left (e^{-\frac {(x-K[1])^2}{4 t}}-e^{-\frac {(x+K[1])^2}{4 t}}\right ) \left (K[1]^2+1\right ),\{K[1],0,\infty \},\text {Assumptions}\to \text {True}\right ]+\sqrt {t} x \text {Integrate}\left [\frac {e^{-\frac {x^2}{4 (t-K[2])}}}{(t-K[2])^{3/2}},\{K[2],0,t\},\text {Assumptions}\to \text {True}\right ]}{2 \sqrt {\pi } \sqrt {t}} & x>0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}\]

Maple

restart; 
pde := diff(u(x,t),t)= diff(u(x,t),x$2); 
ic  := u(x,0)=x^2+1; 
bc :=u(0,t)=1; 
cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,ic,bc],u(x,t))),output='realtime'));
 

\[u \left (x , t\right ) = x^{2}+2 t -2 \mathcal {L}^{-1}\left (\frac {{\mathrm e}^{-\sqrt {s}\, x}}{s^{2}}, s , t\right )+1\]

____________________________________________________________________________________