today you and I are gonna get into
divergence and curl to make sure we're
all on the same page let's begin by
talking about vector fields essentially
a vector field is what you get if you
associate each point in space with a
vector some magnitude and direction
maybe those vectors represent the
velocities of particles of fluid at each
point in space or maybe they represent
the force of gravity at many different
points in space or maybe a magnetic
field strength quick note on drawing
these often if you were to draw the
vectors to scale the longer ones end up
just cluttering up the whole thing so
it's common to basically lie a little
and artificially shorten ones that are
too long maybe using color to give some
vague sense of length now in principle
vector fields and physics might change
over time in almost all real world fluid
flow the velocities of particles in a
given region of space will change over
time in response to the surrounding
context wind is not a constant it comes
in gusts an electric field changes as
the charged particles characterizing it
move around but here we'll just be
looking at static vector fields which
maybe you think of as describing a
steady state system also while such
vectors could in principle be
three-dimensional or even higher we're
just going to be looking at two
dimensions an important idea which
regularly goes unsaid is that you can
often understand a vector field which
represents one physical phenomenon
better by imagining what if it
represented a different physical
phenomenon what if these vectors
describing gravitational force instead
defined a fluid flow what would that
flow look like and what can the
properties of that float tell us about
the original gravitational force and
what if the vectors defining a fluid
flow were thought of as describing the
downhill direction of a certain hill
does such a hill even exist and if so
what does it tell us about the original
flow these sorts of questions can be
surprisingly helpful for example the
ideas of divergence and curl are
particularly viscerally understood when
the vector field is thought of as
representing fluid flow even if the
field you're looking at is really meant
to describe something else like an
electric field
here take a look at this vector field
and think of each vector as describing
the velocity of a fluid at that point
notice that when you do this that fluid
behaves in a very strange non-physical
way around some points like these ones
the fluid seems to just spring into
existence from nothingness as if there's
some kind of source there some other
points act more like sinks where the
fluid seems to disappear into
nothingness the divergence of a vector
field at a particular point of the plane
tells you how much this imagined fluid
tends to flow out of or into small
regions near it
for example the divergence of our vector
field evaluated at all of those points
that act like sources will give a
positive number and it doesn't just have
to be that all of the fluid is flowing
away from that point the divergence
would also be positive if it was just
that the fluid coming into it from one
direction was slower than the flow
coming out of it in another direction
since that would still insinuate a
certain spontaneous generation now on
the flip side if in a small region
around a point there seems to be more
fluid flowing into it than out of it the
divergence at that point would be a
negative number remember this vector
field is really a function that takes in
two dimensional inputs and spits out two
dimensional outputs the divergence of
that vector field gives you a new
function one that takes in a single 2d
point as its input but its output
depends on the behavior of the field in
a small neighborhood around that point
in this way it's analogous to a
derivative and that output is just a
single number
measuring how much that point acts as a
source or a sink and purposely delaying
discussion of computations here the
understanding for what it represents is
more important notice this means that
for an actual physical fluid like water
rather than some imagined one used to
illustrate an arbitrary vector field
then if that fluid is incompressible the
velocity vector field must have a
divergence of zero of
where that's an important constraint on
what kinds of vector fields could solve
real-world fluid flow problems for the
curl at a given point you also think
about the fluid flow around it but this
time you asked how much that fluid tends
to rotate around the point as in if you
were to drop a twig in the fluid at that
point somehow fixing its center in place
would it tend to spin around regions
where that rotation is clockwise are
said to have positive curl and regions
where it's counterclockwise have
negative curl and it doesn't have to be
that all of the vectors around the input
are pointing counterclockwise or all of
them are pointing clockwise a point
inside a region like this one for
example would also have nonzero curl
since the flow is slow at the bottom but
quick up top resulting in a net
clockwise influence and really true
proper curl is a three dimensional idea
one where you associate each point in 3d
space with a new vector characterizing
the rotation around that point according
to a certain right hand rule and I have
plenty of content from my time at Khan
Academy describing this in more detail
if you want but for our main purpose
I'll just be referring to the two
dimensional variant of curl which
associates each point in 2d space with a
single number rather than a new vector
as I said even though these intuitions
are given in the context of fluid flow
both of these ideas are significant for
other sorts of vector fields one very
important example is how electricity and
magnetism are described by for special
equations these are known as Maxwell's
equations and they're written in the
language of divergence and curl this top
one for example is Gauss's law stating
that the divergence of an electric field
at a given point is proportional to the
charge density at that point unpacking
the intuition for this you might imagine
positively charged regions as acting
like sources of some imagined fluid and
negatively charged regions as being the
sinks of that fluid and throughout parts
of space where there is no charge the
fluid would be flowing in compressively
just like water of course there's not
some literal electric fluid
but it's a very useful and a very pretty
way to read an equation like this
similarly another important equation is
that the divergence of the magnetic
field is zero everywhere and you can
understand that by saying that if the
field represents a fluid flow that fluid
would be incompressible with no sources
and no sinks it acts just like water
this also has the interpretation that
magnetic monopoles something that acts
just like a north or a south end of a
magnet in isolation don't exist
there's nothing analogous to positive
and negative charges in an electric
field likewise the last two equations
tell us that the way that one of these
fields changes depends on the curl of
the other field and really this is a
purely three-dimensional idea and a
little outside of our main focus here
but the point is that divergence and
curl arise in contexts that are
unrelated to flow and side note the back
and forth from these last two equations
is what gives rise to light waves and
quite often these ideas are useful in
contexts which don't even seem spatial
in nature at first to take a classic
example that students of differential
equations often studied let's say that
you wanted to track the population sizes
of two different species where maybe one
of them is a predator of another the
state of this system at a given time
meaning the two population sizes can be
thought of as a point in two-dimensional
space what you would call the phase
space of this system for a given pair of
population sizes these populations may
be inclined to change based on things
like how reproductive are the two
species or just how much does one of
them enjoy eating the other one these
rates of change would typically be
written analytically as a set of
differential equations it's okay if you
don't understand these particular
equations I'm just throwing them up for
those of you who are curious and because
we're placing variables with pictures
makes me laugh a little bit but the
relevance here is that a nice way to
visualize what such a set of equations
is really saying is to associate each
point on the plane each pair of
population sizes with a vector
indicating the rates of change for both
variables for example when there are
lots of foxes but relatively few rabbit
the number of foxes might tend to go
down because of the constrained food
supply and the number of rabbits might
also tend to go down because they're
getting eaten by all of the foxes
potentially at a rate that's faster than
they can reproduce so a given vector
here is telling you how and how quickly
a given pair of population sizes tends
to change notice this is a case where
the vector field is not about physical
space but instead it's a representation
of a certain dynamic system that has two
variables and how that system evolves
over time this can maybe also give a
sense for why mathematicians care about
studying the geometry of higher
dimensions
what if our system was tracking more
than just two or three numbers now the
flow associated with this field is
called the phase flow for our
differential equation and it's a way to
conceptualize at a glance how many
possible starting States would evolve
over time operations like divergence and
curl can help to inform you about the
system do the population sizes tend to
converge towards a particular pair of
numbers or there are some values that
they diverge away from are there cyclic
patterns and are those cycles stable or
unstable to be perfectly honest with you
for something like this you'd often want
to bring in related tools beyond just
divergence and curl those would give you
the full story but the frame of mind
that practice with these two ideas
brings you carries over well to studying
setups like this with similar pieces of
mathematical machinery now if you really
want to get a handle on these ideas
you'd want to learn how to compute them
and to practice those computations and
I'll leave some links to where you can
learn about this and practice if you
want again I did some videos and
articles and worked examples for Khan
Academy on this topic during my time
there so too much detail here we'll
start to feel redundant for me but there
is one thing worth bringing up regarding
the notation associated with these
computations commonly the divergence is
written as a dot product between this
upside-down triangle thing and your
vector field function and the curl is
written as a similar cross product
sometimes students are told that this is
just a notational trick each computation
involves a certain sum of certain
derivatives and treating this
upside-down triangle as if it was a
vector of
Rivet evaporators can be a helpful way
to keep everything straight but it is
actually more than just a mnemonic
device there is a real connection
between divergence and the dot product
and between curl and the cross product
even though we won't be doing practice
computations here I would like to give
you at least some vague sense for how
these four ideas are connected imagine
taking some small step from one point of
your vector field to another the vector
at this new point will likely be a
little bit different from the one at the
first point there will be some change to
the function after that step which you
might see by subtracting off your
original vector from that new one and
this kind of difference to your function
over small steps is what differential
calculus is all about now the dot
product gives you kind of a measure of
how aligned two vectors are right now
the dot product of your step vector with
that difference vector that it causes
tends to be positive in regions where
the divergence is positive and vice
versa
in fact in some sense the divergence is
a sort of average value for this dot
product of a step with a change to the
output that it causes over all possible
step directions assuming that things are
rescaled appropriately I mean think
about it if a step in some direction
causes a change to that vector in that
same direction this corresponds to a
tendency for outward flow for positive
divergence and on the flip side if those
dot products tend to be negative meaning
the difference vector is pointing in the
opposite direction from the step vector
that corresponds with a tendency for
inward flow negative divergence
similarly remember that the cross
product is a sort of measure for how
perpendicular two vectors are so the
cross product of your step vector with
the difference vector that it causes
tends to be positive in regions where
the curl is positive and vice versa
you might think of the curl as a sort of
average of this step vector difference
vector cross product if a step in some
direction corresponds to a change
perpendicular to that step
that corresponds to a tendency for flow
rotation so typically this is the part
where there might be some kind of
sponsor message but one thing I want to
do with the channel moving ahead is to
stop doing sponsored content and instead
make things just about the direct
relationship with the audience I mean
that not only in the sense of the
funding model with direct support
through patreon but also in the sense
that I think these videos can better
accomplish their goal if each one of
them feels like it's just about you and
me sharing in a love of math with no
other motive especially in the cases
where the viewers are students there are
some other reasons and I wrote up some
of my full thoughts on this over on
patreon which you certainly don't have
to be a supporter to read that's just
where it lives
I think advertising on the Internet
occupies a super wide spectrum from
truly degenerate clickbait up to
genuinely well aligned win-win-win
partnerships now I've always taken care
to do promotions for companies that I
would genuinely recommend to take one
example you may have noticed that I did
a number of promos for a brilliant and
it's really hard to imagine better
alignment than that right I mean I try
to inspire people to be interested in
math but I'm also a firm believer that
videos aren't enough that you need to
actively solve problems and here's a
platform that provides practice and
likewise for any others I've promoted
too I always make sure to feel good
alignment but even still even if you
seek out the best possible partnerships
whenever advertising is in the equation
the incentives will always be to try
reaching as many people as possible but
when the model is more exclusively about
a direct relationship with the audience
the incentives are pointed towards
maximizing how valuable people find the
experiences that they're given and I
think those two goals are correlated but
not always perfectly I like to think
that I'll always try to maximize the
value of the experience no matter what
but for that matter I also like to think
that I can consistently wake up early
and resist eating too much sugar what
matters more than wanting something is
to actually align incentives anyway if
you want to hear more of my thoughts all
linked to the patreon post and thank you
again to existing supporters for making
this possible and I'll see you all next
video
[Music]