Divergence in Cylindrical Coordinates or Divergence in Spherical Coordinates do not appear inline with normal (Cartesian) Divergence formula. And, it is annoying you, from where those extra terms are appearing.

Don’t worry! This article explains complete step by step derivation for the Divergence of Vector Field in Cylindrical and Spherical Coordinates.

## Divergence of a Vector Field

Read: What is the Divergence of a vector field?

Divergence of a vector field is a measure of the “outgoingness” of the field at that point.

If more and more field lines are sourcing out, coming out of the point then we say that there is a positive divergence. While if the field lines are sourcing in or contracting at a point then there is a negative divergence. The uniform vector field posses a zero divergence.

** Divergence formula in Cartesian **

** Divergence formula in Cylindrical **

** Divergence formula in Spherical**

## Divergence in Cylindrical Coordinates

The Divergence formula in Cartesian Coordinate System viz. the normal Divergence formula can be derived from the basic definition of the divergence.

Read: The formulas of the Divergence with an intuitive explanation!

As read from above we can easily derive the divergence formula in Cartesian which is as below.

Now let me present the same in Cylindrical coordinates.

It is quite obvious to think that why some extra terms like (1/ρ) and ρ are present in first and second terms. Where do they come from? What is the logic behind them. Because thinking intuitively, one might expect the formula similar to cartesian one.

We know, Cartesian is characterized by x, y and z while Cylindrical is defined by ρ, φ and z. So one can think of getting partial derivatives w.r.t. ρ, φ and z instead of x, y and z and A_{ρ}, A_{φ} and A_{z} instead of A_{x}, A_{y} and A_{z}. Right?

But it is not like that. The answer for this can be found in the steps of the Divergence in Cylindrical Coordinates Derivation. Actually we can reach up to the result by two approaches.

### Two Approaches for the Derivation

In the first approach, you start with the divergence formula in Cartesian then convert each of its element into the cylindrical using proper conversion formulas. The partial derivatives with respect to x, y and z are converted into the ones with respect to ρ, φ and z. The x, y and z components of the vector are equivalently written in terms of ρ, φ and z components.

In the second approach, the del operator (∇) is its self written in the Cylindrical Coordinates and dotted with vector represented in Cylindrical System.

We will go with second approach which is quite challenging with reference to first.

### Divergence in Cylindrical Coordinates Derivation

We know that the divergence of the vector field is given as

Here ∇ is the del operator and A is the vector field. If I take the del operator in cylindrical and dotted with A written in cylindrical then I would get the divergence formula in cylindrical coordinate system.

In cylindrical coordinates, any vector field is represented as follows:

The Cylindrical del operator is as follows

Read: How to convert the Del operator from Cartesian to Cylindrical?

So let’s take the dot product.

Be careful. This is not the simple dot product consisting of the multiplication of the respective components. You have to take an account of the derivative. For example let us consider the first term,

Let us put dot product outside and consider the derivative first.

Now consider the first derivative,

It is simplified using the product rule of the derivative.

Don’t assume that derivatives of the unit vectors are equal to zero or keep out of the derivation as a constant. No. Because cylindrical and spherical unit vectors are not universally constant. Though their magnitude is always 1, they can have different directions at different points of consideration. So unlike the cartesian these unit vectors are not global constants.

Read: Derivatives of the unit vectors in different coordinate systems.

As read from the above article, let us just use their results as follows:

So let us consider the complete terms together,

Now, we know that,

The highlighted terms can be rewritten for consistency as follows

Which is our required cylindrical divergence operator.

Become PRO At Electromagnetics Basics With Our **4 Ultimate Visual FREE E-Books** On *Coordinate Systems & Transformations*

## Divergence in Spherical Coordinates

As I explained while deriving the Divergence for Cylindrical Coordinates that formula for the Divergence in Cartesian Coordinates is quite easy and derived as follows:

And the same Divergence in Spherical Coordinates is as below:

As we have worried about the terms like (1/ρ) and ρ in Cylindrical Divergence, here for Spherical Divergence, it is quite obvious to think about the extra terms r^{2}, rsinθ and sinθ. Isn’t it? Where do they come from? What is the logic behind them?

