For real $x$ consider the trivial equation $$|y'(x)|=-|x|.$$ Since the left side is always positive and the right always negative, there is no solution. Let's try

DSolve[Abs[y'[x]]==-Abs[x], y, x, Assumptions-> {x ∈ Reals}],

DSolve[Abs[y'[x]]==-RealAbs[x], y, x, Assumptions-> {x ∈ Reals}] 


DSolve[Sqrt[y'[x]^2]==-Abs[x], y, x, Assumptions-> {x ∈ Reals}] 

all giving the wrong result

{{y->Function[{x},Sign[x]/2 x^2+Subscript[\[ConstantC], 1]]},{y->Function[{x},-Sign[x]/2 x^2+Subscript[\[ConstantC], 1]]}} 

At least

DSolve[RealAbs[y'[x]]==-RealAbs[x], y, x, Assumptions-> {x ∈ Reals}] 

does return {}.

Is this a bug or a feature?

Note that this is just one example. In any case when the equation is $f(y'(x))=...$ and $f$ contains square root or absolute value the results are wrong.

Edit: Originally, the equation $|y'(x)|=-e^x$ was used for the example, but as a user found out, in that particluar case there is a complex solution.

  • 3
    $\begingroup$ Abs is a complex function which relate to z*Conjugate[z] $\endgroup$ – cvgmt Nov 23 '20 at 9:47
  • 2
    $\begingroup$ Sqrt is also a complex function. $\endgroup$ – cvgmt Nov 23 '20 at 9:48
  • 1
    $\begingroup$ As the results are wrong on every domain its not a problem of 'complex' calculation. $\endgroup$ – fwgb Nov 23 '20 at 14:02
  • 4
    $\begingroup$ @fwgb Please, consider submitting a bug report to WRI. (Or here.) $\endgroup$ – Anton Antonov Nov 23 '20 at 14:48
  • 2
    $\begingroup$ Yes, quite. The source of the problem is with Solve more so than DSolve: Solve[Abs[y'[x]] == -Abs[x] /. y'[x] -> yp, yp]. $\endgroup$ – Michael E2 Nov 23 '20 at 19:07

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.