If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Conservative vector fields

Especially important for physics, conservative vector fields are ones in which integrating along two paths connecting the same two points are equal.

Background

What we're building to

At the end of this article, you will see how this paradoxical Escher drawing cuts to the heart of conservative vector fields.
A vector field F(x,y) is called a conservative vector field if it satisfies any one of the following three properties (all of which are defined within the article):
  • Line integrals of F are path independent.
  • Line integrals of F over closed loops are always 0.
  • F is the gradient of some scalar-valued function, i.e. F=g for some function g.
There is also another property equivalent to all these: F is irrotational, meaning its curl is zero everywhere (with a slight caveat). However, I'll discuss that in a separate article which defines curl in terms of line integrals.
The key takeaway here is not just the definition of a conservative vector field, but the surprising fact that the seemingly different conditions listed above are equivalent to each other. Madness!

Path independence

Imagine you have any ol' off-the-shelf vector field F(x,y), and you consider the line integrals of F of two separate paths, C1 and C2, each starting at a point A and ending at a point B
For almost all vector fields F, and almost all choices for the two paths C1 and C2, these integrals will be different.
C1FdsC2FdsAlmost always true
And this makes sense! Each integral is adding up completely different values at completely different points in space. What's surprising is that there exist some vector fields where distinct paths connecting the same two points will always be equal, no matter the choice of paths (of which there are super-infinitely many).
In the last article, covering the gradient theorem we saw that in the special case of vector fields which are the gradient of some scalar-valued function, f, this magical property is true. The line integrals along distinct paths connecting the same two points A and B will always evaluate to the same thing:
C1fds=f(B)f(A)Result of thegradient theorem=C2fds
Definition: This property is called path independence. Specifically, a line integral through a vector field F(x,y) is said to be path independent if the value of the integral only depends on the point where the path starts and the point where it ends, not the specific choice of path in between.
Actually, when you properly understand the gradient theorem, this statement isn't totally magical. This is because line integrals against the gradient of f measure the change in the value of f. Visualizing this with the graph of f, this says that any two paths bringing you from one point to another change your altitude by the same amount.
Khan Academy video wrapper
The takeaway from this result is that gradient fields are very special vector fields. Because this property of path independence is so rare, in a sense, "most" vector fields cannot be gradient fields.

Path independence implies gradient field

Okay, so gradient fields are special due to this path independence property. But can you come up with a vector field F(x,y) in which all line integrals are path independent, but which is not the gradient of some scalar-valued function?
I guess I've spoiled the answer with the section title and the introduction: All vector fields in which line integrals are path independent must be the gradient of some function. By why?
Really, why would this be true? Consider an arbitrary vector field F(x,y) in which line integrals are path independent, meaning
C1Fds=C2Fds
for all paths C1 and C2 which connect the same two points A and B. What is it about this property that ensures the existence of some function g such that g=F?
Challenge question: Can you think of a way to construct such a function g in terms of F using the fact that F is path-independent?
This is a tricky question, but it might help to look back at the gradient theorem for inspiration.

Closed loops

Definition: A path is called closed if it starts and ends at the same point. Such paths are also commonly called closed loops.
For example, the path C pictured below starts and ends at A.
If we take a vector field F where all line integrals are path independent, the line integral of F on any closed loop will be 0. Why?
The converse of this fact is also true: If the line integrals of F on all closed loops evaluate to 0, then all line integrals must be path independent. Why?

Funky notation for closed-loop integrals.

You will sometimes see a line integral over a closed loop C written as
CFdr
Don't worry, this is not a new operation that needs to be learned. It is just a line integral, computed in just the same way as we have done before, but it is meant to emphasize to the reader that C is a closed loop.

Potential energy

In the article introducing​ line integrals through a vector field, I mentioned briefly how in physics, the work done by a force on an object in motion is computed by taking a line integral of the force's vector field along the path of motion.
W=CFds
A force is called conservative if the work it does on an object moving from any point A to another point B is always the same, no matter what path is taken. In other words, if this integral is always path-independent. Fundamental forces like gravity and the electric force are conservative, and the quintessential example of a non-conservative force is friction.
This has an interesting consequence based on our discussion above: If a force is conservative, it must be the gradient of some function.
F=U
Moreover, according to the gradient theorem, the work done on an object by this force as it moves from point A to point B can be computed just by evaluating this function U at each point:
W=CFds=CUds=U(B)U(A)
As the physics students among you have likely guessed, this function U is potential energy. For example, if you take the gradient of gravitational potential or electric potential, you will get the gravitational force or electric force respectively. This is why computing the work done by a conservative force can be simplified to comparing potential energies.
It also means you could never have a "potential friction energy" since friction force is non-conservative.

Escher

Moving from physics to art, this classic drawing "Ascending and Descending" by M.C. Escher shows what the world would look like if gravity were a non-conservative force.
Closed loop perspective:
  • Imagine walking clockwise on this staircase. With each step gravity would be doing negative work on you. So integrating the work along your full circular loop, the total work gravity does on you would be quite negative. However, that's an integral in a closed loop, so the fact that it's nonzero must mean the force acting on you cannot be conservative.
