3.1.6 Semi-infinite domain

3.1.6.1 [235] left end constant (general case)
3.1.6.2 [236] left end constant (special case)
3.1.6.3 [237] Logan p. 76. Left end general function of time (general case)
3.1.6.4 [238] Left end function of time (special case)
3.1.6.5 [239] nonhomogeneous BC
3.1.6.6 [240] I.C. not zero
3.1.6.7 [241] nonhomogeneous BC
3.1.6.8 [242] nonhomogeneous BC
3.1.6.9 [243] nonhomogeneous B.C.
3.1.6.10 [244] Unit triangle I.C.
3.1.6.11 [245] I.C. not at \(t=0\)
3.1.6.12 [246] Diffusion with advection
3.1.6.13 [247] Practice exam problem

3.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 {x \text {Integrate}\left [\frac {A e^{-\frac {x^2}{4 k t-4 k K[2]}}}{(t-K[2])^{3/2}},\{K[2],0,t\},\text {Assumptions}\to k>0\land t>0\land x>0\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)=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 ) =-\erf \left ( 1/2\,{\frac {x}{\sqrt {k}\sqrt {t}}} \right ) A+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*}

____________________________________________________________________________________

3.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]];
 

\[\left \{\left \{u(x,t)\to \begin {array}{cc} \{ & \begin {array}{cc} \sqrt {\frac {5}{2 \pi }} x \text {Integrate}\left [\frac {60 e^{-\frac {5 x^2}{2 (t-K[2])}}}{(t-K[2])^{3/2}},\{K[2],0,t\},\text {Assumptions}\to t>0\land x>0\right ] & x>0 \\ \text {Indeterminate} & \text {True} \\\end {array} \\\end {array}\right \}\right \}\] 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 ( 1/2\,{\frac {\sqrt {10}x}{\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 3.1.6.1 on page 783 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

____________________________________________________________________________________

3.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 \int _0^t \frac {f(z) e^{-\frac {x^2}{4 k t-4 k z}}}{(t-z)^{3/2}} \, dz}{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 ) =1/2\,{\frac {x}{\sqrt {\pi }\sqrt {k}}\int _{0}^{t}\!{\frac {f \left ( \zeta \right ) }{ \left ( t-\zeta \right ) ^{3/2}}{{\rm e}^{1/4\,{\frac {{x}^{2}}{k \left ( -t+\zeta \right ) }}}}}\,{\rm d}\zeta }\]

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 \]

____________________________________________________________________________________

3.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 \frac {1}{4} i e^{-i \left (t+(1-i) \sqrt {5} x\right )} \left (-e^{2 i t} \text {Erf}\left (\frac {2 \sqrt [4]{-1} t-\sqrt {10} x}{2 \sqrt {t}}\right )+e^{2 \sqrt {5} x} \text {Erf}\left (\frac {2 (-1)^{3/4} t-\sqrt {10} x}{2 \sqrt {t}}\right )+e^{2 i t+(2+2 i) \sqrt {5} x} \text {Erf}\left (\frac {2 \sqrt [4]{-1} t+\sqrt {10} x}{2 \sqrt {t}}\right )-e^{2 i \sqrt {5} x} \text {Erf}\left (\frac {2 (-1)^{3/4} t+\sqrt {10} x}{2 \sqrt {t}}\right )-e^{2 i t+(2+2 i) \sqrt {5} x}-e^{2 i t}+e^{2 i \sqrt {5} x}+e^{2 \sqrt {5} x}\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 ) =-1/2\,{\frac {\sqrt {10}x}{\sqrt {\pi }}\int _{0}^{t}\!-{\frac {\sin \left ( t-\zeta \right ) }{{\zeta }^{3/2}}{{\rm e}^{-5/2\,{\frac {{x}^{2}}{\zeta }}}}}\,{\rm d}\zeta }\]

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 3.1.6.3 on page 795 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

____________________________________________________________________________________

3.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 \text {Integrate}\left [\frac {e^{-\frac {x^2}{4 k t-4 k K[2]}}}{(t-K[2])^{3/2}},\{K[2],0,t\},\text {Assumptions}\to k>0\land t>0\land x>0\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)=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 ) =1-\erf \left ( 1/2\,{\frac {x}{\sqrt {k}\sqrt {t}}} \right ) \]

____________________________________________________________________________________

3.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]];
 

Failed 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+{\it x0}}{\sqrt {t-{\it t0}}}} \right ) \]

____________________________________________________________________________________

3.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 \frac {x \text {Integrate}\left [\frac {\lambda e^{-\frac {x^2}{4 k t-4 k K[2]}}}{(t-K[2])^{3/2}},\{K[2],0,t\},\text {Assumptions}\to k>0\land t>0\land x>0\right ]}{2 \sqrt {\pi } \sqrt {k}}+\mu \text {Erf}\left (\frac {x}{2 \sqrt {k t}}\right )\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 ) = \left ( -\lambda +\mu \right ) \erf \left ( 1/2\,{\frac {x}{\sqrt {k}\sqrt {t}}} \right ) +\lambda \]

____________________________________________________________________________________

3.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 {1}{2} \left (i e^{-t-i x} \left (e^{2 i x} \text {Erfi}\left (\frac {2 t-i x}{2 \sqrt {t}}\right )-\text {Erfi}\left (\frac {2 t+i x}{2 \sqrt {t}}\right )\right )+\frac {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 t>0\land x>0\right ]}{\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)=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 ) =1/2\,{{\rm e}^{-t+ix}}\erf \left ( 1/2\,{\frac {2\,it+x}{\sqrt {t}}} \right ) -\erf \left ( 1/2\,{\frac {x}{\sqrt {t}}} \right ) -1/2\,{{\rm e}^{-t-ix}}\erf \left ( 1/2\,{\frac {2\,it-x}{\sqrt {t}}} \right ) +1\]

____________________________________________________________________________________

3.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 ) \text {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 {1}{k\,\sqrt {\pi }} \left ( {{\rm e}^{-1/4\,{\frac {{x}^{2}}{k\,t}}}}\sqrt {k}\sqrt {t}x+ \left ( \erf \left ( 1/2\,{\frac {x}{\sqrt {k}\sqrt {t}}} \right ) -1 \right ) \left ( k\,t+1/2\,{x}^{2} \right ) \sqrt {\pi } \right ) }\]

____________________________________________________________________________________

3.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 {\left | x-4\right | }{2 \sqrt {t}}\right ) (x-4)^2}{\left | 4-x\right | }+(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 {\left | x-3\right | }{2 \sqrt {t}}\right )}{\left | 3-x\right | }+\frac {(x-2)^2 \text {Erf}\left (\frac {\left | x-2\right | }{2 \sqrt {t}}\right )}{\left | 2-x\right | }+\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 {1}{\sqrt {t}\sqrt {\pi }} \left ( t{{\rm e}^{-1/4\,{\frac { \left ( -4+x \right ) ^{2}}{t}}}}-2\,t{{\rm e}^{-1/4\,{\frac { \left ( -3+x \right ) ^{2}}{t}}}}+t{{\rm e}^{-1/4\,{\frac { \left ( 2+x \right ) ^{2}}{t}}}}+t{{\rm e}^{-1/4\,{\frac { \left ( x-2 \right ) ^{2}}{t}}}}-2\,t{{\rm e}^{-1/4\,{\frac { \left ( x+3 \right ) ^{2}}{t}}}}+t{{\rm e}^{-1/4\,{\frac { \left ( x+4 \right ) ^{2}}{t}}}}+1/2\, \left ( \left ( -4+x \right ) \erf \left ( 1/2\,{\frac {-4+x}{\sqrt {t}}} \right ) + \left ( -2\,x+6 \right ) \erf \left ( 1/2\,{\frac {-3+x}{\sqrt {t}}} \right ) + \left ( 2+x \right ) \erf \left ( 1/2\,{\frac {2+x}{\sqrt {t}}} \right ) +\erf \left ( 1/2\,{\frac {x-2}{\sqrt {t}}} \right ) \left ( x-2 \right ) + \left ( -2\,x-6 \right ) \erf \left ( 1/2\,{\frac {x+3}{\sqrt {t}}} \right ) +\erf \left ( 1/2\,{\frac {x+4}{\sqrt {t}}} \right ) \left ( x+4 \right ) \right ) \sqrt {t}\sqrt {\pi } \right ) }\]

