This is using V12 on windows 10.

I was trying to verify my hand solution with Mathematica. DSolve gives two solutions instead of one, which I do not understand how it came up with. I also was not able to verify one of the two solutions it gives.

Here is the pde specification. Solve for $w(x,t)$

$$ \frac{\partial w}{\partial t}+3 t \frac{\partial w}{\partial x}=w(x,t) \tag{1} $$

with initial conditions $w(x,0)=f(x)$.

Here is the code (Using w in the DSolve instead of standard w[x,t] in order to get the solution using Function so to make it easier to verify)

pde = D[w[x, t], t] + 3*t*D[w[x, t], x] == w[x, t];
ic = w[x, 0] == f[x];
sol = DSolve[{pde, ic}, w, {x, t}] (*Assumptions -> t > 0 has no effect*)


Mathematica graphics

It is the first solution above which I have doubts it is correct. Notice that adding Assumptions -> t > 0 to DSolve has not effect. Same solutions are obtained.

Now, the second solution verifies OK, but not the first

 Assuming[t > 0, Simplify[pde /. sol[[1, 1]]]]

Mathematica graphics

 Assuming[t > 0, Simplify[pde /. sol[[2, 1]]]]

Mathematica graphics

Question is : Is the first solution above correct? If so, why it does not verify, and how did Mathematica obtain it? Is this a bug?

Below is hand solution.


my hand solution I was trying to verify using Mathematica:

Let $w\equiv w\left( x\left( t\right) ,t\right) $ then \begin{equation} \frac{dw}{dt}=\frac{\partial w}{\partial x}\frac{dx}{dt}+\frac{\partial w}{\partial t}\tag{2} \end{equation}

Comparing (1,2) shows that

\begin{align} \frac{dw}{dt} & =w\tag{3}\\ \frac{dx}{dt} & =3t\tag{4} \end{align}

Solving (3) gives

\begin{equation} w=Ce^{t}\nonumber \end{equation}

From initial conditions at $t=0$, the above becomes $f\left( x\left( 0\right) \right) =C$. Hence the above becomes

\begin{equation} w\left( x,t\right) =f\left( x\left( 0\right) \right) e^{t}\tag{5} \end{equation}

From (4)

\begin{align*} x & =\frac{3}{2}t^{2}+x\left( 0\right) \\ x\left( 0\right) & =x-\frac{3}{2}t^{2} \end{align*}

Substituting the above in (5) gives

$$ w\left( x\left( t\right) ,t\right) =f\left( x-\frac{3}{2}t^{2}\right) e^{t} $$

  • 1
    $\begingroup$ Maple 2019.1 produces $w \left( x,t \right) =f \left( -3/2\,{t}^{2}+x \right) {{\rm e}^{t}} $. $\endgroup$ – user64494 Oct 5 at 7:57
  • 3
    $\begingroup$ Related: mathematica.stackexchange.com/q/130857/1871 $\endgroup$ – xzczd Oct 5 at 8:18
  • $\begingroup$ As a workaround you can add your own VerifySolutions with the assumption t > 0: sol = Select[DSolve[{pde, ic}, w, {x, t}], Simplify[pde && ic /. #, t > 0] &] $\endgroup$ – Bob Hanlon Oct 5 at 16:40
  • 1
    $\begingroup$ Actually, both solutions are correct, the first for t < 0 and the second for t > 0. As @xzczd commented earlier, this same problem occurred in 130857. I reported the bug over two years ago, and Wolfram, Inc. still has not fixed it. $\endgroup$ – bbgodfrey Oct 5 at 23:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.