# Divergence Recall the idea of a [vector field](Vector-Fields.md). Consider the vector field below and think of it as representing a fluid flow. ![](Screen%20Shot%202021-05-06%20at%208.48.22%20AM.png) ### Sources and Sinks Notice that the fluid seems to behave in a very strange, non physical way. Around some points the fluid seems to simply spring into existence from nothingness (as if there is some kind of **source** there): ![](Screen%20Shot%202021-05-06%20at%208.49.03%20AM.png) And around others it appears to disappear into nothingness (as if there is a **sink** there): ![](Screen%20Shot%202021-05-06%20at%208.49.51%20AM.png) ### Divergence The **divergence** of a vector field at a particular point in the plane tells you how much this imagined fluid tends to flow *out of* or *into* small regions of near it: ![](Screen%20Shot%202021-05-06%20at%208.51.18%20AM.png) So, the divergence of our vector field at all points that act like sources will give a positive number. On the other hand, points that act like sinks would be negative. Also, we would have a positive divergence if the flow that was coming into it from one side was slower than it exiting! ![](Screen%20Shot%202021-05-06%20at%208.52.27%20AM.png) Remember, this vector field is really a function that takes in two dimensional inputs and spits out two dimensional outputs: ![](Screen%20Shot%202021-05-06%20at%208.55.58%20AM.png) The divergence of that vector field *gives us a new function*! One that takes in a single 2-d point as its input, but its output depends on the behavior of the field in a small neighborhood around that point: ![](Screen%20Shot%202021-05-06%20at%208.57.06%20AM.png) In this way it analgous to a *derivative*. That output is just a single number: how much does that point act as a source or sink. ### Notation We often write divergence as the dot product between a particular operator (the vector derivative, i.e. [the gradient](https://en.wikipedia.org/wiki/Gradient#)), $\nabla$, and our field $F$: ![](Screen%20Shot%202021-05-07%20at%207.31.37%20AM.png) ![](Screen%20Shot%202021-05-07%20at%207.33.34%20AM.png) ![](Screen%20Shot%202021-05-07%20at%208.04.02%20AM.png) Watch [here](https://youtu.be/rB83DpBJQsE?t=653) for more details. ### Computation/Mechanics These 3 videos do a good job of explaining the computation of divergence: * [Divergence formula part 1](https://www.youtube.com/watch?v=uOX7SijjH9w&list=PLSQl0a2vh4HC5feHa6Rc5c0wbRTx56nF7&index=51) * [Divergence formula, pt 2](https://www.youtube.com/watch?v=TKlpZ0UUJTQ&list=PLSQl0a2vh4HC5feHa6Rc5c0wbRTx56nF7&index=52) We can roughly summarize as: > A positive divergence corresponds to a positive partial derivative. ![](Screen%20Shot%202021-05-12%20at%209.16.21%20AM.png) ![](Screen%20Shot%202021-05-12%20at%209.20.41%20AM.png) #### Example ![](Screen%20Shot%202021-05-12%20at%209.24.38%20AM.png) ![](Screen%20Shot%202021-05-12%20at%209.28.21%20AM.png) --- Links to: [Curl](Curl.md) [Laplacian](Laplacian.md) References: * [Divergence and Curl - 3b1b](https://www.youtube.com/watch?v=rB83DpBJQsE&t=286s) * [Divergence intuition 1, 3b1b khan](https://www.youtube.com/watch?v=c0MR-vWiUPU) * [Divergence intuition 2, 3b1b khan](https://www.youtube.com/watch?v=Yeie-aJT2eU) * [Divergence formula, pt 1](https://www.youtube.com/watch?v=uOX7SijjH9w&list=PLSQl0a2vh4HC5feHa6Rc5c0wbRTx56nF7&index=51) * [Divergence formula, pt 2](https://www.youtube.com/watch?v=TKlpZ0UUJTQ&list=PLSQl0a2vh4HC5feHa6Rc5c0wbRTx56nF7&index=52) * [Divergence computation, 3b1b khan](https://www.youtube.com/watch?v=AlXVrAOls-8) * [Whiteboard notes 1, why divergence only depends on partials](https://photos.google.com/photo/AF1QipMNn2e-b-SanN6eOLuU-m-VH8a-KgjYkClNoUxf) * [Why divergence only depends on partials]](https://sites.google.com/site/butwhymath/calculus/divergence)