# Divergence of a position vector in spherical coordinates

• Terrycho
In summary, a vector field can be defined as either a single vector or a set of three real-valued functions at each point in space. The divergence of a vector field is a scalar field that can be calculated using the given equation. In most cases, the components A_theta and A_phi will be zero, except for cases where there is a need to include terms related to theta or phi. This can be related to spherical symmetry, but further understanding is needed.

#### Terrycho

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,

,
and the divergence of a vector field A in spherical coordinates are written as follows

, 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 want to understand it strictly. Thanks!

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

Last edited by a moderator:
Terrycho said:
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,

,
and the divergence of a vector field A in spherical coordinates are written as follows

, 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 want to 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.

Terrycho
PeroK said:
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?

Terrycho said:
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.

Terrycho
PeroK said:
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.

kent davidge
The divergence of the position vector equals three in any coordinate system.

jasonRF
kuruman said:
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?

PeroK
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?

PeroK said:
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:
Terrycho said:
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$$

Terrycho
kuruman said:
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$$

PeroK said:
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

Terrycho said:
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)$$

Nugatory said:
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:
PeroK said:
$$\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. Must be a subtle effect of home confinement.

hutchphd and PeroK
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ϕ)^ϕ

mpresic3 said:
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?

Sorry and should the unit vectors by x y and z rather than r theta phi

mpresic3 said:
Sorry and should the unit vectors by x y and z rather than r theta phi
Not in spherical coordinates!

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.

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.

vanhees71 said:

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.

?

"I know the divergence of any position vectors"
If someone gave a definition of "position vector", it could end this thread gracefully.

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.

## What is the divergence of a position vector in spherical coordinates?

The divergence of a position vector in spherical coordinates is a mathematical concept that measures the rate at which a vector field (represented by a position vector) spreads or converges at a given point in space. It represents the net flux of the vector field per unit volume at that point.

## How is the divergence of a position vector calculated in spherical coordinates?

The divergence of a position vector in spherical coordinates can be calculated using the following formula:
div(F) = (1/r^2) * (∂(r^2F_r)/∂r + ∂(sinθF_θ)/∂θ + ∂(F_φ)/∂φ)

Where r, θ, and φ represent the three spherical coordinates and F_r, F_θ, and F_φ represent the components of the vector field in the corresponding directions.

## What is the physical significance of the divergence of a position vector in spherical coordinates?

The divergence of a position vector in spherical coordinates has physical significance in fields such as fluid mechanics and electromagnetism. In fluid mechanics, it represents the rate of expansion or contraction of a fluid flow at a given point. In electromagnetism, it represents the strength of the electric or magnetic field at a given point.

## How does the divergence of a position vector in spherical coordinates relate to other vector operations?

The divergence of a position vector in spherical coordinates is related to other vector operations such as gradient, curl, and Laplacian. It can be expressed in terms of these operations as follows:
div(F) = (1/r) * (∂(rF_r)/∂r + ∂(F_θ)/∂θ + (sinθ/r) * ∂(F_φ)/∂φ) = (∇ • F)

## What are some real-world applications of the divergence of a position vector in spherical coordinates?

The divergence of a position vector in spherical coordinates has applications in various fields such as meteorology, oceanography, and geophysics. In meteorology, it is used to study atmospheric circulation patterns. In oceanography, it is used to analyze ocean currents. In geophysics, it is used to understand the flow of fluids in the Earth's interior.