____________________________________________________________________________________

3.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]];
 

Failed

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 ) =-5\,{\frac {1}{\sqrt {t-{\it t0}+1}}{{\rm e}^{{\frac {{x}^{2}}{-t+{\it t0}-1}}}} \left ( -\erf \left ( {\frac { \left ( -t+{\it t0}-1 \right ) {\it x0}+x}{\sqrt {t-{\it t0}}\sqrt {t-{\it t0}+1}}} \right ) -1+ \left ( \erf \left ( {\frac {-{\it x0}\,{\it t0}+ \left ( t-1 \right ) {\it x0}+x}{\sqrt {t-{\it t0}}\sqrt {t-{\it t0}+1}}} \right ) -1 \right ) {{\rm e}^{4\,{\frac {{\it x0}\, \left ( -x+{\it x0} \right ) }{-t+{\it t0}-1}}}} \right ) }\]

____________________________________________________________________________________

3.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]];
 

Failed

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 ) ={{\rm e}^{x/2}} \left ( {\it invlaplace} \left ( {\frac {1}{\sqrt {{{\rm e}^{x\sqrt {1+4\,s}}}}\sqrt {1+4\,s}}\int ^{0}\!{\frac {f \left ( {\it \_a} \right ) }{\sqrt {{{\rm e}^{{\it \_a}}}}\sqrt {{{\rm e}^{{\it \_a}\,\sqrt {1+4\,s}}}}}}{d{\it \_a}}},s,t \right ) -{\it invlaplace} \left ( {\frac {1}{\sqrt {{{\rm e}^{x\sqrt {1+4\,s}}}}\sqrt {1+4\,s}}\int ^{0}\!{\frac {f \left ( {\it \_a} \right ) \sqrt {{{\rm e}^{{\it \_a}\,\sqrt {1+4\,s}}}}}{\sqrt {{{\rm e}^{{\it \_a}}}}}}{d{\it \_a}}},s,t \right ) -{\it invlaplace} \left ( {\frac {\sqrt {{{\rm e}^{x\sqrt {1+4\,s}}}}}{\sqrt {1+4\,s}}\int \!{\frac {f \left ( x \right ) {{\rm e}^{-x/2}}}{\sqrt {{{\rm e}^{x\sqrt {1+4\,s}}}}}}\,{\rm d}x},s,t \right ) +{\it invlaplace} \left ( {\frac {\int \!f \left ( x \right ) {{\rm e}^{-x/2}}\sqrt {{{\rm e}^{x\sqrt {1+4\,s}}}}\,{\rm d}x}{\sqrt {{{\rm e}^{x\sqrt {1+4\,s}}}}\sqrt {1+4\,s}}},s,t \right ) \right ) \]

____________________________________________________________________________________

3.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 [\frac {e^{-\frac {x^2}{4 (t-K[2])}}}{(t-K[2])^{3/2}},\{K[2],0,t\},\text {Assumptions}\to t>0\land x>0\right ] x}{2 \sqrt {\pi }}+\frac {2 e^{-\frac {x^2}{4 t}} \sqrt {t} x}{\sqrt {\pi }}+\left (x^2+2 t+1\right ) \text {Erf}\left (\frac {x}{2 \sqrt {t}}\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)=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 ) =-2\,{\it invlaplace} \left ( {\frac {{{\rm e}^{-\sqrt {s}x}}}{{s}^{2}}},s,t \right ) +{x}^{2}+2\,t+1\]

____________________________________________________________________________________