11
$\begingroup$

Bug introduced in 12.0 and fixed in 12.1.1


Reported to WRI CASE: 4278450


Comparing the following, all done from clean kernel

Mathematica graphics


Mathematica graphics

The strange thing is that V 12 can solve this same PDE without the assumptions

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  = DSolve[{pde, bc, ic}, u[x, t], {x, t}]

Mathematica graphics

But it says in the above answer that it wants x>0,t>0, which is why I gave it the assumptions to help it, but then it returns undefined.

Something seems to have gone wrong in V 12 DSolve here, or may be in the Integrate? I do not know.

Do others see the same result on V 12?. Answer given by V 11.3 is the correct one.

Any workaround for V 12 to make it give same answer as V 11.3?

Appendix

fyi, To verify that 11.3 solution is correct, I solved it by hand

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 $$ U\left( x,s\right) =c_{2}e^{-\sqrt{\frac{s}{k}}x}\tag{2} $$ 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$) $$ u\left( x,t\right) =A\operatorname{erfc}\left( \frac{x}{2\sqrt{kt}}\right) $$ With $A=60,k=\frac{1}{10}$ the above becomes

\begin{align*} u\left( x,t\right) & =60\operatorname{erfc}\left( \frac{x}{2\sqrt {\frac{1}{10}t}}\right) \\ & =60\operatorname{erfc}\left( \frac{\sqrt{\frac{5}{2}}x}{\sqrt{t}}\right) \end{align*}

$\endgroup$
1
  • 2
    $\begingroup$ Yes, I have the same answer on version 12. $\endgroup$ Jul 9, 2019 at 17:31

1 Answer 1

6
$\begingroup$

Thanks to WRI engineers this is now fixed in 12.1.1

Clear["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  = DSolve[{pde, bc, ic}, u[x, t], {x, t}, Assumptions->{x>0,t>0}]

enter image description here

$\endgroup$
2
  • 1
    $\begingroup$ What, 12.1.1 is released? But the Wolfram Cloud is still "12.1.0 for Linux x86 (64-bit) (March 4, 2020)", strange… $\endgroup$
    – xzczd
    Jun 18, 2020 at 4:56
  • $\begingroup$ @xzczd It is available now from your WRI portal. For windows, Linux and Mac. $\endgroup$
    – Nasser
    Jun 18, 2020 at 4:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.