1. Home
  2. Explore
  3. Mathematics
  4. Gauss's Divergence Theorem

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Gauss's Divergence Theorem

Transcript

Welcome back. So I'm really excited today to  tell you about Gauss's divergence theorem.   This is one of the most important results in all  of vector calculus and it is probably the primary   building block of how we derive conservation  laws from physics... from science. Conservation   of mass, momentum, and energy and translate into  partial differential equations. So I'm going to   walk you through this theorem with pictures, with  words, with math. So the idea is that we have some some volume V and we're going to say that this has  a surface S and that there is some normal vector

at every point on the surface of this volume. And  so what Gauss's theorem does is it essentially   tells us if we have some fluid flow, some vector  field -- I'm just going to draw some some vector   field going throughout all of space like this --  and my vector field I'm going to call F-arrow. So   if I have that vector field and it's carrying mass  or momentum or energy through this volume, Gauss's divergence theorem is going to allow me to compute  how much of that material is fluxing through the   surface of this closed surface, or what is the  rate of change of that material in this volume.   So it's a really useful way of doing essentially  accounting of physical quantities that we know   are conserved, like mass, momentum, and energy,  and using those to get quantitative expressions.

Now one of the things that I think is really  important is intuitively motivating why we   want Gauss's theorem. So when I learned about  this it was essentially just written down as a   mathematical fact and it was proven and I think  that's almost a crime not to tell you all of the   cool physical applications of Gauss's divergence  theorem. So I'm going to write it out in words,   give you the mathematical expression, and then  show you how we actually use this to compute partial differential equations. So this is one of  the lectures I'm most excited for because I think   this is going to be a tool set or a tool in your  arsenal that you're going to use for the rest of   your career. This is a really powerful way of  thinking about the world. I mean it has Gauss's   name in it -- if it's Gauss's divergence theorem,  it's probably the best divergence theorem. Okay

so let's get started. So I'm going to start in  words so and I'm going to write this out somewhat   slowly, and then we're going to write out the  math expression. So in words, what we're saying   is that the flux of a vector field -- and our  vector field is F -- the flux of vector field F out of a closed surface -- so let's say through  a closed surface -- and this closed surface is

S... okay the perimeter of this volume is S, and  so the flux of a vector field through this closed   surface is equal to the integral of the divergence  of that vector field throughout the entire volume.   I'm going to say this again and write it. The flux  of our vector field through the surface is equal to the integral of the divergence of our  vector field -- the divergence div(F) over the entire volume -- and I'll just  write it here over the entire enclosed

volume V. Okay so this is a bit of a mouthful  and what I'm going to do is I'm going to   walk you through what this statement means, why  it's important, and we're going to translate it   into a mathematical expression. So maybe I will  start with the mathematical expression and then   we'll go back to what these words mean. So the  flux of a vector field F through a surface, and I'm going to write this out in math, maybe I  will write it in blue, so the flux of our vector   field through this surface is going to be a  surface integral... so I'm going to integrate   over my surface S and the flux is essentially  how much of F is pointing in the normal direction   added up over every little surface element. So  if I want to compute at every point how much of F

is being kind of carried out of this volume --  what I do is I take my my F vector and I take my   normal vector n and I *dot* them together and  that tells me how much of my F component is   in a direction that will actually take me out of  this volume. So let's think for a minute... if my   F vector field was just swirling around in  this volume kind of going around in circles   and it had no component that was perpendicular  to the volume then nothing would be carried out of this volume through that vector field  -- it would just be kind of recirculating   but nothing would be leaving and that dot product  of F if it was tangent to the normal would be   zero dot product with n. And so the way we say  this is the surface integral of our vector field F

dotted with the normal integrated over over  that volume, over every little area element   on the perimeter of this, so this is the flux  of the vector field F... this is literally the   definition of what I mean by the flux: this is  how much stuff is being carried out of the volume.   It's this: we compute how much of F is pointing  in the normal direction using the dot product,   and we integrate that up over the entire surface.  And that's how much stuff is leaving the volume... this is basic accounting... this is the only way  stuff can leave the volume. Unless we believe   that stuff can be created or destroyed inside  the volume. Okay, so if our quantity like mass,   momentum, or energy can't be created or destroyed  and it's conserved then this is a basic accounting   of how much stuff leaves through that  surface s and so we call this the flux

