• Support PF! Buy your school textbooks, materials and every day products Here!

Spherical Polar Coordinates

  • #1

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:

Answers and Replies

  • #2
BvU
Science Advisor
Homework Helper
2019 Award
12,728
2,904
Ive found ##\partial f\over \partial x## as ##\sin\theta \cos\phi##
You can't mean that. Independent of ##f## ?
 
  • #3
Orodruin
Staff Emeritus
Science Advisor
Homework Helper
Insights Author
Gold Member
16,416
6,239
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?
Please show your actual work, not just your end result.

Also, note that ##\partial## is written \partial in LaTeX.
 
  • #4
You can't mean that. Independent of ##f## ?
Sorry, I meant ##\frac{\partial x}{\partial r}##
 
  • #5
Orodruin
Staff Emeritus
Science Advisor
Homework Helper
Insights Author
Gold Member
16,416
6,239
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}##
 
  • #6
BvU
Science Advisor
Homework Helper
2019 Award
12,728
2,904
Please show your actual work, not just your end result.
And then we will try to work our way through this very relevant exercise :smile: .
 
  • #7
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##?
 
  • #8
BvU
Science Advisor
Homework Helper
2019 Award
12,728
2,904
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##)
 
  • #9
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⁡ϕ?
 
  • #10
BvU
Science Advisor
Homework Helper
2019 Award
12,728
2,904
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.
 
  • #11
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
 
  • #12
BvU
Science Advisor
Homework Helper
2019 Award
12,728
2,904
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.
 
  • #13
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})##
Is this correct? It doesnt lead me to the right answer
 
  • #14
Orodruin
Staff Emeritus
Science Advisor
Homework Helper
Insights Author
Gold Member
16,416
6,239
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##.
 
  • Like
Reactions: BvU
  • #15
Orodruin
Staff Emeritus
Science Advisor
Homework Helper
Insights Author
Gold Member
16,416
6,239
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})##
Is this correct? It doesnt lead me to the right answer
Note that
$$
\frac{\partial}{\partial x} \frac{x}{r} \neq \frac 1r
$$
as ##r## depends on ##x##.
 
  • #16
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}##
 
  • #17
PeroK
Science Advisor
Homework Helper
Insights Author
Gold Member
11,198
4,401
Is ##\frac{\partial}{\partial x} \frac{x}{r} = \frac{r - \frac{x^2}{r}}{r^2}##
Yes, although writing:

##\frac{\partial}{\partial x} \frac{x}{r} = \frac{r^2 - x^2}{r^3}##

seems a bit more logical.
 

Related Threads for: Spherical Polar Coordinates

  • Last Post
Replies
12
Views
1K
  • Last Post
Replies
7
Views
2K
  • Last Post
Replies
7
Views
864
  • Last Post
Replies
6
Views
2K
  • Last Post
Replies
0
Views
3K
  • Last Post
Replies
2
Views
2K
Replies
9
Views
7K
  • Last Post
Replies
1
Views
2K
Top