# DSolve gives an empty solution set to a solvable ODE

I really hope this isn't a duplicate, today I was answering this question and was to lazy to solve the quadratic equation on my own and so just asked mathematica to give me the solution of the differential equation, but with the student version of mathematica (9.0.1.0)

DSolve[{y'[t] == 1/(1 + Abs[y[t]]) , y[4] == 2}, y[t], t]

and

DSolve[y'[t] == 1/(1 + Abs[y[t]]) && y[4] == 2, y[t], t]

say that there is no solution to this differential equation (the out is {}), but with Peano (indeed global Picard-Lindelöf is fulfilled) there must be a solution, which indeed can be calculated. Someone in the chat told me that in Mathematica Version 10.1 a solution to this ode is given.

• Solve it without the Abs[ ]. If you get a monotonous increasing function you'll never need the Abs Oct 2, 2015 at 16:17
• @belisarius the ode is autonomous so the solutions are always monotone, here it is monotone increasing but that doesn't help for $t\to -\infty$ Oct 2, 2015 at 16:18
• Perhaps instead of of Abs[y[t]] you try Sqrt[y[t]^2].
– chuy
Oct 2, 2015 at 16:55
• @chuy I tried it and now I am even more confused, it gives the same wrong answer as maple, and another one which does have a negative derivative which is totally impossible Oct 2, 2015 at 17:08
• Note that this ODE is separable and can be integrated in finite terms (at least if y is real). Oct 3, 2015 at 12:58

DSolve remaps variables such as y[t] to y (and derivatives get remapped to Module variables and are difficult to access since module numbers change with each invocation), so as long as that does not change, the following will work.

Assume y is real:

Assuming[y ∈ Reals,
{dsol} = DSolve[{y'[t] == 1/(1 + Abs[y[t]]), y[4] == 2}, y[t], t]
]


This is a solution and can be used. To get a more traditional presentation, we can process it further. First, rewrite the InverseFunction solution using the mathematical definition of the inverse function. Then solve for y[t].

{invsol} =
With[{eqn = y[t] == (y[t] /. dsol)},
Solve[eqn, Cases[eqn, _InverseFunction, Infinity]]
] /. HoldPattern[InverseFunction[f_][x_] -> y_] :> f[y] == x

sol = Solve[invsol, y[t], Reals]


• Because the right side of y'[t] == 1/(1 + Abs[y[t]]) is real, if follows that Im[y[t]] is constant, and the boundary condition, y[4] == 2 indicates that the constant is zero. Thus, y[t] must be real. Oct 3, 2015 at 18:40
• @bbgodfrey I realize that, but DSolve calls solvers & simplifiers without including that condition. Or are you adding a justification for why it is ok to include the assumption that y is real? Or perhaps some other point I'm unable to see just now? Or maybe someone deleted a comment you were responding to? Oct 3, 2015 at 23:44
• I was pointing out that your solution was true without "Assume y is real", although you must, nonetheless, tell DSolve that it is real for the reason in your last comment. If you feel that my comment added nothing, I am happy to delete it. Oct 3, 2015 at 23:50
• @bbgodfrey You comment is fine (nice, clear and succinct, too.) I just wanted to make sure I understood you. Thanks. Oct 3, 2015 at 23:51

Method 1:

sol = DSolve[{y'[t] == 1/(1 + Abs[y[t]]), y[4] == 2}, y[t], t]
FullSimplify[y[t] /. sol]


It has problems with the solution of this equation.Simplifying the equations it did not work with FullSimplify[].

Method 2:

sol2 = DSolve[{y'[t] == 1/(1 + Sqrt[y[t]^2]), y[4] == 2}, y[t], t]


$$\left\{\left\{y(t)\to \sqrt{9-2 t}+1\right\},\left\{y(t)\to \sqrt{2 t+1}-1\right\}\right\}$$

$$y(t)=\sqrt{2 t+1}-1$$
• I can't read what is in the box, the maple answer is only a local solution and is wrong for $x\in(-\infty,0)$. Indeed i am more interessted what makes this behaviour than the actual result of the ode Oct 2, 2015 at 16:49
• I have 10.2 and it gives the same answer. I guess it's hard for a software to come up with $y(t) = \sqrt{2t+1}-1$ for $t>0$ and $y(t) = 1-\sqrt{1-2t}$ for $t<0$... Oct 2, 2015 at 17:58