Vector Calculus: Understanding Divergence

Get the Math, Better Explained eBook and turn Huh? to Aha!

Physical Intuition

Divergence (div) is “flux density”—the amount of flux entering or leaving a point. Think of it as the rate of flux expansion (positive divergence) or flux contraction (negative divergence). If you measure flux in bananas (and c’mon, who doesn’t?), a positive divergence means your location is a source of bananas. You’ve hit the Donkey Kong jackpot.

Remember that by convention, flux is positive when it leaves a closed surface. Imagine you were your normal self, and could talk to points inside a vector field, asking what they saw:

  • If the point saw flux entering, he’d scream that everything was closing in on him. This is a negative divergence, and the point is capturing flux, like water going down a sink.
  • If the point saw flux leaving, he’d sniff his armpits and say all flux was existing. This is a positive divergence, and the point is a source of flux, like a hose.

So, divergence is just the net flux per unit volume, or “flux density”, just like regular density is mass per unit volume (of course, we don’t know about “negative” density). Imagine a tiny cube—flux can be coming in on some sides, leaving on others, and we combine all effects to figure out if the total flux is entering or leaving.

The bigger the flux density (positive or negative), the stronger the flux source or sink. A div of zero means there’s no net flux change in side the region. In plain english:

\displaystyle{\mathit{ Divergence = \frac{Flux}{Volume} }}

Math Intuition

Now that we have an intuitive explanation, how do we turn that sucker into an equation? The usual calculus way: take a tiny unit of volume and measure the flux going through it. We need to add up the total flux passing through the x, y and z dimensions.

Imagine a cube at the point we want to measure, with sides of length dx, dy and dz. To get the net flux, we see how much the X component of flux changes in the X direction, add that to the Y component’s change in the Y direction, and the Z component’s change in the Z direction. If there are no changes, then we’ll get 0 + 0 + 0, which means no net flux.

If there is some change in the field, we get something like 1 -2 +5 (flux increases in X and Z direction, decreases in Y) which gives us the divergence at that point.

In pseudo-math:

Total flux change = (field change in X direction) + (field change in Y direction) + (field change in Z direction)

Or in more formal math:

\displaystyle{Divergence = \lim_{Vol \to 0}\frac{Flux}{Vol}}

\displaystyle{Divergence = \frac{\partial F_1}{\partial x}
+\frac{\partial F_2}{\partial y}
+\frac{\partial F_3}{\partial z}}

Assuming F1 is the field in the X direction, F2 in the Y and F3 in the Z.

A few remarks:

  • The symbol for divergence is the upside down triangle for gradient (called del) with a dot [\displaystyle{\triangledown \cdot}]. The gradient gives us the partial derivatives (dx, dy, dz), and the dot product adds them together (xdx + ydy + z*dz).
  • Divergence is a single number, like density.
  • Divergence and flux are closely related – if a volume encloses a positive divergence (a source of flux), it will have positive flux.
  • “Diverge” means to move away from, which may help you remember that divergence is the rate of flux expansion (positive div) or contraction (negative div).

Divergence isn’t too bad once you get an intuitive understanding of flux. It’s really useful in understanding in theorems like Gauss’ Law.

Other Posts In This Series

  1. Vector Calculus: Understanding Flux
  2. Vector Calculus: Understanding Divergence
  3. Vector Calculus: Understanding Circulation and Curl
  4. Vector Calculus: Understanding the Gradient
  5. Understanding Pythagorean Distance and the Gradient
  6. Vector Calculus: Understanding the Dot Product
Kalid Azad loves sharing Aha! moments. BetterExplained is dedicated to learning with intuition, not memorization, and is honored to serve 250k readers monthly.

Enjoy this article? Try the site guide or join the newsletter:
Math, Better Explained is a highly-regarded Amazon bestseller. This 12-part book explains math essentials in a friendly, intuitive manner.

"If 6 stars were an option I'd give 6 stars." -- read more reviews

