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

Differentiation spherical coordinates

  1. Aug 23, 2013 #1
    Hi ! I'm trying to inverse a mass matrix so I need to do something like this

    [itex] \dfrac{q}{\partial \mathbf{r}} [/itex] where [itex] \cos q = \dfrac{\mathbf{r}\cdot \hat{\mathbf{k}}}{r} [/itex]

    However, when [itex] \mathbf{r} = \hat{\mathbf{k}} \text{ or } -\hat{\mathbf{k}} [/itex] I have problems.

    ¿What can I do?

    Thanks !
  2. jcsd
  3. Aug 23, 2013 #2


    Staff: Mentor

    What does ##\dfrac{q}{\partial \mathbf{r}} ## mean?
    Did you mean to write this?
    ##\dfrac{\partial q}{\partial \mathbf{r}}##
    Isn't k##\cdot##k = 1, and similarly, isn't -k##\cdot##k = -1? What problems are you having?
  4. Aug 23, 2013 #3
    Yes, I mean [itex] \dfrac{\partial q}{\partial \mathbf{r}} [/itex] As you know if you do [itex] \dfrac{\partial}{\partial \mathbf{r}} [/itex] both sides you get [itex] \dfrac{\partial q}{\partial \mathbf{r}} -\sin q = \dfrac{\hat{\mathbf{k}}}{L} [/itex]. Solving for [itex] \dfrac{\partial q}{\partial \mathbf{r}} [/itex] you get [itex] \dfrac{\partial q}{\partial \mathbf{r}} = -\dfrac{\hat{\mathbf{k}}}{L\sin q} [/itex] So, when [itex] q=0 [/itex] I'm having troubles.
  5. Aug 27, 2013 #4


    User Avatar
    Science Advisor
    Gold Member
    2017 Award

    You have to transform the gradient to spherical coordinates first. This you get with
    [tex]\mathrm{d} f=\mathrm{d} \vec{r} \cdot \vec{\nabla} f = (\mathrm{d} r \vec{e}_r \cdot +\mathrm{d} \vartheta r \vec{e}_{\vartheta} + \mathrm{d} \varphi r \sin \vartheta \vec{e}_{\varphi}) \cdot \nabla{f}.[/tex]
    Since [itex]\vec{e}_{r}[/itex], [itex]\vec{e}_{\vartheta}[/itex], and [itex]\vec{e}_{\varphi}[/itex] build a complete orthonormal system you immediately read off
    [tex]\vec{\nabla} \cdot \vec{r}=\vec{e}_r \frac{\partial f}{\partial r} + \vec{e}_{\vartheta} \frac{1}{r} \frac{\partial f}{\partial \vartheta} + \vec{e}_{\varphi} \frac{1}{r \sin \vartheta} \frac{\partial f}{\partial \vartheta}.[/tex]
    For [itex]f=\vartheta[/itex] you thus get
    [tex]\vec{\nabla} \vartheta=\frac{1}{r} \vec{e}_{\vartheta}.[/tex]
    You can of course do the whole thing in Cartesian coordinates:
    [tex]f=\arccos \left (\frac{\vec{k} \cdot \vec{r}}{r} \right ).[/tex]
    Using the chain rule gives
    [tex]\vec{\nabla} f=-\frac{1}{\sin \vartheta} \vec{\nabla} \left (\frac{\vec{k} \cdot \vec{r}}{r} \right )=-\frac{1}{\sin \vartheta} \left (\frac{\vec{k}}{r}-\frac{(\vec{r} \cdot \vec{k}) \vec{r}}{r^3} \right ).[/tex]
    Now we can simplify
    [tex]\frac{\vec{k}}{r}-\frac{(\vec{r} \cdot \vec{k}) \vec{r}}{r^3}
    =\frac{1}{r} \left (\vec{k} - \frac{(\vec{r} \cdot \vec{k})
    \vec{r}}{r^2} \right )=-\frac{\sin \vartheta}{r} \begin{pmatrix}
    \cos \varphi \cos \vartheta \\ \sin \varphi \cos \vartheta \\ -\sin \vartheta
    \end{pmatrix}=-\frac{\vec{e}_{\vartheta} \sin \vartheta}{r}.[/tex]
    Plugging this into the equation above you again get
    [tex]\vec{\nabla} \vartheta=\frac{1}{r} \vec{e}_{\vartheta}.[/tex]
    As you see you always must use the correct expression of the covariant differential operators to get the right result!
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Differentiation spherical coordinates
  1. Spherical Coordinates (Replies: 0)

  2. Spherical Coordinates (Replies: 4)

  3. Spherical Coordinates (Replies: 1)

  4. Spherical coordinates? (Replies: 5)