through s the flux through s and this is  like a definition of the flux and what   Gauss's divergence theorem says that this flux...  this might actually be kind of a pain to compute   maybe I don't want to do the surface integral  what this is equal to is a volume integral   so we'll do a triple volume integral over the  entire volume of the divergence of F of div dot F dv ... and this is extremely useful.  What this says is that these two quantities   are completely equivalent ways of computing the  flux through some volume and this is for an   arbitrary volume, it doesn't matter what size V  is... it could be a skinny little rod it could be   a sphere it could be a little hockey puck  shaped thing it doesn't matter what this volume is   this is always true as long as F is a continuous  vector field, if it doesn't have sharp abrupt

changes or shock waves then this is going to  be true... this is Gauss's divergence theorem.   And this is really important, so I'm  actually going to box this off. This is super important, this is Gauss's divergence theorem We'll put some stars next to it just so that we remember that  this is really really important.   Okay so I'm going to restate why this is true.  I'm going to show you some intuition of why this expression should equal this expression and  then we're going to use this to actually compute   some real conservation laws and translate  those into partial differential equations.   Things like the mass continuity  equation or the Navier-Stokes equation.   So why do we think that this volume  integral of the divergence of F should equal the   amount of stuff being carried out of F. So  I'm going to draw another little picture here... I'm going to try my best to  duplicate this so that we can play around.

So that's roughly my volume and what  we're going to do, is we're going to chop   this up into a number of little boxes...  so I'm going to chop this up into some boxes   and I'm not a fantastic artist, so  we're just going to use a few boxes here   and what we're going to do is look at the  divergence in each of these boxes. So in your imagination, imagine that this is a really fine  graph paper with millions or trillions of boxes and you could take the limit as all of  those boxes become infinitesimally small that's what we're going to do, and we're going to look at  the divergence at every little grid box in this graph paper representation, so at every little point here, what I'm going   to do is I'm going to draw a representation of  the divergence, and what we're going to have   is that maybe I have some positive  divergence here and some positive divergence here

let's say my flow is kind of expanding  and some positive divergence, okay I'm just going   to draw this. I'm not going to draw any of these  negative because it's a little harder to visualize   and I've got this guy here. Now the idea is, and this is again requiring that my vector field F is continuous to do the divergence theorem... to kind of take this limit as all of these grid cells become infinitesimally small and the argument I'm about to to give you is the following... and I really  like this picture it just looks super cool   so these pink sources, the way I'm drawing  them here, these are the divergence fields locally   that are induced by this this flow F so  this F might be doing something complicated   you know there's some complicated  physics, Navier Stokes fluid flow, whatever   and this is the local divergence at every little point. Now what we observe is that if I really do

assume that this this vector field is continuous  and I make this grid infinitesimally fine   then these neighboring boxes, the positive  upward component of this flux and the negative   downward component of this flux should cancel each  other out, because if i make my boxes small enough   the flow is basically identical in neighboring  boxes and so the upward component of this pushing   on the downward component of this cancel out. So you actually get this kind of cancellation of all of the inner boxes every box that shares a wall... those two neighboring forces are going to   cancel each other out and the only  thing that you're going to be left with is   this perimeter of all of the  divergences that don't have a neighboring   grid cell, so all of these these little  boxes that are pointing out this is the only   thing that's left when I integrate over this  volume. Okay so i'm going to say this again

when i integrate all of my divergences over this  volume when i integrate all of my divergence on   this volume all of the inner grid cells kind of  cancel each other out because of the continuity of   f because f is a continuous vector field and i'm  making these these boxes infinitesimally small the   you know the right vector and the left vector  on neighboring grid cells cancel each other out   and the up vector and the down vector on  neighboring grid cells cancel each other out and so we only have this thin perimeter right  on the surface of our volume that don't have uh   divergence vectors that are being cancelled  out and you'll notice that if i integrate   these along that looks a heck of a lot like my  flux through through the volume so this is a   very cartoony sketch of why gauss's divergence  theorem is true it's because i can take i can   integrate this flow kind of dotted with the normal  along the surface or i can compute its divergence

