Spherical Polar Coordinates

Homework Statement:

$x=r sin\theta cos\phi, y=rsin\theta sin\phi, z=rcos\theta$
Find $\delta f/\delta x$and$\delta r/\delta x$ treating r as a function of the cartesian coordinates
Given f is a function of r only, show
$\delta f^2/\delta x = (x/r)(df/dr)$
and
$\delta ^2 *f/\delta x^2 = (1/r)(df/dr) + (x^2/r)(d/dr)(1/r)(df/dr)$

Homework Equations:

?
Ive found $\delta x/\delta r$ as $sin\theta cos\phi$
$\delta r/\delta x$ as $csc\theta sec\phi$
But unsure how to do the second part? Chain rule seems to give r/x not x/r?

Last edited:

Related Introductory Physics Homework Help News on Phys.org
BvU
Homework Helper
2019 Award
Ive found $\partial f\over \partial x$ as $\sin\theta \cos\phi$
You can't mean that. Independent of $f$ ?

Orodruin
Staff Emeritus
Homework Helper
Gold Member
Ive found $\delta f/\delta x$ as $sin\theta cos\phi$
$\delta r/\delta x$ as $csc\theta sec\phi$
But unsure how to do the second part? Chain rule seems to give r/x not x/r?

Also, note that $\partial$ is written \partial in LaTeX.

You can't mean that. Independent of $f$ ?
Sorry, I meant $\frac{\partial x}{\partial r}$

Orodruin
Staff Emeritus
Homework Helper
Gold Member
Sorry, I meant $\frac{\partial x}{\partial r}$
It is not true for partial derivatives that $\partial x/\partial r = (\partial r/\partial x)^{-1}$

BvU
Homework Helper
2019 Award
And then we will try to work our way through this very relevant exercise .

It is not true for partial derivatives that $\partial x/\partial r = (\partial r/\partial x)^{-1}$
Okay, so how else would I get $\partial x/\partial r$?

BvU
Homework Helper
2019 Award
Invert the transformation
$$x=r \sin\theta \cos\phi, \quad y=r\sin\theta \sin\phi, \quad z=r\cos\theta$$ to $$r = ...(x, y,z),\quad \phi = ...,\quad \theta = ...$$

(advice: use \sin and \cos, \log etc in $\LaTeX$)

Invert the transformation

x=rsinθcosϕ,y=rsinθsinϕ,z=rcosθx=rsin⁡θcos⁡ϕ,y=rsin⁡θsin⁡ϕ,z=rcos⁡θ​

to

r=...(x,y,z),ϕ=...,θ=...r=...(x,y,z),ϕ=...,θ=...​