One can think of getting partial derivatives w.r.t. r, φ and θ instead of x, y and z and A_{r}, A_{φ} and A_{θ} instead of A_{x}, A_{y} and A_{z}. Right?

And as we have seen for the Cylindrical Divergence Case, the answer could be found in the steps of derivations for Divergence in Spherical Coordinates. I have already explained to you that the derivation for the divergence in polar coordinates i.e. Cylindrical or Spherical can be done by two approaches.

- Starting with the Divergence formula in Cartesian and then converting each of its element into the Spherical using proper conversion formulas. The partial derivatives with respect to x, y and z would be converted into the ones with respect to r, φ and θ. The x, y and z components of the vector are equivalently written in terms of r, φ and θ components.
- The del operator (∇) is its self written in the Spherical Coordinates and dotted with vector represented in Spherical System.

For deriving Divergence in Cylindrical Coordinate System, we have utilized the second approach. Now, for deriving the Divergence in Spherical Coordinate System, let us utilize the first approach viz. we will start with the Divergence formula in Cartesian and then we’ll convert each of its element into the Spherical using proper conversion formulas.

### Divergence in Spherical Coordinates Derivation

We know that, Divergence of a vector field in Cartesian Coordinate System is,

So to convert this expression into the Spherical Coordinate System we will need 3 steps.

Firstly, the partial derivatives with respect to x, y and z would be converted into the ones with respect to r, φ and θ. Then, the x, y and z components of the vector i.e. A_{x}, A_{y} and A_{z} are equivalently written in terms of A_{r}, A_{φ} and A_{θ}. Then, finally perform the derivative operation and collect the terms to get required Divergence in Spherical Coordinates.

#### Step-1 Obtaining partial derivatives w.r.t. x, y and z in terms of r, θ and φ

For that let us apply the basic rule of the differentiation called the chain rule.

So, we will need following derivatives:

And for that let us recall the transformation between Spherical and Cartesian Coordinate System. We know the following results:

So let us calculate the required derivatives.

Note the simplification in the above step. As we are going to convert into the Spherical coordinates from the Cartesian ones, we must simplify to the extent so that to get spherical variables. Similarly,

Working on the similar lines, we can get following derivatives,

So, now we have all the required derivatives. Let us put these into the expressions before.

Similarly, we can have,

So, we have finished our first step. Let me remind you what we were doing. We wanted to convert following gradient expression from Cartesian to Spherical representation.

And for that we needed 3 steps.

- Partial derivatives with respect to x, y and z would be converted into the ones with respect to r, φ and θ.
- x, y and z components of the vector i.e. A
_{x}, A_{y}and A_{z}are equivalently written in terms of A_{r}, A_{φ}and A_{θ}. - Finally perform the derivative operation and collect the terms to get required Divergence in Spherical Coordinates.

Now, we are done with step 1. So, let’s move to step 2.

#### Step-2 Representing A_{x}, A_{y} and A_{z} in terms of A_{r}, A_{φ} and A_{θ}.

And for that let us recall the transformation between Spherical and Cartesian Coordinate System.

Read: Conversion of a Vector between Spherical and Cartesian

To get the components of the vector from the cartesian components we have following result.

Hence we have,

,

and

So, finally to get divergence in spherical coordinates, let put all the terms together.

Now it’s a mechanical work. Just take the proper derivatives, club the terms and simplify. Note that in the following steps, we will use product rule several times.

#### Step-3 Derivatives and Collecting Terms

Try to simplify by taking similar terms together and use the basic identity, or .

You will come to know, the terms with derivatives are going to vanish.

And it is simplified to,

Again simplifying the terms and utilizing, or ; we can get as follows.

But, to have simplicity in the expression, we can rewrite above expression as follows.

Note that, both the expressions are exactly same. We have rewritten the prior expression, for the sake of simplicity and uniformity in the divergence formulae in all the coordinate systems.

And, this is the expression for divergence in spherical coordinates.

Become PRO At Electromagnetics Basics With Our **4 Ultimate Visual FREE E-Books** On *Coordinate Systems & Transformations*

P.S. Do not forget to check out our Electromagnetics Courses to make your GATE preparation entire.