# Metric tensor and gradient in spherical polar coordinates

1. Sep 23, 2016

### spaghetti3451

1. The problem statement, all variables and given/known data

Let $x$, $y$, and $z$ be the usual cartesian coordinates in $\mathbb{R}^{3}$ and let $u^{1} = r$, $u^{2} = \theta$ (colatitude), and $u^{3} = \phi$ be spherical coordinates.

1. Compute the metric tensor components for the spherical coordinates $g_{r\theta}:=g_{12}=\big\langle\frac{\partial}{\partial r}\ ,\ \frac{\partial}{\partial \theta}\big\rangle\ \text{etc.}$
2. Compute the coefficients $(\nabla\ f)^{j}$ in $\nabla\ f = (\nabla\ f)^{r}\frac{\partial}{\partial r}+(\nabla\ f)^{\theta}\frac{\partial}{\partial \theta}+(\nabla\ f)^{\phi}\frac{\partial}{\partial \phi}$.
3. Verify that $\frac{\partial}{\partial r}$, $\frac{\partial}{\partial\theta}$, and $\frac{\partial}{\partial\phi}$ are orthogonal, but that not all are unit vectors. Define the unit vectors ${\bf{e}}'_{j}=\frac{(\partial / \partial u^{j})}{||\partial / \partial u^{j}||}$ and write $\nabla\ f$ in terms of this orthonormal set $\nabla\ f = (\nabla\ f)'^{r}{\bf{e}}'_{r}+(\nabla\ f)'^{\theta}{\bf{e}}'_{\theta}+(\nabla\ f)'^{\phi}{\bf{e}}'_{\phi}$.
2. Relevant equations

3. The attempt at a solution

$g_{r\theta}:=g_{12}=\big\langle\frac{\partial}{\partial r}\ ,\ \frac{\partial}{\partial \theta}\big\rangle\\ = \big\langle\frac{\partial x}{\partial r}\frac{\partial}{\partial x}+\frac{\partial y}{\partial r}\frac{\partial}{\partial y}+\frac{\partial z}{\partial r}\frac{\partial}{\partial z}\ ,\ \frac{\partial x}{\partial \theta}\frac{\partial}{\partial x}+\frac{\partial y}{\partial \theta}\frac{\partial}{\partial y}+\frac{\partial z}{\partial \theta}\frac{\partial}{\partial z}\big\rangle\\ = \frac{\partial x}{\partial r}\frac{\partial x}{\partial \theta}+\frac{\partial y}{\partial r}\frac{\partial y}{\partial \theta}+\frac{\partial z}{\partial r}\frac{\partial z}{\partial \theta}\\ =(\text{sin}\ \theta\ \text{cos}\ \phi)(r\ \text{cos}\ \theta)(\text{cos}\ \theta)+(\text{sin}\ \theta\ \text{sin}\ \phi)(r\ \text{cos}\ \theta)(\text{sin}\ \phi)+(\text{cos}\ \theta)(-r\ \text{sin}\ \theta)\\ =0$

Am I correct so far?

Last edited: Sep 23, 2016
2. Sep 23, 2016

### Orodruin

Staff Emeritus
Yes

3. Sep 23, 2016

### spaghetti3451

Ok, so now let me do the remaining calculations in parts 1 and 2.

$g_{r\phi}:=g_{13}=\big\langle\frac{\partial}{\partial r}\ ,\ \frac{\partial}{\partial \phi}\big\rangle\\ = \big\langle\frac{\partial x}{\partial r}\frac{\partial}{\partial x}+\frac{\partial y}{\partial r}\frac{\partial}{\partial y}+\frac{\partial z}{\partial r}\frac{\partial}{\partial z}\ ,\ \frac{\partial x}{\partial \phi}\frac{\partial}{\partial x}+\frac{\partial y}{\partial \phi}\frac{\partial}{\partial y}+\frac{\partial z}{\partial \phi}\frac{\partial}{\partial z}\big\rangle\\ = \frac{\partial x}{\partial r}\frac{\partial x}{\partial \phi}+\frac{\partial y}{\partial r}\frac{\partial y}{\partial \phi}+\frac{\partial z}{\partial r}\frac{\partial z}{\partial \phi}\\ =(\text{sin}\ \theta\ \text{cos}\ \phi)(-r\ \text{sin}\ \theta\ \text{sin}\ \phi)+(\text{sin}\ \theta\ \text{sin}\ \phi)(r\ \text{sin}\ \theta\ \text{cos}\ \phi)+(\text{cos}\ \theta)(0)\\ =0$

