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 toz*Conjugate[z]
$\endgroup$ – cvgmt Nov 23 '20 at 9:47Sqrt
is also a complex function. $\endgroup$ – cvgmt Nov 23 '20 at 9:48Solve
more so thanDSolve
:Solve[Abs[y'[x]] == -Abs[x] /. y'[x] -> yp, yp]
. $\endgroup$ – Michael E2 Nov 23 '20 at 19:07