# Homework Help: Derive grad T in spherical coordinates

Tags:
1. Apr 19, 2015

### Happiness

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

$x=r\sin\theta\cos\phi,\,\,\,\,\,y=r\sin\theta\sin\phi,\,\,\,\,\,z=r\cos\theta$

$\hat{x}=\sin\theta\cos\phi\,\hat{r}+\cos\theta\cos\phi\,\hat{\theta}-\sin\phi\,\hat{\phi}$
$\hat{y}=\sin\theta\sin\phi\,\hat{r}+\cos\theta\sin\phi\,\hat{\theta}+\cos\phi\,\hat{\phi}$
$\hat{z}=\cos\theta\,\hat{r}-\sin\theta\,\hat{\theta}$

2. Relevant equations
By chain rule,

$\frac{\partial T}{\partial x}=\frac{\partial T}{\partial r}\frac{\partial r}{\partial x}+\frac{\partial T}{\partial\theta}\frac{\partial\theta}{\partial x}+\frac{\partial T}{\partial\phi}\frac{\partial\phi}{\partial x}$
$\frac{\partial T}{\partial y}=\frac{\partial T}{\partial r}\frac{\partial r}{\partial y}+\frac{\partial T}{\partial\theta}\frac{\partial\theta}{\partial y}+\frac{\partial T}{\partial\phi}\frac{\partial\phi}{\partial y}$
$\frac{\partial T}{\partial z}=\frac{\partial T}{\partial r}\frac{\partial r}{\partial z}+\frac{\partial T}{\partial\theta}\frac{\partial\theta}{\partial z}+\frac{\partial T}{\partial\phi}\frac{\partial\phi}{\partial z}$

$\nabla T=\frac{\partial T}{\partial x}\hat{x}+\frac{\partial T}{\partial y}\hat{y}+\frac{\partial T}{\partial z}\hat{z}$

3. The attempt at a solution

$\nabla T=(\frac{\partial T}{\partial r}\frac{1}{\sin\theta\cos\phi}+\frac{\partial T}{\partial\theta}\frac{1}{r\cos\theta\cos\phi}+\frac{\partial T}{\partial\phi}\frac{-1}{r\sin\theta\sin\phi})\hat{x}+(\frac{\partial T}{\partial r}\frac{1}{\sin\theta\sin\phi}+\frac{\partial T}{\partial\theta}\frac{1}{r\cos\theta\cos\phi}+\frac{\partial T}{\partial\phi}\frac{1}{r\sin\theta\sin\phi})\hat{y}$
$+(\frac{\partial T}{\partial r}\frac{1}{\cos\theta}+\frac{\partial T}{\partial\theta}\frac{-1}{r\sin\theta}+\frac{\partial T}{\partial\phi}0)\hat{z}$

Just by looking at the coefficient of $\hat{r}$, we get

$\frac{\partial T}{\partial r}+\frac{\partial T}{\partial\theta}\frac{\tan\theta}{r}-\frac{\partial T}{\partial\phi}\frac{1}{r\tan\theta}+\frac{\partial T}{\partial r}+\frac{\partial T}{\partial\theta}\frac{\tan\theta}{r}+\frac{\partial T}{\partial\phi}\frac{\tan\theta}{r}+\frac{\partial T}{\partial r}-\frac{\partial T}{\partial\theta}\frac{1}{r\tan\theta}$,

which is clearly not correct, since

$\nabla T=\frac{\partial T}{\partial r}\hat{r}+\frac{1}{r}\frac{\partial T}{\partial\theta}\hat{\theta}+\frac{1}{r\sin\theta}\frac{\partial T}{\partial\phi}\hat{\phi}$,

the coefficient of $\hat{r}$ should be just $\frac{\partial T}{\partial r}$.

Last edited: Apr 19, 2015
2. Apr 19, 2015

### vela

Staff Emeritus
You should rethink some of those derivatives. For example, you have $r = \sqrt{x^2+y^2+z^2}$, so
$$\frac{\partial r}{\partial x} = \frac{x}{\sqrt{x^2+y^2+z^2}} = \frac{r \sin\theta \cos\phi}{r} = \sin\theta\cos\phi.$$ You somehow got the reciprocal.