$g_{\theta\phi}:=g_{23}=\big\langle\frac{\partial}{\partial \theta}\ ,\ \frac{\partial}{\partial \phi}\big\rangle\\ = \big\langle\frac{\partial x}{\partial \theta}\frac{\partial}{\partial x}+\frac{\partial y}{\partial \theta}\frac{\partial}{\partial y}+\frac{\partial z}{\partial \theta}\frac{\partial}{\partial z}\ ,\ \frac{\partial x}{\partial \phi}\frac{\partial}{\partial x}+\frac{\partial y}{\partial \phi}\frac{\partial}{\partial y}+\frac{\partial z}{\partial \phi}\frac{\partial}{\partial z}\big\rangle\\ = \frac{\partial x}{\partial \theta}\frac{\partial x}{\partial \phi}+\frac{\partial y}{\partial \theta}\frac{\partial y}{\partial \phi}+\frac{\partial z}{\partial \theta}\frac{\partial z}{\partial \phi}\\ =(r\ \text{cos}\ \theta\ \text{cos}\ \phi)(-r\ \text{sin}\ \theta\text{sin}\ \phi)+(r\ \text{cos}\ \theta\ \text{sin}\ \phi)(r\ \text{sin}\ \theta\ \text{cos}\ \phi)+(-r\ \text{sin}\ \theta)(0)\\ =0$

2

$({\nabla f })^{r}=g_{rr}=:=g_{11}=\big\langle\frac{\partial}{\partial r}\ ,\ \frac{\partial}{\partial r}\big\rangle\\ = \big\langle\frac{\partial x}{\partial r}\frac{\partial}{\partial x}+\frac{\partial y}{\partial r}\frac{\partial}{\partial y}+\frac{\partial z}{\partial r}\frac{\partial}{\partial z}\ ,\ \frac{\partial x}{\partial r}\frac{\partial}{\partial x}+\frac{\partial y}{\partial r}\frac{\partial}{\partial y}+\frac{\partial z}{\partial r}\frac{\partial}{\partial z}\big\rangle\\ = \frac{\partial x}{\partial r}\frac{\partial x}{\partial r}+\frac{\partial y}{\partial r}\frac{\partial y}{\partial r}+\frac{\partial z}{\partial r}\frac{\partial z}{\partial r}\\ =(\text{sin}\ \theta\ \text{cos}\ \phi)^{2}+(\text{sin}\ \theta\ \text{sin}\ \phi)^{2}+(\text{cos}\ \theta)^{2}\\ =1$
$({\nabla f })^{\theta}=g_{\theta\theta}=:=g_{22}=\big\langle\frac{\partial}{\partial \theta}\ ,\ \frac{\partial}{\partial \theta}\big\rangle\\ = \big\langle\frac{\partial x}{\partial \theta}\frac{\partial}{\partial x}+\frac{\partial y}{\partial \theta}\frac{\partial}{\partial y}+\frac{\partial z}{\partial \theta}\frac{\partial}{\partial z}\ ,\ \frac{\partial x}{\partial \theta}\frac{\partial}{\partial x}+\frac{\partial y}{\partial \theta}\frac{\partial}{\partial y}+\frac{\partial z}{\partial \theta}\frac{\partial}{\partial z}\big\rangle\\ = \frac{\partial x}{\partial \theta}\frac{\partial x}{\partial \theta}+\frac{\partial y}{\partial \theta}\frac{\partial y}{\partial \theta}+\frac{\partial z}{\partial \theta}\frac{\partial z}{\partial \theta}\\ =(r\ \text{cos}\ \theta\ \text{cos}\ \phi)^{2}+(r\ \text{cos}\ \theta\ \text{sin}\ \phi)^{2}+(-r\ \text{sin}\ \theta)^{2}\\ =r^{2}$
$({\nabla f })^{\phi}=g_{\phi\phi}=:=g_{22}=\big\langle\frac{\partial}{\partial \phi}\ ,\ \frac{\partial}{\partial \phi}\big\rangle\\ = \big\langle\frac{\partial x}{\partial \phi}\frac{\partial}{\partial x}+\frac{\partial y}{\partial \phi}\frac{\partial}{\partial y}+\frac{\partial z}{\partial \phi}\frac{\partial}{\partial z}\ ,\ \frac{\partial x}{\partial \phi}\frac{\partial}{\partial x}+\frac{\partial y}{\partial \phi}\frac{\partial}{\partial y}+\frac{\partial z}{\partial \phi}\frac{\partial}{\partial z}\big\rangle\\ = \frac{\partial x}{\partial \phi}\frac{\partial x}{\partial \phi}+\frac{\partial y}{\partial \phi}\frac{\partial y}{\partial \phi}+\frac{\partial z}{\partial \phi}\frac{\partial z}{\partial \phi}\\ =(-r\ \text{sin}\ \theta\ \text{sin}\ \phi)^{2}+(r\ \text{sin}\ \theta\ \text{cos}\ \phi)^{2}+(0)^{2}\\ =r^{2}\text{sin}^{2}\theta$