43 Comments

  1. i came across a piece of info saying that the equation of conitinuity comes from divergence theorem(i will give the statement here:”for any arbitrary region of volume v coverd by surface area s,the flux of the current density over the surface s is equal to the rate at which mass / charge leaves the volume v”)
    is there a derivation for this…? ..or could anyone tell me an intuitve approach..where i can atleast visualise what is happening?

  2. Hi kirtika, I’d have to see some more on this, but I think in this context “flux of current density” means “change in current density”.

    This statement may be saying the amount of current you see passing through a surface depends on the amount of charge leaving the region (a moving charge can induce a magnetic current for example). This is a bit tough to visualize, but as the charge moves the flux through the surface will change — imagine a firehose (constantly spitting out water) moving through an invisible sphere. As the hose goes along, the amount of water passing through will change.

  3. Hiy’all!

    I wish to tell you a story.

    As a young kid and in the high school I had few to no problems with math; it was easy to understand and the examples in the maths books were quite intuitive and visual.

    What a shock it was to attend the first math courses in the university. I don’t know about the ones for math majors, but at least the math course materials for us engineering students were conjured from some fiery bowels of hell.

    With no clarifying pictures and even less explanations (“divergence measures the change of vector function in its direction and the spreading of the direction. Now do the exam.” is pretty much all we get), the typical brute-force technique among tech students here is to memorize the ten or so calculations that the exam questions are picked from each year and vomit them on the test paper. Formula after formula. Equation, equation, equation.

    Somebody just forgot to tell what the hell these formulas do and what they are used for anyway.

    All this bitter rambling is here for a reason… I really wish to thank you for your explanations! This is the first time that instead of memorizing some stupid upside down triangles and strange-looking d’s with no comprehension of them whatsoever I really do understand, what the hell a “curl” actually is.

    I am going to recommend your site to every tech and math student I know. Something like this is really missing from the teaching of mathematics and I don’t know whether the professors are too jaded, indifferent or too alienized from the real world to notice this.

    In case you haven’t noticed, there are some neat animations of divergence and curl in
    http://www.math.umn.edu/~nykamp/m2374/readings/divcurl
    also.

    Once again… A big great thanks to you, Kalid! Keep up the good work!

  4. Hi Jaakko, thanks for the comment — it’s something I would have written a few years ago! I had the same exact problem with regurgitating formulas in engineering classes, which motivated me to create this site. It really bothers me to know how without knowing “why” :).

    Thanks for that link, the animations look really cool! Visualizing these concepts makes them so much clearer.

    Again, appreciate the comment!

  5. hi nice post indeed. it clarified a lot of stuff regarding divergence. but tell me one small thing.
    Is it possible when i consider an infinitesimal small volume from the actual volume, and the divergence might be flowing out in the infinitesimal volume but in the overall volume the divergence might be flowing in towards the volume?

  6. Hi and also it would be extremely good if you can also tell something similar about the Tensors as well.

  7. i whould like someone to explane me curl what is mean in simple or what is mean in fluid flow
    simple example with a culculation number,iam intersted in but i need help ,regardes basheer

  8. Thank you thank you thank you!!

    I never thought understanding the divergence was this easy. I knew that it measured the amount of flux entering or leaving, but

    Total flux change = (field change in X direction) + (field change in Y direction) + (field change in Z direction)

    really hit the spot! I even understand that enigmatic equation now! I really can’t believe why nobody teaches these things. (I always assumed that these were so intricate concepts that us lesser mortals with small brains couldn’t understand them)

    Keep going mate. You are the man.

  9. @This: Thanks, really glad it helped! That equation made things click for me too. I’ve come to realize that the vast majority of math ideas are all within our grasp if presented in the right light :).

  10. Very nice site. If I understand you correcly you mean that the div is the flux density.

    You state: “So, divergence is just the net flux per unit volume, or “flux density”, just like regular density is mass per unit volume (of course, we don’t know about “negative” density).

    The bigger the flux density (positive or negative), the stronger the flux source or sink. A div of zero means there’s no net flux change in side the region. In plain english:

    Divergence = Flux / Volume”

    In terms of magnetic fields, does this mean that if the magnetic flux density is zero the change in magnetic flux is zero inside a volume?

    In case the magnetic flux is larger than zero, does this mean that the change in magnetic flux inside a volume is finite (that there is a change of magnetic flux inside that volume). In case where does that change in magnetic flux come from?

  11. I have read in the litterature that the flux density inside a transformer core material does change caused by VOLTAGE changes over time, NOT from the magnitude of current: I don’t understand why. How can voltage changes cause the field lines to change direction inside the magnetic material (or is that wrongly understood). Can someone explain magnetic flux density and possibly relate it to flux density as it is explained here.

  12. Hi again. Sorry to “spam you”. Over at http://www.math.umn.edu/~nykamp/m2374/readings/divsubtle/ they mention that “Divergence measures expansion or compression of a vector field. We ended that section with the example where we immersed a sphere into a vector field that had positive divergence everyone. No matter where one moves the sphere (with the sliders), more fluid flows out of the sphere than into the sphere, indicating the fluid is expanding.”

    Let us say that instead of fluid, we talk about magnetic flux. Does that mean that with a positive magnetic flux density (divergence), the flux lines are expanding. Does that mean that the magnetic field is changing in strength.

    How can a magnetic field that changes in strength induce a voltage in a wire running thru the magnetic field?

  13. rosetta stone spanish with its language learning assistant tools and bold guarantee is a very unique program which teaches you all kinds of rosetta stone language and skills. First, it leads you to an area rosetta stone on sale where you may get to know the cheap rosetta stone vocabulary and commonly-used structures so that you may capture the confidence to proceed. After this primary period, it will tell you some how to know your rosetta stone online as well as how to involve yourself in really daily life.

  14. You suggest intuition:

    “Remember that by convention, flux is positive when it leaves a closed surface. Imagine you were your normal self, and could talk to points inside a vector field, asking what they saw:

    * If the point saw flux entering, he’d scream that everything was closing in on him. This is a negative divergence, and the point is capturing flux, like water going down a sink.
    * If the point saw flux leaving, he’d sniff his armpits and say all flux was existing. This is a positive divergence, and the point is a source of flux, like a hose.”

    And it seems to be wrong. It suggests that when there is a closed surface, and the vector field that “crosses” the surface, then there will be places (points), where divergence is negative (flux entering) and other places where divergence is positive (flux entering).

    Now take a look at this pages:
    http://www.math.umn.edu/~nykamp/m2374/readings/divcurl/ (where an example with sphere is introduced), and
    http://www.math.umn.edu/~nykamp/m2374/readings/divsubtle/ (where it is further explained).
    It shows the simple case, where divergence is positive everywhere in the domain – outside, inside, and on the boundary of the surface.
    This also holds, when sphere is moved away from origin so flux is entering the sphere in some places, not only leaving (as is the case when sphere is centered at origin).

    Long story short, as far as I understand all of this, this contradicts your intuition that whenever flux is entering the the closed surface, divergence is negative.

  15. @mihu: Awesome comment, thanks for the pointer. I had to take a look at those links, I think the intuition still holds but I should phrase it differently.

    A “point” in this case is really a tiny cube, and flux is coming in or leaving in the x, y and z directions. It’s possible that two sides are positive and the third is negative so the results cancel (or one side overpowers the other).

    That’s essentially what’s happening with the sphere in the tricky case… there is more flux (by surface area) leaving, but the strength of the field is less. This perfectly balances the incoming (fewer but stronger) flux lines.

    So, a better phrasing may be “The point looks in all directions: x, y, and z. Is more flux entering or leaving overall?”.

  16. This is really great. I’ve been going through a lot of books on divergence and curl and this is by far the clearest explanation.

  17. Hi Kalid.. Honestly, I was very much impressed by your explanation. My question is , Does gradient always acts on Scalar quantities and Divergence on Vector quantities. It would be grateful if you can explain the divergence of a gradient. I know we get a Laplace Operator , but can i have a physical explanation? ( If Possible)

  18. Excellent Resource. I am an engineering physics major who would certainly recommend this site to any of my colleagues. I Read the articles on gradient vector, flux and divergence and consequently gained a much more thorough understanding. The authors should write a textbook if they haven’t already. Plain language explanations with practical examples are crucial to the understanding of this material. Write a textbook and market it to the professors. It would sure beat out all of the piece of shit books that I’ve been forced to use thus far. Thank you.

  19. @Drew: Thanks for the note – gradients, flux, and divergence really bothered me in school also. I have a general purpose book but would like to make one on vector calculus eventually — really appreciate the encouragement!

  20. Hi Kalid, it’s a great fortune for me to come across your website :)
    I feel so lucky that i click it by accident! :) It’s an awesome place where a lot of my math doubts are cleared! THANKS A LOT. Keep it up with your good work and we will all gain benefits from it! I’m sharing it with my friends who are struggling with college math too!

    A chinese word for you, JIA YOU! :)

  21. hey can you tell me where divergence of vectore field is bieng used please. reply asap. email:qasim_mnawaz@yahoo.com

  22. Liked the physical intuition too. I guess math prof are very much in love with abstraction. Perhaps for pure maths majors, it is ok. Cos it gets much worse, sometimes there maybe no easy physical analogies, just a set of laws or axioms and rules to follow and then investigation. But for most of us in engineering, we would love to know why? Why is it relevant? Analogies are important.

  23. Thanks for your fantastic articles on flux and curl and now divergence. I have two calculus textbooks neither of which was particularly clear on the intuition of these topics. At least not to someone who hasn’t done a certain amount of practice on the breadth of the material (I’m reading the textbook so I can understand a few formulas I’m working with). Your descriptions were very clear and helpful!

  24. Good work..! i have few doubts…

    * why the divergence is explained with respect to unit volume basis…. and even particularly why as volume decreases to zero?

    * How flux is more when the volume is less?

    Thnak u in advance.

  25. “i Like it.
    But could not understand the perfect defination of the divergence which is
    ” Divergence is a vector operator which measures the magnituade of a vector field’s source or sink, at a given point, in terms of a signedl scalar.”

  26. “…the amount of flux entering or leaving a point.” How big is the point?
    You wrote “Divergence = Flux / Volume” then gave a similar equation with a limit as volume approaches 0. So what’s the limit for? Thanx

  27. Hi Simon, great question. Basically, limits are used to find a reasonable estimate for an “impossible” situation, such as the amount of flux at a point. (Technically, points don’t have any size, right?)

    This is similar to finding the density at an x,y,z coordinate in space. We figure out how much mass is in a volume surrounding that spot (a little cube?), and let it shrink. Hopefully, the limit as we shrink the volume converges into a meaningful result. There’s some more on limits here: http://betterexplained.com/articles/an-intuitive-introduction-to-limits/

  28. I think in the general math definition of a point a point is 0D. I think you should make sure readers know what you mean by a point. By a point I think you mean an infinitely small volume. If a volume is not infinitely small couldn’t you find the divergence of the volume? If so the limit isn’t really needed. I like the site a lot by the way, simplicity is great, thank you for replying too. @ made easy: you wrote: “How flux is more when the volume is less?” I don’t see where it says that. I think it’s kind of like finding density, Say if you found the density of a volume of water, if I found the density of a smaller volume of water it would be the same as the bigger one. Is that correct anyone?

  29. Why can’t the teachers explain stuff like this. The gradient and divergence could never be so clear! Thank you. In college it looks like rocket science. xD So simple it is! Thank You. =)

  30. Great stuff, big fan of the site, although I only recently discovered it!

    I was wondering whether you plan to cover some intuition regarding the Laplacian operator \displaystyle{ \Delta } and its connection to divergence/gradient (as it is, of course, the divergence of the gradient). I’ve worked through some derivations that show that it can be thought of as a local averaging operator in the sense that the Laplacian of a function \displaystyle{ f } at a point \displaystyle{ p } is proportional to the average value of \displaystyle{ f(x) - f(p) } on the surface of spheres of radius \displaystyle{ r \rightarrow 0^{+} } centered at \displaystyle{ p }, but it isn’t totally clear what the connection is between this construct and divergence/gradient. It is, however, a really useful way of looking at the heat equation: \displaystyle{ \frac{\partial u}{\partial t} = \Delta u } simply means that the rate of change in time of heat is governed by its average rate of change in space. That is, there is more heat exchange in regions of highly variable temperature than regions with smoothly varying temperature. The ‘averaging’ interpretation also works nicely for understanding harmonic functions (those that have zero Laplacian).

  31. consider f(x)=xi+yj,when u take divergence of this function the value is 2
    now a positive value shows the flux is moving away.i would like to now how do we graphically account for this value of 2 when we draw a plot of the function.

  32. assalamu alaikum brother

    great job indeed.the point source is similar to a tiny cube it hits the point.
    hope some more article especially on vector calculus concepts like line/volume/surface integral
    cross /dot product
    vector field
    “”another question burns my neurons for several years since I first met vector addition.
    the concept /intuition of triangle law.
    it contradics geometry though direction matters.but how direction parameter change that sum of two sides of traingle greater than the rest one.

Your feedback is welcome -- leave a reply!

Your email address will not be published.

LaTeX: $$e=mc^2$$