Mathematica does not have a rule for the derivative of Abs
. Assuming that the term arose from taking the derivative with respect to a
then taking the derivative of Abs[1-a]
results in
D[Abs[1 - a], a]
-Derivative[1][Abs][1 - a]
which would recurse forever if it evaluated. Note
Plot[{Abs[1 - a], -Sign[1 - a]}, {a, -5, 5},
PlotLegends -> "Expressions"]
Graphically, the derivative is -Sign[1 - a]
except when a == 1
If dealing with real functions, before taking the derivative of a function containing Abs
the function should have the terms with Abs
converted to the Sqrt
of the square of the argument to Abs
.
Simplify[D[Sqrt[(1 - a)^2], a], Element[a, Reals]]
Piecewise[{{-1, a < 1}}, 1]
Simplify[% == -Sign[1 - a], a != 1]
True
FullSimplify[Rationalize[Abs'[1. - a]], a \[Element] Reals]
? $\endgroup$FullSimplify[D[Abs[c - a], a], Assumptions -> {a \[Element] Reals, c \[Element] Reals}] /. c -> 1.
$\endgroup$