(advice: use \sin and \cos, \log etc in LATEXLATEX)
Okay so I get
r=√x2+y2+z2r=x2+y2+z2
$\theta = \cos^{-1} (\frac {z} {\sqrt{x^2 + y^2 + z^2})$
ϕ=tan−1(yx)ϕ=tan−1⁡(yx)

Am I right in thinking this makes

∂r∂x=sinθcosϕ∂r∂x=sin⁡θcos⁡ϕ?

BvU
Homework Helper
2019 Award
But there are tricks available -- ah you are on a good track. Differentiating $r^2 = x^2 + y^2 + z^2$ is easier to deal with.

Use \sqrt { ....} and always preview to check parentheses are right.

But there are tricks available -- ah you are on a good track. Differentiating $r^2 = x^2 + y^2 + z^2$ is easier to deal with.

Use \sqrt { ....} and always preview to check parentheses are right.
Oh god of course, thank you.
So $\frac{\partial r}{\partial x} = \frac{x}{r}$
And then from that I can show
$\frac{\partial f}{\partial x} = \frac{\partial f}{\partial r} \frac{\partial r}{\partial x} = \frac{df}{dr}\frac{x}{r}$
Im guessing I just use the chain rule for the next part?

Sorry for the state of my LaTeX maths

BvU
Homework Helper
2019 Award
Good ! Keep going ...

Sorry for the state of my LaTeX maths
No need. You are obviously eager to learn and we are equally eager to assist.

Good ! Keep going ...

No need. You are obviously eager to learn and we are equally eager to assist.
Right so I'm a bit stuck, I'm getting $\frac{\partial^2 f}{\partial x^2} = \frac{\partial}{\partial x}(\frac{df}{dr}\frac{x}{r}) = \frac{\partial}{\partial x}(\frac{df}{dr}) \frac{x}{r} + \frac{df}{dr}\frac{1}{r}$
where
$\frac{\partial}{\partial x}(\frac{df}{dr}) = \frac{\partial}{\partial x}(\frac{r}{x} \frac{\partial f}{\partial x}) = (\frac{-r}{x^2} \frac{\partial f}{\partial x}) + (\frac{r}{x}\frac{\partial^2 f}{\partial x^2})$

Orodruin
Staff Emeritus
Homework Helper
Gold Member
Invert the transformation
$$x=r \sin\theta \cos\phi, \quad y=r\sin\theta \sin\phi, \quad z=r\cos\theta$$ to $$r = ...(x, y,z),\quad \phi = ...,\quad \theta = ...$$

(advice: use \sin and \cos, \log etc in $\LaTeX$)
It should be noted that you can do this without actually inverting the coordinate relations. The general theory is based on the chain rule. For a function of one parameter only, say $y(x)$, you would have
$$1 = \frac{dx}{dx} = \frac{dy}{dx} \frac{dx}{dy}.$$
This is the reason that $dx/dy = (dy/dx)^{-1}$ in this case (just solve for $dx/dy$). However, for functions of several variables, say $y^i(x^1, \ldots, x^n)$, the chain rule would instead give you
$$\delta^i_j = \frac{\partial y^i}{\partial y^j} = \sum_{k} \frac{\partial y^i}{\partial x^k} \frac{\partial x^k}{\partial y^j}.$$
Thus, from here you cannot just divide by a factor from the RHS to obtain $\partial x^k/\partial y^j$ since what you have is a sum. However, if you define the matrices $A$ and $B$ defined as
$$A = \begin{pmatrix}\frac{\partial x^1}{\partial y^1} & \frac{\partial x^1}{\partial y^2} & \ldots \\ \frac{\partial x^2}{\partial y^1} & \frac{\partial x^2}{\partial y^2} & \ldots \\ \vdots & \vdots & \ddots \end{pmatrix}, \qquad B = \begin{pmatrix}\frac{\partial y^1}{\partial x^1} & \frac{\partial y^1}{\partial x^2} & \ldots \\ \frac{\partial y^2}{\partial x^1} & \frac{\partial y^2}{\partial x^2} & \ldots \\ \vdots & \vdots & \ddots \end{pmatrix},$$
then the relation can be rewritten
$$1_n = BA,$$
where $1_n$ is the $n \times n$ unit matrix. In other words, $A = B^{-1}$. Thus, if you compute all the derivatives $\partial y^i/\partial x^j$, you can find $\partial x^i/\partial y^j$ by matrix inversion.

However, if you are unfamiliar with matrices, it is also fine to solve the linear system of equations. For example, in polar coordinates on $\mathbb R^2$: $x = r\cos\phi$, $y = r\sin\phi$, you would find
$$1 = \frac{\partial x}{\partial x} = \frac{\partial x}{\partial r} \frac{\partial r}{\partial x} + \frac{\partial x}{\partial \phi} \frac{\partial \phi}{\partial x} = \cos\phi \frac{\partial r}{\partial x} - r \sin\phi \frac{\partial \phi}{\partial x}$$
and
$$0 = \frac{\partial y}{\partial x} = \frac{\partial y}{\partial r} \frac{\partial r}{\partial x} + \frac{\partial y}{\partial \phi} \frac{\partial \phi}{\partial x} = \sin\phi \frac{\partial r}{\partial x} + r \cos\phi \frac{\partial \phi}{\partial x}$$
from which you can solve directly for $\partial r/\partial x$ and $\partial \phi/\partial x$.

BvU
Orodruin
Staff Emeritus
Homework Helper
Gold Member
Right so I'm a bit stuck, I'm getting $\frac{\partial^2 f}{\partial x^2} = \frac{\partial}{\partial x}(\frac{df}{dr}\frac{x}{r}) = \frac{\partial}{\partial x}(\frac{df}{dr}) \frac{x}{r} + \frac{df}{dr}\frac{1}{r}$
where
$\frac{\partial}{\partial x}(\frac{df}{dr}) = \frac{\partial}{\partial x}(\frac{r}{x} \frac{\partial f}{\partial x}) = (\frac{-r}{x^2} \frac{\partial f}{\partial x}) + (\frac{r}{x}\frac{\partial^2 f}{\partial x^2})$
Note that
$$\frac{\partial}{\partial x} \frac{x}{r} \neq \frac 1r$$
as $r$ depends on $x$.

Note that
$$\frac{\partial}{\partial x} \frac{x}{r} \neq \frac 1r$$
as $r$ depends on $x$.
Is $\frac{\partial}{\partial x} \frac{x}{r} = \frac{r - \frac{x^2}{r}}{r^2}$

PeroK
Is $\frac{\partial}{\partial x} \frac{x}{r} = \frac{r - \frac{x^2}{r}}{r^2}$
$\frac{\partial}{\partial x} \frac{x}{r} = \frac{r^2 - x^2}{r^3}$