Are they correct?

4. Sep 23, 2016

### Orodruin

Staff Emeritus
What is $f$? Also, normally, the gradient is a covariant vector. Your notation is therefore not very clear to me.

5. Sep 23, 2016

### spaghetti3451

I mention the definition below:

If $M^{n}$ is a (psuedo)-Riemannian manifold and $f$ is a differentiable function, the gradient vector $\nabla f$ is the contravariant vector associated to the covector $df$ such that $df({\bf{w}})=\langle\nabla f, {\bf{w}}\rangle$ for some vector $\bf{w}$.

Now, $\displaystyle{df = \frac{\partial f}{\partial x^{j}}dx^{j}}$ and $\nabla f$ is the contravariant vector associated to the covector $df$ so that $\displaystyle{(\nabla f)^{i} = g^{ij}\frac{\partial f}{\partial x^{j}}}$.

6. Sep 23, 2016

### Orodruin

Staff Emeritus
You still have not defined what $f$ is. Based on your problem statement, it is not necessarily the coordinate functions

7. Sep 23, 2016

### spaghetti3451

Thanks for pointing that out. I now understand my mistake in my proposed solution.

I think the function $f$ has to be kept untouched. Using the definition $\displaystyle{(\nabla f)^{i} = g^{ij}\frac{\partial f}{\partial x^{j}}}$,

$({\nabla f})^{r}=g^{rr}\frac{\partial f}{\partial r}=(g_{rr})^{-1}\frac{\partial f}{\partial r}=\big\langle\frac{\partial}{\partial r}\ ,\ \frac{\partial}{\partial r}\big\rangle ^{-1}\frac{\partial f}{\partial r}\\ = \big\langle\frac{\partial x}{\partial r}\frac{\partial}{\partial x}+\frac{\partial y}{\partial r}\frac{\partial}{\partial y}+\frac{\partial z}{\partial r}\frac{\partial}{\partial z}\ ,\ \frac{\partial x}{\partial r}\frac{\partial}{\partial x}+\frac{\partial y}{\partial r}\frac{\partial}{\partial y}+\frac{\partial z}{\partial r}\frac{\partial}{\partial z}\big\rangle ^{-1}\frac{\partial f}{\partial r}\\ = (\frac{\partial x}{\partial r}\frac{\partial x}{\partial r}+\frac{\partial y}{\partial r}\frac{\partial y}{\partial r}+\frac{\partial z}{\partial r}\frac{\partial z}{\partial r}) ^{-1}\frac{\partial f}{\partial r}\\ =[(\text{sin}\ \theta\ \text{cos}\ \phi)^{2}+(\text{sin}\ \theta\ \text{sin}\ \phi)^{2}+(\text{cos}\ \theta)^{2}] ^{-1}\frac{\partial f}{\partial r}\\ =\frac{\partial f}{\partial r}$

