# What is divergence?

What is divergence? I was learning about Maxwells equations and don't understand the divergence part of it. Can someone give an intuition of what divergence is in relation to maxwells equation. To give you a sense of language to use I'm 17 and don't do maths or physics at school (I've just recently started loving the two.)

• Wow, I just looked up the Wikipedia page and there isn't a single picture to give the reader intuition. That's depressing. Oct 16 '14 at 6:36
• The word itself is quite descriptive. A common definition is the measure to which a vector function spreads out ("diverges"). If you're familiar with differentiation of scalar functions (df/dx etc.), divergence is one of the derivatives of vector functions and shouldn't be that much of a mental leap. Oct 16 '14 at 7:16
• So wrt Maxwell's electrostatic equations in differential form, the divergence of the electric field is proportional to the charge creating the field or in integral form the charge "enclosed" by a surface. Oct 16 '14 at 7:48
• The divergence of a vector field is the infinitesimal relative change in volume when transporting a volume element along its flow. The abstract definition in terms of Lie derivative and volume form is quite intuitive here. Oct 16 '14 at 10:50
• @DanielSank: Add one, don't complain. Oct 16 '14 at 13:47

Divergence is an operation that maps a vector field $\vec D(x,y,z)$ to a scalar field ${\rm div}\,\vec D(x,y,z)$. How do you calculate ${\rm div}\,\vec D(x,y,z)$?

Either you follow the definitions using derivatives, which you can't if you don't know what a derivative is.

Or you imagine the following: the vector field $\vec D(x,y,z)$ tells you about the direction where something (water) is flowing, and how quickly it is flowing. Effectively, at each point $(x,y,z)$ in space, the magnitude of the vector (recall that a vector is a number combined with the arrow remembering a direction) tells you how many liters of water flow through the surface (orthogonal to the arrow) per second.

To visualize the divergence at a given point, draw a small box (or sphere or any shape) around the point and look how many liters are getting in and getting out of the box per second. Because the vector field is slightly different on opposite sides of the box, the amount of water that gets in from the "top face" of the cube isn't quite the same as the amount that gets out from the "bottom face", and similarly for the other four faces of the cube.

This results in some imbalance – the water is really accumulating or disappearing from the cube. And the divergence ${\rm div}\, D$ is how many liters of the water are being added per second and per unit volume of the cube (the larger cube, the more). It is negative if the water is disappearing.

Water can't really get lost or appear. So maybe I should have talked about some gas which may accumulate or disappear (increasing/decreasing pressure) for a while.

In result, the divergence is positive at points where you have "sources" – the arrows of the vector field are mostly "outgoing" – and negative at points where you have "sinks" – the arrows are mostly "incoming".

The Maxwell equation for $\vec E$ or $\vec D$ tells you that the arrows of the electric field must be mostly "leaving" from the electric charges of one sign, and "arriving to" the charges of the opposite sign. The discussion above is inevitably vague and qualitative. To know what the divergence is quantitatively, you really have to learn something about derivatives etc., but it's not so hard!

• So basically, divergence is zero if there is no source or sink whatever the shape of electrostatic field lines? Apr 25 '20 at 4:28
• Yes, divergence is what matters the sink-like or source-like character of the field lines around a given point, and it is just 1 number for a point, less information than a vector field, so there are many vector fields that have the divergence equal to zero everywhere. Apr 26 '20 at 8:58

Here's a derivative-free explanation. For readers who are doing E&M at the college level, the other answers posted here are more comprehensive, but since the OP has stated a high-school knowledge with little math and physics knowledge, here's the primer:

A vector is a quantity that, in order to be fully measured and described, needs to include both a magnitude (size) and direction. In Electricity and Magnetism, many quantities such as electric field and force are vectors because not only do you need to describe the size of these measurements, but also the direction that they act in. Fields like electric fields or magnetic fields change, based on your location. If an electric field is being produced by a point charge, the strength of the field at a given location will depend on how close the charge is to that location. However, depending the direction that the field points will also change based on your location. Divergence is way of measuring how much electric field "spreads out" at a given location.

The picture above shows vectors represented as arrows. This could represent the electric field generated by a single negative charge located at the origin. You can see the way the vectors "spread out," or the angles made by the tip of nearby vectors changes as you move around the field.

As a trivial example, if all of the arrows had the same magnitude, and pointed horizontally to the right, like in the picture above, there would be no divergence because the vectors do not "spread out."

• Much easier to think in terms of field lines. Divergence occurs where field lines begin or end. Nov 21 '14 at 14:05
• The spreading out thing doesn't work either. If you had a field going normally from vacuum into glass, it would look similar to your last picture but the field would be weaker in the glass (but going in the same direction). There is a divergence of the E-field at the interface, but the E-field vectors do not spread out. Nov 21 '14 at 14:32

