# Incorrect result by DSolve

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


and

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.

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