$({\nabla f })^{\theta}=g^{\theta\theta}=(g_{\theta\theta}) ^{-1}\frac{\partial f}{\partial \theta}=\big\langle\frac{\partial}{\partial \theta}\ ,\ \frac{\partial}{\partial \theta}\big\rangle ^{-1}\frac{\partial f}{\partial \theta}\\ = \big\langle\frac{\partial x}{\partial \theta}\frac{\partial}{\partial x}+\frac{\partial y}{\partial \theta}\frac{\partial}{\partial y}+\frac{\partial z}{\partial \theta}\frac{\partial}{\partial z}\ ,\ \frac{\partial x}{\partial \theta}\frac{\partial}{\partial x}+\frac{\partial y}{\partial \theta}\frac{\partial}{\partial y}+\frac{\partial z}{\partial \theta}\frac{\partial}{\partial z}\big\rangle ^{-1}\frac{\partial f}{\partial \theta}\\ = (\frac{\partial x}{\partial \theta}\frac{\partial x}{\partial \theta}+\frac{\partial y}{\partial \theta}\frac{\partial y}{\partial \theta}+\frac{\partial z}{\partial \theta}\frac{\partial z}{\partial \theta}) ^{-1}\frac{\partial f}{\partial \theta}\\ =[(r\ \text{cos}\ \theta\ \text{cos}\ \phi)^{2}+(r\ \text{cos}\ \theta\ \text{sin}\ \phi)^{2}+(-r\ \text{sin}\ \theta)^{2}] ^{-1}\frac{\partial f}{\partial \theta}\\ =\frac{1}{r^{2}}\frac{\partial f}{\partial \theta}$
$({\nabla f })^{\phi}=g^{\phi\phi}=(g_{\phi\phi}) ^{-1}\frac{\partial f}{\partial\phi}=\big\langle\frac{\partial}{\partial \phi}\ ,\ \frac{\partial}{\partial \phi}\big\rangle ^{-1}\frac{\partial f}{\partial\phi}\\ = \big\langle\frac{\partial x}{\partial \phi}\frac{\partial}{\partial x}+\frac{\partial y}{\partial \phi}\frac{\partial}{\partial y}+\frac{\partial z}{\partial \phi}\frac{\partial}{\partial z}\ ,\ \frac{\partial x}{\partial \phi}\frac{\partial}{\partial x}+\frac{\partial y}{\partial \phi}\frac{\partial}{\partial y}+\frac{\partial z}{\partial \phi}\frac{\partial}{\partial z}\big\rangle ^{-1}\frac{\partial f}{\partial\phi}\\ = (\frac{\partial x}{\partial \phi}\frac{\partial x}{\partial \phi}+\frac{\partial y}{\partial \phi}\frac{\partial y}{\partial \phi}+\frac{\partial z}{\partial \phi}\frac{\partial z}{\partial \phi}) ^{-1}\frac{\partial f}{\partial\phi}\\ =[(-r\ \text{sin}\ \theta\ \text{sin}\ \phi)^{2}+(r\ \text{sin}\ \theta\ \text{cos}\ \phi)^{2}+(0)^{2}] ^{-1}\frac{\partial f}{\partial\phi}\\ =\frac{1}{r^{2}\text{sin}^{2}\theta}\frac{\partial f}{\partial\phi}$

8. Sep 23, 2016

### Orodruin

Staff Emeritus
Note that it is not always true that $g^{ij} = (g_{ij})^{-1}$. This is only true if $\partial_r$ is orthogonal to the other basis vectors. However, this is the case here.

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted