Main content

# Divergence formula, part 1

How does the x-component of a vector field relate to the divergence? Created by Grant Sanderson.

## Want to join the conversation?

- 1:35When P is increasing, the partial derivative of P with respect to x may not be positive.

Indeed, we could imagine a function P like P(x,y) = 2y. In this case, we really don't care about the x-variable, but P can increase !

So why does he only talk about the partial derivative of P with respect to x ? What about the one with respect to y ?

(I think the name of the variables 'x' and 'y' have no link with the x and y directions in a graph. In our case, the right-left direction is given by P, and the up-down direction by Q)(6 votes)- You are correct that P could increase if P(x,y) = 2y. However, it would not increase with a change in the x-input. Thus, the divergence in the x-direction would be equal to zero if P(x,y) = 2y. In this example, we are only trying to find out what the divergence is in the x-direction so it is not helpful to know what partial P with respect to y would be.(8 votes)

- What about for cases like here: https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/divergence-grant-videos/v/divergence-intuition-part-1

Where the divergence looks like this:

<-- <------- <------------ O ------------ > -------> -->

It's clearly divergent from 'O', but it doesn't look like dP/dx > 0.

For x>0, dP/dx < 0; decreasingly negative

for x<0, seems like dP/dx < 0 but increasingly negative.(2 votes)- Another little thing. For x<0, dP/dx>0, because as x increases, the value of P also does that (at least in the shown portion)(3 votes)

- What is P? I dont know if that comes from an earlier video, but i missed it.(1 vote)
- P is just a point in the vector field with a certain value in horizontal and (not in this case) vertical component.(3 votes)

- Can be P have a positive divergence at a point by having P as zero at the point, less positive to its right and more positive to its left?(2 votes)
- I don't understand why is that @1:11partial derivative of P with respect to x is increasing. Why?(1 vote)
- That is because you are considering the change in P as it goes from negative, to zero, and then becomes positive, so that means that as you increase in the x direction the value of P also increases; thus, partial P with respect to x is positive. As Grant says, you may want to review the topic on Partial derivatives of vector fields: https://www.khanacademy.org/math/multivariable-calculus/multivariable-derivatives/partial-derivatives-of-vector-valued-functions/v/partial-derivatives-of-vector-fields(2 votes)

- What is p? Anything more than the x-component?(1 vote)
- Hey, I did not understand how does partial derivative have a relation with divergence.(1 vote)

## Video transcript

- [Voiceover] Hello everyone. So now that we have an intuition for what divergence is
trying to represent, let's start actually
drilling in on a formula. The first thing I want to do is just limit our perspective to functions that only have an X component, or rather, where the Y component of
the output is just zero. So this is some kind of vector field and if there's only an X component what this means it's going to look like is all of the vectors
only go left or right, and there's kind of no up or
down involved in any of them. So in this case, let's
start thinking about what positive divergence of your vector fields might look like near some point X-Y. So if you have your point, this is that point X-Y sitting
off somewhere in space, two cases where the divergence
of this might look positive are, one, where nothing
happens at the point. So in this case P would be
equal to zero at our point. But then to left of it things
are moving to the left, meaning P, the X component of
our vector valued function, is negative. That's why the X component
of this vector is negative. But then to the right, vectors would be moving off to the right. So over here, P would be positive. So this would be an example of a positive divergence circumstance where only the X component is responsible. And what you'll notice here, this would be P starts negative, goes zero, then becomes positive. So as you're changing in the X direction, P should be increasing. So a positive divergence
here seems to correspond to a positive partial derivative
of P with respect to X. And if that seems a little unfamiliar, if you're not sure how to
think about partial derivatives of a component of a vector field, I have a video on that
and you can take a look and refresh yourself, how
you might think about this partial derivative of P with respect to X. And once you do, hopefully it makes sense why this specific positive
divergence example corresponds with the positive
partial derivative of P. But remember, this isn't the only way that a positive divergence might look. You're gonna have another
circumstance where, let's say, your point, X-Y, actually has a vector attached to it. So this here again
represents our point X-Y. And in this specific example
this would be P is positive. P of X-Y is positive at your point there. But another way that positive
divergence might look is that you have things
coming in towards that point and things going away,
but the things going away are bigger than the ones coming in. But again, this exhibits the
idea of P increasing in value. P starts off small, it's a
positive but small component, and then it gets bigger and
then it gets even bigger. So once again we have this idea of positive partial derivative
of P with respect to X, because changes in X, as you increase X it
causes an increase in P, seems to correspond to
positive divergence. And you can even look at
it if you go the other way where you have a little bit of
negative component to P here. So P is a little bit negative, but to the left of your
point it's really negative, and then to the right it's
not nearly as negative. And in this case it's kind of like as you're moving to the
right, as X is increasing, you start off very negative, and then only kind of negative, and then barely negative. And once again that
corresponds to an increase in the value of P as X increases. So what you'd expect is that
a partial derivative of P, that X component of the
output, with respect to X, is gonna be somewhere
involved in the formula for the divergence of our
vector field at a point X-Y. In the next video I'm gonna
go a similar line of reasoning to see what should go on
with that Y component.