I’m new to Mathematica. Why does it return solutions that appear to be duplicative? For example,
There’s a factor of (-1)^{k/3} for k=0,1,2 in the exponents. Mathematica is finding complex solutions to the ODE as well as real ones. I typed
FullSimplify[DSolve[{D[u[x,t],t]+t^2 D[u[x,t],x]==u[x,t],u[x,0]==Exp[2x]},u,{x,t}]]
TeXForm[u[x,t]/.%]
to obtain the \TeX code which produces
Maybe this is nicer to parse visually. It’s also not simplifying \sqrt[3]{t^3} because \sqrt[3]\cdot is a multivalued function. There are ways to specify that x,t and u should be real, but I’m struggling to do that with the methods I know.
It would seem that the first solution is genuine, while the others are wrong, at least for t>0:
eqs = {D[u[x, t], t] + t^2 D[u[x, t], x] == u[x, t],
u[x, 0] == Exp[2 x]};
sol = DSolve[eqs, u, {x, t}];
Simplify[eqs /. sol, t > 0]
{{True, True}, {False, True}, {False, True}}
For t<0 it is the third solution that is correct. The second solution seems correct when t is imaginary and negative:
Simplify[eqs /. sol /. t -> I*t, t < 0]
Thanks, Gianluca Gorni and Adam Mendenhall. I get the same three solutions, which are identical in real numbers, even if I specify a real domain. What am I doing wrong?
Add notebook doesn’t seem to be working for me right now. I attached the .nb.
scratchwork.nb (5.09 KB)
The three solutions are not identical. Try this:
N[u[0, 1] /. sol]
You are doing nothing wrong. It is Mathematica that is messing up things by representing t as (-t^3)^(1/3), an expression that has three possible values, each agreeing with t in a different subdomain. You get a single correct expression of the solution with
PowerExpand[sol[[1]]]
Is there a way to limit results to real values? I’ve tried Assumptions and Assuming without the desired outcome.
I don’t know. My guess is that the internal algorithm goes through solving a cubic equation, and it leaves to the user to sort out which branches to choose.