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.

## Multivariable calculus

### Course: Multivariable calculus>Unit 5

Lesson 6: Stokes' theorem (articles)

# Stokes' theorem

This is the 3d version of Green's theorem, relating the surface integral of a curl vector field to a line integral around that surface's boundary.

## Background

Not strictly required, but very helpful for a deeper understanding:

If you would like examples of using Stokes' theorem for computations, you can find them in the next article. Here, the goal is to present the theorem in such a way that you can get a gut feeling for what it is really saying, and why it is true.

## What we're building to

• Stokes' theorem is the 3D version of Green's theorem.
• It relates the surface integral of the curl of a vector field with the line integral of that same vector field around the boundary of the surface:
$\displaystyle \overbrace{ \underbrace{ \iint_\redE{S} }_{\text{\redE{S} is a surface in 3D}} \!\!\!\!\!\!\!\!\! \big( \text{curl}\,\blueE{\textbf{F}} \cdot \greenE{\hat{\textbf{n}}} \big) d\Sigma }^{\substack{ \text{Surface integral of} \\ \text{a curl vector field} }} = \!\!\!\!\!\!\!\!\! \underbrace{ \int_{\redE{C}} \blueE{\textbf{F}} \cdot d\textbf{r} }_{\substack{ \text{Line integral around} \\ \text{boundary of surface} }}$

## Interpreting a line integral in 3D

Let start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, left parenthesis, x, comma, y, comma, z, right parenthesis represent a three-dimensional vector field.
Think of this vector field as being the velocity vector of some gas, whooshing about through space.
Now let start color #bc2612, C, end color #bc2612 be some closed curve inside this vector field.
How can you interpret the line integral of start color #0c7f99, start bold text, F, end bold text, end color #0c7f99 around start color #bc2612, C, end color #bc2612?
\oint, start subscript, start color #bc2612, C, end color #bc2612, end subscript, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, dot, d, start bold text, r, end bold text
Well, first of all, this integral doesn't make sense until the curve is oriented. The differential vector d, start bold text, r, end bold text represents a tiny step along the curve, but in which direction? In three dimensions, you can't just say "clockwise" or "counterclockwise", since that will depend on where you are in space when you look at the curve. I'll address how we specify orientation mathematically below, but for now, it's easier to just draw an orientation:
Imagine you are a bird, flying through space along the curve start color #bc2612, C, end color #bc2612 while the wind blows according to the vector field start color #0c7f99, start bold text, F, end bold text, end color #0c7f99. (For the purposes of this animation, you are a sphere-shaped bird).
Think of each step (wing-flap?) of your motion along start color #bc2612, C, end color #bc2612 as being the tiny vector d, start bold text, r, end bold text. Consider the dot product between d, start bold text, r, end bold text and the wind-velocity-vector from the field start color #0c7f99, start bold text, F, end bold text, end color #0c7f99 where you are. It will be positive when the wind is helping you, and negative when it is in your face.
\oint, start subscript, start color #bc2612, C, end color #bc2612, end subscript, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, dot, d, start bold text, r, end bold text
You can think of this as adding up how helpful or burdensome the wind was during your flight. It measures the tendency of the fluid flow to circulate around start color #bc2612, C, end color #bc2612. If it is positive, the wind was generally helpful, and you could say that it tends to circulate around start color #bc2612, C, end color #bc2612 in the direction of your specified orientation. If it is negative, you could say it tends to circulate the other way.

## Chopping up a surface

