0

I'm trying to figure out how to get the gradient in spherical coordinates. I'm as far as the author writes in this answer: https://physics.stackexchange.com/a/78514 and I understand how and why to get to this point.

I will just look at the x-component now: $\frac{\partial r}{\partial x}\frac{\partial}{\partial r}+\frac{\partial \theta}{\partial x}\frac{\partial}{\partial\theta}+\frac{\partial \varphi}{\partial x}\frac{\partial}{\partial \varphi}$

So firstly I have to derive $r$ for $x$, but which formula for $r$ should I derive? Simply $r=\sqrt{x^2+y^2+z^2}$?

I don't see how to get to the right result ($1$. For the y and z components: $\frac{1}{r}$ and $\frac{1}{r \sin \theta}$) this way, looking at how $\theta$ and $\varphi$ are defined.

I'm getting more and more confused thinking about what to do next. Googling hast confused me just more, as it seems to be obvious for everyone (except me) how to do this.

MarocJ
  • 53

1 Answers1

1

Yes. $$r = \sqrt{x^2 + y^2 + z^2} \implies \frac{\partial r}{\partial x} = \frac{2x}{2\sqrt{x^2 + y^2 +z^2}} \implies \frac{\partial r}{\partial x} = \cos \theta \cos \phi $$ In the same way you get: $$\frac{\partial r}{\partial y} = \cos \theta \sin \phi \quad\text{and}\quad \frac{\partial r}{\partial z} = \sin \theta $$ You do the same for the other ones: express $\theta = \theta(x,y,z)$ and $\phi = \phi(x,y,z)$ and differentiate. I'll express it for you:

$$\theta = \arctan\left(\frac{z}{\sqrt{x^2+y^2}}\right) \qquad \phi = \arctan\left (\frac{y}{x}\right) $$ If $r,\theta,\phi$ aren't expressed only in terms of $x,y,z$, there will be some chain rules that'll only make our lives harder. We should try to reduce the number of variables as much as possible before differentiating. Can you go on?

Ivo Terek
  • 80,301
  • Thanks for your answer. How do you get from $\frac{x}{\sqrt{x^2 + y^2 +z^2}}$ to $\frac{\partial r}{\partial x} = \cos \theta \cos \phi$? Just replace $x = r\sin\theta\cos\phi$,$y=r\sin\theta\sin\phi$ and $z=r\cos\theta$ and then fiddling around with the trigonometric functions until I've got $\cos\theta\cos\phi$ left? – MarocJ Apr 18 '15 at 16:14
  • Well, $\sqrt{x^2 + y^2 + z^2}$ in the denominator IS $r$, right off the bat. Then substitute the expression for $x = x(r,\theta, \phi)$ and simplify the $r$. I just skipped that one step there. – Ivo Terek Apr 18 '15 at 16:17
  • I just noticed that too when I re-read my own comment. But isn't $x=r\sin\theta\cos\phi$ so $\frac{\partial r}{\partial x}\sin\theta\cos\phi$? – MarocJ Apr 18 '15 at 16:21
  • I used the definition that was on the question that you linked. There's not a standard convention on which angle you call $\theta $ or $\phi $. – Ivo Terek Apr 18 '15 at 16:22
  • $$x=r\cos\theta\cos\phi$$ $$y=r\cos\theta\sin\phi$$ $$z=r\sin\theta$$ – Ivo Terek Apr 18 '15 at 16:23
  • Oh, sorry! I'm using a different formula here, so I just got a bit confused. But when going on with $\theta$ or $\phi$ I get some pretty nasty derivations. Is this what you meant when you spoke of reducing the number of variables? – MarocJ Apr 18 '15 at 16:37
  • Yes. Express everything in terms of $x,y,z$. Differentiate. THEN plug back the expressions in terms of $r,\theta,\phi $. – Ivo Terek Apr 18 '15 at 16:39