# Why Mathematica gives this second solution to this first order linear PDE $w_t+3 t w_x=w$?

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)

ClearAll["Global*"];
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*)


Gives

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


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


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.

## Appendix

my hand solution I was trying to verify using Mathematica:

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

Comparing (1,2) shows that

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

Solving (3) gives

$$$$w=Ce^{t}\nonumber$$$$

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

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

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}$$

• Maple 2019.1 produces $w \left( x,t \right) =f \left( -3/2\,{t}^{2}+x \right) {{\rm e}^{t}}$. – user64494 Oct 5 '19 at 7:57
• – xzczd Oct 5 '19 at 8:18
• 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] &] – Bob Hanlon Oct 5 '19 at 16:40
• 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. – bbgodfrey Oct 5 '19 at 23:21