Mathematically we can say the following
$$ \frac{d}{d\vec{x}}\frac{1}{|\vec{x}|} = -\frac{\vec{x}}{|\vec{x}|^3}.$$
However, in Mathematica, I perform the following D[Abs[x]^(-1), x] which outputs -Abs'[x]/Abs[x]^2.
Any suggestions?
Mathematically we can say the following
$$ \frac{d}{d\vec{x}}\frac{1}{|\vec{x}|} = -\frac{\vec{x}}{|\vec{x}|^3}.$$
However, in Mathematica, I perform the following D[Abs[x]^(-1), x] which outputs -Abs'[x]/Abs[x]^2.
Any suggestions?
Quiet[xx = Table[x[[i]], {i, 1, 3}]];
D[1/Sqrt[Dot[xx, xx]], {xx, 1}]
Remark: The length of a vector in Mathematica is obtained by Norm[x]. Abs operates on each entry, thus Abs[x] is the vector of moduli.