Those of you who read the Green's theorem article will find what follows very familiar.
Consider a surface start color #bc2612, S, end color #bc2612 in space whose boundary is the curve start color #bc2612, C, end color #bc2612, as if start color #bc2612, C, end color #bc2612 was a wire loop that you just dipped in soap, and start color #bc2612, S, end color #bc2612 is the beginnings of a soap bubble emerging from the loop.
Slice this surface in half, and name the boundaries of the two resulting pieces start color #0d923f, C, start subscript, 1, end subscript, end color #0d923f and start color #a75a05, C, start subscript, 2, end subscript, end color #a75a05. If they are each oriented the same way start color #bc2612, C, end color #bc2612 was, the line integrals (of the same vector field start color #0c7f99, start bold text, F, end bold text, end color #0c7f99) around each of these smaller curves cancel out along the slice that you made:
The portions of start color #0d923f, C, start subscript, 1, end subscript, end color #0d923f and start color #a75a05, C, start subscript, 2, end subscript, end color #a75a05 which remain make up the original boundary start color #bc2612, C, end color #bc2612. So the sum of the line integrals around the smaller pieces equals the full line integral around start color #bc2612, C, end color #bc2612:
start underbrace, \oint, start subscript, start color #0d923f, C, start subscript, 1, end subscript, end color #0d923f, end subscript, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, dot, d, start bold text, r, end bold text, plus, \oint, start subscript, start color #a75a05, C, start subscript, 2, end subscript, end color #a75a05, end subscript, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, dot, d, start bold text, r, end bold text, end underbrace, start subscript, start text, C, a, n, c, e, l, space, o, u, t, space, a, l, o, n, g, space, s, l, i, c, e, space, t, h, r, o, u, g, h, space, start color #bc2612, S, end color #bc2612, end text, end subscript, equals, \oint, start subscript, start color #bc2612, C, end color #bc2612, end subscript, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, dot, d, start bold text, r, end bold text
More generally, imagine slicing up start color #bc2612, S, end color #bc2612 into many, many really small pieces, name their boundaries start color #bc2612, C, start subscript, 1, end subscript, end color #bc2612, comma, dots, comma, start color #bc2612, C, start subscript, n, end subscript, end color #bc2612, and orient them all the same way as start color #bc2612, C, end color #bc2612. It gets messy drawing this in 3D, so I'll just steal an image from the Green's theorem article showing the 2D version, which has essentially the same intuition.
The line integrals around all of these little loops will cancel out along the slices within start color #bc2612, C, end color #bc2612, leaving only something equal to the line integral around start color #bc2612, C, end color #bc2612 itself.
start underbrace, sum, start subscript, k, equals, 1, end subscript, start superscript, n, end superscript, \oint, start subscript, start color #bc2612, C, start subscript, k, end subscript, end color #bc2612, end subscript, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, dot, d, start bold text, r, end bold text, end underbrace, start subscript, start text, C, a, n, c, e, l, space, o, u, t, space, a, l, o, n, g, space, s, l, i, c, e, space, t, h, r, o, u, g, h, space, start color #bc2612, S, end color #bc2612, end text, end subscript, equals, \oint, start subscript, start color #bc2612, C, end color #bc2612, end subscript, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, dot, d, start bold text, r, end bold text

## Curl on each piece

