0
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ what you mean deriving scalar by vector? The closest assumption i can think about is d F[x]/d x = Grad[F, x], x={x1,x2,...,xn} $\endgroup$ – k_v Jul 7 '17 at 9:33
  • 1
    $\begingroup$ It's one of the examples of the help page for Grad. $\endgroup$ – b.gates.you.know.what Jul 7 '17 at 10:16
1
$\begingroup$
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.

$\endgroup$
  • $\begingroup$ I thought so however, when I use Norm I get results using Conjugates. Any suggestions for that? $\endgroup$ – Rumplestillskin Jul 7 '17 at 10:09
  • 1
    $\begingroup$ Yes, see above. $\endgroup$ – Henrik Schumacher Jul 7 '17 at 12:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.