Taking your (lack of) knowledge about differential geometry into account, this might be too hard to follow, but here it goes anyway:

Let $u_1,\dots,u_n$ be some tangent vectors with base point $p$ and $\omega$ the volume form, ie $V = \omega_p(u_1,\dots,u_n)$ is the (possibly negative) volume of the parallelepiped spanned by these vectors.

In case of three dimensional Euclidean space, this is just the triple product $$\omega_p(u_1,u_2,u_3) = u_1\cdot(u_2\times u_3)$$

Now, let $X$ be a vector field (eg the electric or magnetic field) and $\varphi$ its flow, ie $p'(\epsilon) = \varphi^\epsilon(p)$ is the point you arrive at when moving along the field lines of $X$, starting at $p$ and with 'velocity' given by $X$ and 'time' given by $\epsilon$.

This maps the tangent vectors at $p$ to $u'_k(\epsilon) = \mathrm T\varphi^\epsilon(u_k)$ at $p'(\epsilon)$. Here, $\mathrm T\varphi^\epsilon$ is the tangent map of $\varphi^\epsilon$ (a kind of multi-dimensional derivative); in coordinates, it is given by the Jacobian matrix.

The volume of the parallelepiped will change from $V$ to $$V'(\epsilon) = \omega_{p'(\epsilon)}(u'_1(\epsilon),\dots,u'_n(\epsilon)) \equiv (\varphi^{\epsilon*}\omega)_p(u_1,\dots,u_n)$$

The divergence at $p$ is the limit $$(\mathrm{div} X)(p)= \lim_{\epsilon\to 0} \frac{(V'(\epsilon) - V)/V}{\epsilon}$$ ie the infinitesimal relative change in volume when transporting a volume element along the flow of a vector field.

The equivalent formal definition in terms of Lie derivative $\mathcal L_X$ reads $$(\mathrm{div} X)\,\omega = \mathcal L_X\omega$$

I also cobbled together an image that might or might not help get the point across:

The two maxwell equations using divergence are $$div \vec{D} = \rho \\ div \vec{B} = 0$$ at least in differential form. In integral form they are maybe more clearer for you. They are $$\iint_{\partial V} \vec{D} \ d \vec{A} = \iiint_{V} \rho \ dV = Q(V) \\ \iint_{\partial V} \vec{B} \ d \vec{A} = 0$$ The first equation just means the electrical flux $D$ through a close surface of a volume $V$ is proportionate to the electrical charge in this volume. Or in much simpler word, divergence is a mathematical measure of the density of your electrical flux so you can make conclusions of the number of electrical charges. To be a little more precise. The electrical field is something coming out of sources (positive charges) and ends in sinks (negative charges). So if you include just one source with your volume $V$ and a sink is somewhere out of your volume your divergence measures one positive charge $Q$. If your volume include two sources and a sink you will measure again just one positive charge $Q$.

The second equation is the same but with magnetic flux. You will notice the equation is always 0. This is because there are no sources or sinks in magnetic charges, so the divergence of $\vec{B}$ must always be 0.

As it looks like another question I've supplied an answer to might be duplicated here (and hence closed), I am going to provide a similar but not identical answer here.

In words - divergence is the flux of something into or out of a closed volume, per unit volume.

The best visual picture I have of this is a fluid flow. Imagine water spewing out of a tap - this has positive divergence; the tap is a source of the flow (density times velocity) of the water. Conversely you could imagine water dropping down a plug hole. The flow at the plug hole would have negative divergence because it is a sink of the water flow.

But now you want to deal with Maxwell's equations and electric and magnetic fields. You are probably familiar with the idea the electric and magnetic fields can be represented using "field line diagrams"? Here are field line diagrams for the electric field from isolated positive and negative charges respectively.

In the field line representation, regions of positive or negative divergence are places where field lines either begin or end respectively. For the positive charge, you can see that field lines originate on the charge and spread outwards. The divergence is positive at the charge. At all other points in space around the charge, the field lines are continuous and the divergence is zero. This is the slippery bit of the whole concept, because it is not when you have diverging field lines that you have a positive divergence! It is when the field lines begin. This fully agrees with what Maxwell's equations tell us - that the divergence of the electric field at a point is proportional to the charge density at that point.

The case for the negative field lines is analogous. Here though the divergence at the negative charge is negative, because the field lines are ending there. The divergence in the space around the charge is zero.

Now have a look at this plot of the field lines due to a magnetic dipole (this is a bit like the fields produced by a bar magnet or a current flowing around a loop of wire.

Notice that in this diagram, the lines of magnetic field are continuous; they have no beginning or end (the ones leaving the edge of the picture eventually join up with the ones coming back into the picture). Thus the divergence of this field is zero everywhere. Again, this is what Maxwell's equations tell us - that there are no sources or sinks of magnetic field (no magnetic monopoles) and that the divergence of the B-field is always zero.