everywhere throughout the volume and just add up  all of those divergences the ones in the middle   will cancel each other out and it will leave kind  of something that's equivalent to this integral on   the perimeter so that's a really useful in my mind  kind of cartoon of why this is why this is true   okay so let's uh the way i talk about this  uh when i'm teaching this in class this is   essentially just accounting this is uh you know  being counting of some quantity being flown through a vector field and so as long as you can  count things you know this these arguments have   to be true the stuff coming into a volume has to  equal the stuff coming out of a volume unless you   have sources you know that are kind of creating  things or destroying things inside the volume

okay good and there's a lot of ways you can  compute with this so for example if i want   to compute the volume of an irregular shape i  can create a vector field that has divergence   divergence 1 and i can integrate that  vector field all along the perimeter   of my volume i'm going to say that again if i  want to compute the volume of an irregular object all i have to do is create a vector field that has  divergence one and then i integrate that vector   field along the perimeter or along the surface  of my volume dotted in the normal direction   that will equal the volume of that object so  that's kind of a neat application of gauss's   theorem but that's a little esoteric what i really  really really want to show you is how we can use   this to derive partial differential equations  so let me just say gauss's divergence theorem

for pdes for partial differential equations  and this is really exciting okay so   all of our modern physics all of uh kind of  you know the textbook equations that you're   you're used to seeing the navy or stokes equations  you know maxwell's equations almost all of our   physical laws boil down to a conservation of some  quantity in some volume using gauss's theorem to   derive a partial differential equation so it's an  extremely extremely powerful way of mathematically quantifying uh physics and that's what i'm going  to show you right now so we're going to look at   gauss's theorem for the conservation of mass in a  volume okay so we're going to specifically look at

mass conservation mass conservation uh in a volume and  we're basically assuming that we have some   fluid flow you know uh maybe we're in the gulf  of mexico maybe this is the flow in the ocean   and maybe i have some oil spill at some point in  the in the gulf of mexico maybe that's what this   this uh this volume is or maybe there's some some  spill here and we know that that is a conserved   quantity there's not you know more or less um  you know at least in the short term as it flows through and so we want to somehow quantify  this conservation uh of mass in our volume so here's what we're going to do we're going to  say that our total mass let me see i want to write   that here so our total mass in the volume equals  the triple integral over v of the density rho

dv okay so i'll just say rho is the density so the density of whatever my  fluid is if i integrate that whole   you know that density over the entire  volume i will get the mass in that volume and so the rate of change of that mass and the  volume is equal to how much of that flow that   mass is being fluxed out of that volume  through this surface integral so that's   what i want to write down this is the the basic  conservation i want to write down so the so d dt

of this integral which is rho dv integrated over  the volume this is the total this is the rate of   change of mass in my volume so maybe mass is being  carried out of my volume maybe mass is coming into   my volume and it's happening because this vector  field this fluid flow is either carrying mass   in or carrying mass out and so this rate of  change equals the only way that that mass can   enter or leave this volume is through it  being carried out through the boundary by this flow f so this would equal  minus the integral through the surface

of my you know my mass that's being carried  out through the normal direction d s and i   have this minus sign because essentially if  i have a positive flow carrying mass out of   my volume if this f dot n is a positive thing  carrying flow out then that is a negative rate   of change of mass inside the volume so the rate of  change of mass inside the volume is equal to minus   how much of it is leaving the volume and again  this is the only way mass can leave the volume is that if it's carried out through this  flow kind of normal to uh to that volume   okay so this is this is the basic setup this is  again just a counting this is just counting the   mass in my volume here and counting how much  mass enters and leaves my volume here good

but what we want these are are this is a triple  integral and this is a double integral and what   we want is to somehow you know write these in  the same triple integral formulation so i want to   convert this into a triple volume integral and i'm  going to use gauss's divergence theorem to do that   so we're going to turn this into a triple  integral by using gauss's divergence theorem and the way we do it is as  follows so we're going to say this quantity here is equal to minus the  triple volume integral of the divergence   of this quantity right so the the surface  integral of some flux dotted with a normal   is equal to the volume integral of the divergence  of that vector field so this is divergence of rho

f dv and remember rho my density is just  a scalar it's just a number at every point   in space and f is a vector field it's my  flow that's carrying this mass in and out so now i have an apples to apples uh kind of  comparison before it was apples and oranges i had   a volume integral and a flux surface integral now  i have a volume integral for the rate of change   in time of my mass equal to this kind of spatial  divergence of rho times my vector field f and so   what's really neat about this is that i can move  this over to the left hand side and now i can put   everything under the same triple volume integral  and i'm going to move my ddt inside of here okay and and this is really going to be a partial  of rho rho is a function uh let me write this down

