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 (

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


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.

  • $\begingroup$ Solve it without the Abs[ ]. If you get a monotonous increasing function you'll never need the Abs $\endgroup$ Oct 2, 2015 at 16:17
  • $\begingroup$ @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$ $\endgroup$ Oct 2, 2015 at 16:18
  • $\begingroup$ Perhaps instead of of Abs[y[t]] you try Sqrt[y[t]^2]. $\endgroup$
    – chuy
    Oct 2, 2015 at 16:55
  • $\begingroup$ @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 $\endgroup$ Oct 2, 2015 at 17:08
  • $\begingroup$ Note that this ODE is separable and can be integrated in finite terms (at least if y is real). $\endgroup$
    – Michael E2
    Oct 3, 2015 at 12:58

2 Answers 2


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]

Mathematica graphics

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]

Mathematica graphics

  • $\begingroup$ 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. $\endgroup$
    – bbgodfrey
    Oct 3, 2015 at 18:40
  • $\begingroup$ @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? $\endgroup$
    – Michael E2
    Oct 3, 2015 at 23:44
  • $\begingroup$ 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. $\endgroup$
    – bbgodfrey
    Oct 3, 2015 at 23:50
  • $\begingroup$ @bbgodfrey You comment is fine (nice, clear and succinct, too.) I just wanted to make sure I understood you. Thanks. $\endgroup$
    – Michael E2
    Oct 3, 2015 at 23:51

Mathematica answer :

Method 1:

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

enter image description here

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

Maple 2015.1 answer :

enter image description here

Answer is:

$$y(t)=\sqrt{2 t+1}-1$$

  • $\begingroup$ 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 $\endgroup$ Oct 2, 2015 at 16:49
  • $\begingroup$ I can read it now, but the solutions aren't totally correct. And could you tell why it gives these result, and why my version doesn't give them? $\endgroup$ Oct 2, 2015 at 17:31
  • $\begingroup$ Update your Student Edition to 10.2 and See what happens.Maybe it's a stripped down version.I do not have Student Edition. The results are the result of developers because so programmed.''English translator :P'' $\endgroup$ Oct 2, 2015 at 17:54
  • $\begingroup$ 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$... $\endgroup$
    – user58955
    Oct 2, 2015 at 17:58
  • $\begingroup$ @user58955 well but it could warn you that the result may only be global, it even fails to check it correctly (which is easy because calculating derivatives is easy) $\endgroup$ Oct 2, 2015 at 18:23

Your Answer

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

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