0

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?

Rumplestillskin
  • 359
  • 1
  • 10

1 Answers1

1
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.

Henrik Schumacher
  • 106,770
  • 7
  • 179
  • 309