so my density uh rho is a function of space let's  say x y z but also of time okay this density   might be changing i might have a compressible  fluid you know if i'm flying a jet the air is   compressing and the density is changing as that  wing or the nose or whatever is hitting the air   okay so sometimes this can change in space  and time it can vary and so what i'm going   to eventually get when i bring this all under the  integral is that i have a triple volume integral of uh partial rho partial t the partial  derivative of rho with respect to time

now this minus when i bring it over  becomes a plus plus the divergence of rho   times my fluid velocity field all of this dv  equals zero so this is pretty special okay   this uh equation here essentially accounts  for all of the change of mass due to uh like   the mass changing in time things fluxing through  the surface and things like that and when you add   that all up it has to equal zero this  is a statement of conservation of mass now here is one of my favorite parts of this whole  story of how you use gauss's divergence theorem   to derive partial differential equations is  that this is true this is true for all volumes

for all volumes v this is true if i had a big  volume v a stretched out volume v it's also true   if i take my v and i take the limit as it becomes  a teeny tiny tiny little delta v this is true   at every little patch uh in space if i shrink my  volume down to that little patch in space this is   still true and the only way that this integral can  equal zero for all volumes is if the thing inside of it equals zero everywhere and so this is how  we derive our partial differential equation this   thing inside has to be equal to zero for this  volume integral to equal zero on all volumes   and so then we finally get partial rho partial  t plus the divergence of rho times my vector   field f equals zero and this is called the  mass continuity equation mass continuity

continuity equation and it's one of the  fundamental equations in fluid mechanics this is   the equation that quantifies conservation of mass  in a flowing fluid in the air when i'm speaking   you know air is moving but it's still the mass is  conserved this room mass is not being created or   destroyed and so this equation is true everywhere  in in space and in time okay even if i have a jet   moving through even if it's a compressible fluid  flow this is still true um it is only not true

when uh when my vector field f is sufficiently or  my density rho is sufficiently non-continuous if   it has a really sharp step change in space or in  time then this these derivatives don't actually   make sense they would go to infinity and i can  only represent kind of the integral effect in   a control volume that's large enough to include  that discontinuity okay so what i'm going to do   i'm going to take a step back and summarize and i  think in the next video i'm probably going to dig

a little bit deeper into this mass conservation  equation and show you what happens for example if   i have an incompressible flow if my density is a  constant then we can get specific kind of we can   derive specific quantities that have to be true  for this fluid flow f okay but let's talk about   the whole pipeline here if i have physics physics  is generally written in terms of conservation laws   we have conservation of mass conservation of  momentum conservation of energy newton's second law is essentially a statement of conservation  of mass uh sorry conservation of momentum okay you know the rate of change of momentum is  equal to the forces applied to the system

we can encode those conservation laws through  integral equations like this we literally count   how much stuff we have in a volume and how much it  changes in time and we say that the only way that   that can that the amount of stuff in that volume  can change that mass or momentum or energy is if   it enters or leaves through the surface of that  volume so i have a volume integral for the rate of change of stuff equals a surface integral for how  much stuff enters or leaves through the boundary   and gauss's theorem what gauss's theorem allows us  to do is turn that surface integral into a volume   integral so now i can kind of use apples to apples  i can i can add up everything under one common   integral and i now have this partial derivative  expression that has to equal zero everywhere over

all volumes and again if f and if the quantity i'm  adding up if my mass and my momentum or my energy   and my fluid flow are continuous smoothly varying  in space and time then this is true for all   volumes and i can get rid of the volume integral  and i get my partial differential equation so this   is how most of the pdes that you're used to from  classical physics are derived is by writing down a conservation law and then using gauss's theorem  to kind of simplify um that that conservation law   into a single expression under a common volume  integral okay now again that's this relies on some   continuity that's why it's called the continuity  equation because this relies on you know rho and   f being continuously varying they can't be  really really sharp shock waves in the system   so if there's shock waves in the system other  interesting things will happen and i'll show you

that in a little bit okay awesome thank you and  stay tuned for for kind of the next video on this

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent