Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Symbolic computation of gradient

  1. Jan 28, 2007 #1
    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?
     
  2. jcsd
  3. Jan 30, 2007 #2
    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: Jan 30, 2007
  4. Jan 30, 2007 #3
    Yes, that works very well. Thanks a lot.
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook