I need to calculate derivatives of absolute value as follows
$$
\frac{d}{dr_1}\lvert r_1-r_2\rvert
$$
somewhere in my calculations. When I simply use D[Abs[r1-r2],r1]
it returns Abs'[r1-r2]
! and I don't know how to deal with it. Doesn't Mathematica yield an explicit answer in this case?!
$\begingroup$
$\endgroup$
3
D[RealAbs[r1 - r2], r1]
so instead ofD[Abs[x],x]
useD[RealAbs[x], x]
$\endgroup$Abs'[r1 - r2]
isDerivative[1][Abs][r1 - r2]
; you can in fact give definitions likeDerivative[1][Abs]=Sign
if you like, asDerivative
is not protected. $\endgroup$