Symbolic computation of gradient

  • Context: Graduate 
  • Thread starter Thread starter v0id
  • Start date Start date
  • Tags Tags
    Computation Gradient
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 3K views
v0id
Messages
42
Reaction score
0
I'm wondering if there are any convenient symbolic "shortcuts" (i.e. abuse of notation) that enable one to compute the gradient with respect to a certain vector, without decomposing the computation into the vector's individual elements and differentiating with respect to each element. For example:
[tex] \nabla_x \left( \frac{1}{|{\bf x}^{'} - {\bf x}|} \right) = \frac{{\bf x}^{'} - {\bf x}}{|{\bf x}^{'} - {\bf x}|^3}[/tex]
Besides the obvious method of evaluating [tex]\frac{\partial}{\partial x_1}[/tex] and so on, is there a faster method of symbolic computation?
 
Physics news on Phys.org
If you consider
[tex]\sqrt{x^Tx}=|x|[/tex]
then symbolic ideas help to get to the final expression:

[tex]\nabla_x \left( (x'-x)^{T}(x'-x) \right)^{-1/2} = \left( (x'-x)^{T}(x'-x) \right)^{-3/2} (x'-x)[/tex]
 
Last edited:
Yes, that works very well. Thanks a lot.