The reason for chopping up start color #bc2612, S, end color #bc2612 like this is that the line integral around a very small loop can be approximated using curl. Specifically, zoom in on a specific one of those pieces. If it's small enough, you can think of it as basically being flat.
• Name the boundary of this piece , , start color #bc2612, C, start subscript, k, end subscript, end color #bc2612, ".
• Choose some point start color #a75a05, left parenthesis, x, start subscript, k, end subscript, comma, y, start subscript, k, end subscript, comma, z, start subscript, k, end subscript, right parenthesis, end color #a75a05 on the surface, inside this little loop.
• Let start color #0d923f, start bold text, n, end bold text, with, hat, on top, end color #0d923f be a unit normal vector to the surface at the point start color #a75a05, left parenthesis, x, start subscript, k, end subscript, comma, y, start subscript, k, end subscript, comma, z, start subscript, k, end subscript, right parenthesis, end color #a75a05. "Pointing which way?", you might ask. Curl the fingers of your right hand around the little loop start color #bc2612, C, start subscript, k, end subscript, end color #bc2612 so that they align with its orientation. Stick out your thumb, and this is the direction of start color #0d923f, start bold text, n, end bold text, with, hat, on top, end color #0d923f.
• Let start color #bc2612, d, \Sigma, end color #bc2612 represent the area of this little piece (in anticipation of using an infinitesimal area for a surface integral in just a bit).
Then the line integral of start color #0c7f99, start bold text, F, end bold text, end color #0c7f99 around start color #bc2612, C, start subscript, k, end subscript, end color #bc2612 can be approximated as follows:
If you feel uneasy about your intuition for what curl means, or how a vector can represent rotation, consider reviewing this article on curl.
Here's the loose intuition for why this approximation works: start text, c, u, r, l, end text, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, start color #a75a05, left parenthesis, x, start subscript, k, end subscript, comma, y, start subscript, k, end subscript, comma, z, start subscript, k, end subscript, right parenthesis, end color #a75a05 is a vector which tells you how the fluid flowing along the vector field start color #0c7f99, start bold text, F, end bold text, end color #0c7f99 tends to rotate near the point start color #a75a05, left parenthesis, x, start subscript, k, end subscript, comma, y, start subscript, k, end subscript, comma, z, start subscript, k, end subscript, right parenthesis, end color #a75a05. For example, if you imagine a small tennis ball floating in space, centered at the point start color #a75a05, left parenthesis, x, start subscript, k, end subscript, comma, y, start subscript, k, end subscript, comma, z, start subscript, k, end subscript, right parenthesis, end color #a75a05, the vector start text, c, u, r, l, end text, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, start color #a75a05, left parenthesis, x, start subscript, k, end subscript, comma, y, start subscript, k, end subscript, comma, z, start subscript, k, end subscript, right parenthesis, end color #a75a05 describes the way it will tend to spin due to the wind blowing around it. That is to say, the vector is directed along the axis of rotation, and its magnitude is proportional to the rate of rotation.
When we take the dot product between this curl vector and start color #0d923f, start bold text, n, end bold text, with, hat, on top, end color #0d923f, the unit normal vector to the surface, it extract the component of the curl vector which is perpendicular to the surface. This will describe the rate of fluid rotation on the surface itself. On the other hand, that little bit of fluid rotation is also described by the line integral around the boundary of the tiny piece: \oint, start subscript, start color #bc2612, C, start subscript, k, end subscript, end color #bc2612, end subscript, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, dot, d, start bold text, r, end bold text.
Actually, that line integral produces a really small number (since start color #bc2612, C, start subscript, k, end subscript, end color #bc2612 is very short), but start text, c, u, r, l, end text, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, start color #a75a05, left parenthesis, x, start subscript, k, end subscript, comma, y, start subscript, k, end subscript, comma, z, start subscript, k, end subscript, right parenthesis, end color #a75a05 produces a number which doesn't care about the size of the piece containing start color #a75a05, left parenthesis, x, start subscript, k, end subscript, comma, y, start subscript, k, end subscript, comma, z, start subscript, k, end subscript, right parenthesis, end color #a75a05. This is why we scale down the relevant component of curl by the area of the tiny piece.
(For a deeper understanding of this approximation, take a look at the formal definition of curl in three dimensions.)

## Surface integral of curl

Combining the ideas of the last two sections, here's what we get:
\begin{aligned} &\underbrace{ \oint_{\redE{C}} \blueE{\textbf{F}} \cdot d\textbf{r} }_{\substack{ \text{Integral around boundary}\\ \text{of the entire surface} }} \\\\ &\qquad\qquad \downarrow \\\\ &\underbrace{ \sum_{k = 1}^n \oint_{\redE{C_k}} \blueE{\textbf{F}} \cdot d\textbf{r} }_{\text{Sum of integrals around tiny pieces}} \\\\ &\qquad\qquad \downarrow \\\\ &\underbrace{ \sum_{k = 1}^n \text{curl}\,\blueE{\textbf{F}} \goldE{(x_k, y_k, z_k)} \cdot \greenE{\hat{\textbf{n}}} \;\redE{d\Sigma} }_{\text{Apply curl approximation to each piece}} \end{aligned}
As we chop things up more and more finely, this last sum approaches the surface integral of left parenthesis, start text, c, u, r, l, end text, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, dot, start color #0d923f, start bold text, n, end bold text, with, hat, on top, end color #0d923f, right parenthesis over the surface start color #bc2612, S, end color #bc2612. (If this does not make sense to you, consider reviewing the article on surface integrals).
\begin{aligned} &\sum_{k = 1}^n \text{curl}\,\blueE{\textbf{F}} \goldE{(x_k, y_k, z_k)} \cdot \greenE{\hat{\textbf{n}}} \;\redE{d\Sigma} \\\\ &\qquad\qquad \downarrow \small{\gray{\text{As \redE{S} is chopped more and more finely}}} \\\\ &\iint_{\redE{S}} \text{curl}\,\blueE{\textbf{F}}\cdot\greenE{\hat{\textbf{n}}} \; \redE{d\Sigma} \end{aligned}
Putting this together, we have the following marvelous equation, known as Stokes' theorem:
\begin{aligned} \oint_{\redE{C}} \blueE{\textbf{F}} \cdot d\textbf{r} = \iint_{\redE{S}} \text{curl}\,\blueE{\textbf{F}}\cdot\greenE{\hat{\textbf{n}}} \; \redE{d\Sigma} \end{aligned}

## Aligning orientation

Surfaces are oriented by the chosen direction for their unit normal vectors. For example, you will often see a surface oriented using outward-facing unit normal vectors (although not all surfaces have a notion of outward-facing vs. inward-facing unit normal vectors).
Curves are oriented by the chosen direction for their tangent vectors.
For Stokes' theorem to work, the orientation of the surface and its boundary must "match up" in the right way. Otherwise, the equation will be off by a factor of minus, 1. Here are several different ways you will hear people describe what this matching up looks like; all are describing the same thing:
• If you look at the surface in such a way that the unit normal vectors are all pointed towards your face, the curve should be oriented counterclockwise.
• The curve's orientation should follow the right-hand rule, in the sense that if you stick the thumb of your right hand in the direction of a unit normal vector near the edge of the surface, and curl your fingers, the direction they point on the curve should match its orientation.
• When you are walking along the boundary curve with your body pointing out in the direction of the unit normal vector, you should be walking in such a way that the surface is to your left side.

## Blowing bubbles

Here's something pretty awesome about Stokes' theorem: The surface itself doesn't matter, all that matters is what its boundary is.
For example, imagine a particular loop through space, and think about all the different surfaces that could have this loop as a boundary; all the different soap bubbles which could emerge from this one loop:
For any given vector field start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, left parenthesis, x, comma, y, comma, z, right parenthesis, the surface integral \iint, start subscript, start color #bc2612, S, end color #bc2612, end subscript, start text, c, u, r, l, end text, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, dot, start color #0d923f, start bold text, n, end bold text, with, hat, on top, end color #0d923f, start color #bc2612, d, \Sigma, end color #bc2612 will be the same for each one of these surfaces. Isn't that crazy! These surface integrals involve adding up completely different values at completely different points in space, yet they turn out to be the same simply because they share a boundary.
What this tells you is just how special curl vector fields are, since with most vector fields, the surface integral absolutely depends on the specific surface at hand. If you learned about conservative vector fields, this is analogous to path independence, and how it indicates just how special gradient vector fields are.

## What if there is no boundary?

If you have a closed surface, like a sphere or a torus, then there is no boundary. This means the "line integral over the boundary" is zero, and Stokes' theorem reads as follows:
\begin{aligned} \iint_{\redE{S}} \text{curl}\,\blueE{\textbf{F}}\cdot\greenE{\hat{\textbf{n}}} \; \redE{d\Sigma} = 0 \end{aligned}
If you think back to chopping up the surface to get many tiny little line integrals, this basically says all those little line integrals cancel out with nothing left to show for their work.

## Summary

• Stokes' theorem is the 3D version of Green's theorem.
$\displaystyle \overbrace{ \underbrace{ \iint_\redE{S} }_{\text{\redE{S} is a surface in 3D}} \!\!\!\!\!\!\!\!\! \big( \text{curl}\,\blueE{\textbf{F}} \cdot \greenE{\hat{\textbf{n}}} \big) d\Sigma }^{\substack{ \text{Surface integral of} \\ \text{a curl vector field} }} = \!\!\!\!\!\!\!\!\! \underbrace{ \int_{\redE{C}} \blueE{\textbf{F}} \cdot d\textbf{r} }_{\substack{ \text{Line integral around} \\ \text{boundary of surface} }}$
• The line integral integral, start subscript, start color #bc2612, C, end color #bc2612, end subscript, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99, dot, d, start bold text, r, end bold text tells you how much a fluid flowing along start color #0c7f99, start bold text, F, end bold text, end color #0c7f99 tends to circulate around the boundary start color #bc2612, C, end color #bc2612 of the surface start color #bc2612, S, end color #bc2612.
• The left-hand side surface integral can be seen as adding up all the little bits of fluid rotation on the surface start color #bc2612, S, end color #bc2612 itself. The vector start text, c, u, r, l, end text, start color #0c7f99, start bold text, F, end bold text, end color #0c7f99 describes the fluid rotation at each point, and dotting it with a unit normal vector to the surface, start color #0d923f, start bold text, n, end bold text, with, hat, on top, end color #0d923f, extracts the component of that fluid rotation which happens on the surface itself.