Divergence of a position vector in spherical coordinates

  • #1
17
2
I know the divergence of any position vectors in spherical coordinates is just simply 3, which represents their dimension. But there's a little thing that confuses me.

The vector field of A is written as follows,

A_r      \hat{\mathbf r}     + A_\theta \hat{\boldsymbol \theta} + A_\varphi \hat{\boldsymbol \varphi}
,
and the divergence of a vector field A in spherical coordinates are written as follows

{1 \over r^2}{\partial \left( r^2 A_r \right) \over \partial r} + {1 \over r\sin\theta}{\partial \over \partial \theta} \left(  A_\theta\sin\theta \right) + {1 \over r\sin\theta}{\partial A_\varphi \over \partial \varphi}
, which shows you have to put terms of A related to theta or psi.

However, when you represent a position using a position vector in spherical coordinates, you usually only use r hat simply because r hat includes angle terms already.

Then, when do you use theta or psi terms? And what exactly do A_theta and A_psi term represent when r hat already has the meaning of angles? I have a feeling that they are redundant.

I heard this is related to something called spherical symmetry but wanna understand it strictly. Thanks!

[Moderator's note: Approved as not being homework.]
 
Last edited by a moderator:

Answers and Replies

  • #2
PeroK
Science Advisor
Homework Helper
Insights Author
Gold Member
2020 Award
19,216
10,725
Summary:: I know the divergence of any position vectors in spherical coordinates is just simply 3, which represents their dimension. But there's a little thing that confuses me.

I know the divergence of any position vectors in spherical coordinates is just simply 3, which represents their dimension. But there's a little thing that confuses me.

The vector field of A is written as follows,

A_r      \hat{\mathbf r}     + A_\theta \hat{\boldsymbol \theta} + A_\varphi \hat{\boldsymbol \varphi}
,
and the divergence of a vector field A in spherical coordinates are written as follows

{1 \over r^2}{\partial \left( r^2 A_r \right) \over \partial r} + {1 \over r\sin\theta}{\partial \over \partial \theta} \left(  A_\theta\sin\theta \right) + {1 \over r\sin\theta}{\partial A_\varphi \over \partial \varphi}
, which shows you have to put terms of A related to theta or psi.

However, when you represent a position using a position vector in spherical coordinates, you usually only use r hat simply because r hat includes angle terms already.

Then, when do you use theta or psi terms? And what exactly do A_theta and A_psi term represent when r hat already has the meaning of angles? I have a feeling that they are redundant.

I heard this is related to something called spherical symmetry but wanna understand it strictly. Thanks!

[Moderator's note: Approved as not being homework.]

First, a position vector is simply a single vector. You cannot differentiate it or take its divergence. What you can do is define a vector field everywhere with:
$$\vec A(r, \theta, \phi) = \vec r = r \hat r$$
This gives you a vector field that can be differentiated and its divergence is ##3## everywhere. Note also that the divergence of a vector field is a scalar field: i.e. a real-valued function associated with every point.

Now, a vector field can have components in any direction. So, we have in general:
$$\vec A(r, \theta, \phi) = A_r(r, \theta, \phi) \hat r + A_{\theta}(r, \theta, \phi) \hat \theta + A_{\phi}(r, \theta, \phi) \hat \phi $$
In other words, the vector field involves three real-valued functions at each point in space. The field of position vectors is only one example. The divergence of this field is given by the equation you posted.
 
  • #3
17
2
First, a position vector is simply a single vector. You cannot differentiate it or take its divergence. What you can do is define a vector field everywhere with:
$$\vec A(r, \theta, \phi) = \vec r = r \hat r$$
This gives you a vector field that can be differentiated and its divergence is ##3## everywhere. Note also that the divergence of a vector field is a scalar field: i.e. a real-valued function associated with every point.

Now, a vector field can have components in any direction. So, we have in general:
$$\vec A(r, \theta, \phi) = A_r(r, \theta, \phi) \hat r + A_{\theta}(r, \theta, \phi) \hat \theta + A_{\phi}(r, \theta, \phi) \hat \phi $$
In other words, the vector field involves three real-valued functions at each point in space. The field of position vectors is only one example. The divergence of this field is given by the equation you posted.
Thank you! So a vector field can be defined as either $$\vec A(r, \theta, \phi) = \vec r = r \hat r$$ or $$\vec A(r, \theta, \phi) = A_r(r, \theta, \phi) \hat r + A_{\theta}(r, \theta, \phi) \hat \theta + A_{\phi}(r, \theta, \phi) \hat \phi $$. Is that right?

Also then, from my understanding, you can always say that
$$A_r(r, \theta, \phi) \ = r$$
, and
$$A_{\theta}(r, \theta, \phi) = A_{\phi}(r, \theta, \phi)=0$$

is this right as well?
If so, is there any case that you have to write $$A_{\theta}(r, \theta, \phi) and A_{\phi}(r, \theta, \phi)$$ that are not zero?
 
  • #4
PeroK
Science Advisor
Homework Helper
Insights Author
Gold Member
2020 Award
19,216
10,725
Thank you! So a vector field can be defined as either $$\vec A(r, \theta, \phi) = \vec r = r \hat r$$ or $$\vec A(r, \theta, \phi) = A_r(r, \theta, \phi) \hat r + A_{\theta}(r, \theta, \phi) \hat \theta + A_{\phi}(r, \theta, \phi) \hat \phi $$. Is that right?

Also then, from my understanding, you can always say that
$$A_r(r, \theta, \phi) \ = r$$
, and
$$A_{\theta}(r, \theta, \phi) = A_{\phi}(r, \theta, \phi)=0$$

is this right as well?
If so, is there any case that you have to write $$A_{\theta}(r, \theta, \phi) and A_{\phi}(r, \theta, \phi)$$ that are not zero?

In principle, ##A_r, A_{\theta}, A_{\phi}## can be any functions you like. For example, the vector field could represent the velocity of a fluid at any point.

Often you use spherical coordinates when you have a spherically symmetric field - that's when it's most useful. E.g. the gravitational field might be:
$$\vec g = -\frac{GM}{r^2}\hat r$$
But, any field can be represented in spherical coordinates if you want.
 
  • #5
kuruman
Science Advisor
Homework Helper
Insights Author
Gold Member
10,828
3,849
But, any field can be represented in spherical coordinates if you want.
Any? Even a uniform field? I don't mean to cause trouble, but "any" is too all encompassing without qualifications.
 
  • Like
Likes kent davidge
  • #6
Meir Achuz
Science Advisor
Homework Helper
Gold Member
3,533
115
The divergence of the position vector equals three in any coordinate system.
 
  • #7
Nugatory
Mentor
13,598
6,822
Any? Even a uniform field? I don't mean to cause trouble, but "any" is too all encompassing without qualifications.
Why not a uniform field? Aside from the coordinate singularity at ##r=0##, it’s just a coordinate transformation, is it not?
 
  • #8
kuruman
Science Advisor
Homework Helper
Insights Author
Gold Member
10,828
3,849
Yes, in principle it is "just" a coordinate transformation, I guess. I have no idea though how to proceed to find it. It boggles my mind to imagine how to take ##\vec E=E_0~\hat z## and write it as ##\vec E= E_r(r,\theta,\phi)~\hat r+E_{\theta}(r,\theta,\phi)~\hat \theta+E_{\phi}(r,\theta,\phi)~\hat \phi##. In particular how does one handle the spherical unit vectors the direction of which depends on the spherical angles?
 
  • #9
17
2
In principle, ##A_r, A_{\theta}, A_{\phi}## can be any functions you like. For example, the vector field could represent the velocity of a fluid at any point.

Often you use spherical coordinates when you have a spherically symmetric field - that's when it's most useful. E.g. the gravitational field might be:
$$\vec g = -\frac{GM}{r^2}\hat r$$
But, any field can be represented in spherical coordinates if you want.
So to let A_θ(r,θ,ϕ)=A_ϕ(r,θ,ϕ)=0, does a field have to be spherically symmetric ,or as you said, you can assign any function?
 
Last edited:
  • #10
PeroK
Science Advisor
Homework Helper
Insights Author
Gold Member
2020 Award
19,216
10,725
So to let A_θ(r,θ,ϕ)=A_ϕ(r,θ,ϕ)=0, does a field have to be spherically symmetric ,or as you said, you can assign any function?
If you want an exercise, you could calculate the divergence of:
$$\vec A = (r \cos \theta) \hat r + (r \sin \theta) \hat \theta + (r\sin \theta \cos \phi) \hat \phi$$
 
  • #11
PeroK
Science Advisor
Homework Helper
Insights Author
Gold Member
2020 Award
19,216
10,725
Yes, in principle it is "just" a coordinate transformation, I guess. I have no idea though how to proceed to find it. It boggles my mind to imagine how to take ##\vec E=E_0~\hat z## and write it as ##\vec E= E_r(r,\theta,\phi)~\hat r+E_{\theta}(r,\theta,\phi)~\hat \theta+E_{\phi}(r,\theta,\phi)~\hat \phi##. In particular how does one handle the spherical unit vectors the direction of which depends on the spherical angles?

$$\hat z = \cos \theta \ \hat r - \sin \theta \ \hat \theta$$
 
  • #12
17
2
If you want an exercise, you could calculate the divergence of:
$$\vec A = (r \cos \theta) \hat r + (r \sin \theta) \hat \theta + (r\sin \theta \cos \phi) \hat \phi$$
Thanks! I guess I was considering some useless stuff haha
 
  • #13
PeroK
Science Advisor
Homework Helper
Insights Author
Gold Member
2020 Award
19,216
10,725
Thanks! I guess I was considering some useless stuff haha
Actually, one example is the electric field of a dipole oriented along the z-axis:
$$\vec E = \frac{p}{4\pi \epsilon_0 r^3}(2\cos \theta \ \hat r + \sin \theta \ \hat \theta)$$
 
  • #14
PeroK
Science Advisor
Homework Helper
Insights Author
Gold Member
2020 Award
19,216
10,725
Why not a uniform field? Aside from the coordinate singularity at ##r=0##, it’s just a coordinate transformation, is it not?
Actually, the coordinate singularity is the whole z-axis. So, like the dipole example, we perhaps need the field to be in the ##\hat r## direction on the z-axis, where ##\hat \theta## and ##\hat \phi## are not well defined.
 
Last edited:
  • #15
kuruman
Science Advisor
Homework Helper
Insights Author
Gold Member
10,828
3,849
$$\hat z = \cos \theta \ \hat r - \sin \theta \ \hat \theta$$
Yes, of course. I tripped over my own feet even though I have taught the conducting sphere in a uniform electric field many times. :headbang: Must be a subtle effect of home confinement.
 
  • Like
Likes hutchphd and PeroK
  • #16
352
254
If you want an exercise, you could calculate the divergence of:
→A=(rcosθ)^r+(rsinθ)^θ+(rsinθcosϕ)^ϕ

Shouldn't this be →A=(rcosθ)^r+(rsinθsinϕ)^θ+(rsinθcosϕ)^ϕ
 
  • #17
PeroK
Science Advisor
Homework Helper
Insights Author
Gold Member
2020 Award
19,216
10,725
If you want an exercise, you could calculate the divergence of:
→A=(rcosθ)^r+(rsinθ)^θ+(rsinθcosϕ)^ϕ

Shouldn't this be →A=(rcosθ)^r+(rsinθsinϕ)^θ+(rsinθcosϕ)^ϕ
Why should it be that?
 
  • #18
352
254
Sorry and should the unit vectors by x y and z rather than r theta phi
 
  • #19
PeroK
Science Advisor
Homework Helper
Insights Author
Gold Member
2020 Award
19,216
10,725
Sorry and should the unit vectors by x y and z rather than r theta phi
Not in spherical coordinates!
 
  • #20
352
254
Sorry, I was confused. Not the first time I answered off the cuff. I should read all the responses to the original post before answering. I will try to do this in the future.
 
  • #21
vanhees71
Science Advisor
Insights Author
Gold Member
19,073
9,882
I'm a bit puzzled about, what this discussion is about. You want to get the divergence of the vector field
$$\vec{A}(\vec{r})=\vec{r}=r \vec{e}_r.$$
The components in spherical orthonormal coordinates thus are
$$A_r=r, \quad A_{\vartheta}=A_{\varphi}=0.$$
Now you can simply take the formula for the divergence given in #1, which simplifies to
$$\vec{\nabla} \cdot \vec{A} =\frac{1}{r^2} \partial_r (r^2 A_r) = \frac{1}{r^2} \partial_r (r^3)=\frac{1}{r^2} 2 r^2 =3,$$
as it must be.

The divergence of a vector field is a scalar field and thus independent of the choice of coordinates used to calculate it. So it's no surprise to get ##3## as when using Cartesian coordinates.
 
  • #22
PeroK
Science Advisor
Homework Helper
Insights Author
Gold Member
2020 Award
19,216
10,725
I'm a bit puzzled about, what this discussion is about.

The original question was whether ##\vec A = \vec r## is the only possible vector field expressible in spherical coordinates.

I think it has been shown that it is not the only one.
 
  • #24
Meir Achuz
Science Advisor
Homework Helper
Gold Member
3,533
115
"I know the divergence of any position vectors"
If someone gave a definition of "position vector", it could end this thread gracefully.
 
  • #25
vanhees71
Science Advisor
Insights Author
Gold Member
19,073
9,882
A position vector is the vector pointing from the origin of the reference frame to the position. Again, it's really simple. In Cartesian coordinates you have ##\vec{r}=x_j \vec{e}_j## (Einstein summation notation used), and the divergence of a vector field is ##\text{div} \vec{A}=\vec{\nabla} \cdot \vec{A}=\partial_j \vec{A}_j##. If ##\vec{A}=\vec{r}## you thus have ##\text{div} \vec{A} = \partial_1 x_1 + \partial_2 x_2 + \partial_3 x_3=3##. Of course you get the same result in any coordinates, because the divergence of a vector field is a scalar and thus independent of the choice of coordinates.
 

Related Threads on Divergence of a position vector in spherical coordinates

Replies
3
Views
6K
Replies
0
Views
7K
Replies
1
Views
1K
Replies
2
Views
2K
Replies
1
Views
14K
Replies
2
Views
16K
Replies
5
Views
2K
  • Last Post
Replies
11
Views
893
Top