Path independence perspective
  • Imagine walking from the tower on the right corner to the left corner. If you get there along the clockwise path, gravity does negative work on you. If you get there along the counterclockwise path, gravity does positive work on you. Since both paths start and end at the same point, path independence fails, so the gravity force field cannot be conservative.
Gradient perspective:
  • In the real world, gravitational potential corresponds with altitude​, because the work done by gravity is proportional to a change in height. What makes the Escher drawing striking is that the idea of altitude doesn't make sense. Many steps "up" with no steps down can lead you back to the same point. This corresponds with the fact that there is no potential function U such that U give the gravity field.

Want to join the conversation?

  • leaf green style avatar for user wcyi56
    About the explaination in "Path independence implies gradient field" part, what if there does not exists a point where f(A) = 0 in the domain of f?
    (8 votes)
    Default Khan Academy avatar avatar for user
  • primosaur ultimate style avatar for user Hemen Taleb
    If there is a way to make sure that a vector field is path independent, I didn't manage to catch it in this article. Is it?, if not, can you please make it? Thanks
    (4 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Andrea Menozzi
    any exercises or example on how to find the function g?
    (3 votes)
    Default Khan Academy avatar avatar for user
    • sneak peak green style avatar for user Ardra
      Yes, Sal has covered in this course earlier. Go to multivariable calculus course and unit 4.

      In short, you integrate the P(x,y) function, which is the x-component of your vector field with respect to x (assume y= constant) and add a pure function of y like f(y) because it could go to zero when differentiated to find the gradient (remember that we are trying to find the scalar function whose gradient field is the vector function that we possess), do the same for Q(x,y) and see if you can write a U(x,y) so that when you differentiate partially with respect to x you get P(x,y) and Q(x,y) when with y.
      (1 vote)
  • purple pi purple style avatar for user 012010256
    Just curious, this curse includes the topic of The Helmholtz Decomposition of Vector Fields?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • leafers tree style avatar for user Aravinth Balaji R
    Can I have even better explanation Sal? I would love to understand it fully, but I am getting only halfway. Could you please help me by giving even simpler step by step explanation?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • aqualine seedling style avatar for user Jonathan Sum AKA GoogleSearch@arma2oa
    if it is closed loop, it doesn't really mean it is conservative?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • hopper happy style avatar for user Will Springer
      It is the vector field itself that is either conservative or not conservative.

      You can have a closed loop over a field that is conservative, but you could also have a closed loop over a field that is not conservative. You'll talk about this second category more when you get to the later theorems.
      (3 votes)
  • blobby green style avatar for user Naman
    Don't forces minimize potential energy? So shouldn't the force be negative of the gradient of potential energy?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user Ryan Lee
      Potential energies are defined to be negative, so their gradient would become positive to match the formula for force. For example, gravitational potential energy is given by -GMm/r, the gradient of which is GMm/r^2 which is also the formula for gravitational force.
      (2 votes)
  • blobby green style avatar for user jp2338
    quote > this might spark the idea in your mind to replace \nabla f∇fdel, f with \textbf{F}Fstart bold text, F, end bold text, producing a new scalar value function, which we'll call g

    I don't understand why this idea comes out at all. why ? what is the purpose if this replacement ? very ambiguous
    (1 vote)
    Default Khan Academy avatar avatar for user
  • aqualine tree style avatar for user White
    All of these make sense but there's something that's been bothering me since Sals' videos.

    If the integral over a gradient field of a closed loop is zero. Why did Sal's example evaluate to -2*pi and Grant's previous example evaluated to 2*pi?

    A circle is a closed loop. What gives?
    -----
    Edit:
    Oh wait, silly me.
    -yi^ + xj^ isn't a gradient field now is it?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • male robot hal style avatar for user Rubén Jiménez
      no, it can't be a gradient field, it would be the gradient of the paradox picture above. If the arrows point to the direction of steepest ascent (or descent), then they cannot make a circle, if you go in one path along the arrows, to return you should go through the same quantity of arrows relative to your position, but in the opposite direction, the same work but negative, the same integral but negative, so that the entire circle is 0
      (1 vote)
  • blobby purple style avatar for user John Smith
    Correct me if I am wrong, but why does he use F.ds instead of F.dr ? ds is a tiny change in arclength is it not? if it is a scalar, how can it be dotted?

    Secondly, in the Path independence implies gradient part, doesn't defining g(B) the way it is, already use the fundamental theorem, implying that F is already a gradient field?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user adam.ghatta
      dS is not a scalar, but rather a small vector in the direction of the curve C, along the path of motion.

      For the gradient of a potential function U, the vector field f created from grad(U) is path independent by definition. The fundamental theorem simply relies on the fact, that gradient fields are path-independent. The fundamental gradient theorem that allows us to use f(B) - f(A) only suffices if the gradient of the potential function f exists.
      (1 vote)