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 examples

See how Stokes' theorem is used in practice.

## The formula (quick review)

Stokes' theorem is a tool to turn the surface integral of a curl vector field into a line integral around the boundary of that surface, or vice versa. Specifically, here's what it says:
Let's go through each term:
• $\mathbf{\text{F}}\left(x,y,z\right)$ is a three-dimensional vector field.
• $\text{curl}\phantom{\rule{0.167em}{0ex}}\mathbf{\text{F}}$, also often written as $\mathrm{\nabla }×\mathbf{\text{F}}$. It is the three-dimensional curl of $\mathbf{\text{F}}$, which is a vector field.
• $S$ is a surface in three dimensions.
• $\stackrel{^}{\mathbf{\text{n}}}$ represents a function that gives unit normal vectors to $S$.
• $C$ is the boundary of $S$.
• $C$ is oriented using the right-hand rule, meaning if you point the thumb of your right hand in the direction of a unit normal vector $\stackrel{^}{\mathbf{\text{n}}}$ near the edge of $S$ and curl your fingers, the direction they point indicates the direction you should integrate around $C$.

## Example 1: From a surface integral to line integral

Problem
Let $S$ be the half of a unit sphere centered at the origin that is above the $xy$ plane, oriented with outward facing unit normal vectors. Let $\stackrel{\to }{\mathbf{\text{v}}}\left(x,y,z\right)$ be the vector field defined as follows:
$\stackrel{\to }{\mathbf{\text{v}}}\left(x,y,z\right)=y\stackrel{^}{\mathbf{\text{i}}}$
Compute the following surface integral:
${\iint }_{S}\stackrel{\to }{\mathbf{\text{v}}}\cdot d\mathrm{\Sigma }$

Solution
Remember, Stokes' theorem relates the surface integral of the curl of a function to the line integral of that function around the boundary of the surface. This means we will do two things:
• Step 1: Find a function whose curl is the vector field $y\stackrel{^}{\mathbf{\text{i}}}$
• Step 2: Take the line integral of that function around the unit circle in the $xy$-plane, since this circle is the boundary of our half-sphere.
Concept check: Find a vector field $\mathbf{\text{F}}\left(x,y,z\right)$ satisfying the following property:
$\mathrm{\nabla }×\mathbf{\text{F}}=y\stackrel{^}{\mathbf{\text{i}}}$
There are multiple ways to do this, but one in particular will make our lives easiest. In the one I'm thinking of, the $\stackrel{^}{\mathbf{\text{i}}}$ and $\stackrel{^}{\mathbf{\text{j}}}$ components are $0$, while the $\stackrel{^}{\mathbf{\text{k}}}$ component is non-zero. Can you find it?
$\mathbf{\text{F}}\left(x,y,z\right)=0\phantom{\rule{0.167em}{0ex}}\stackrel{^}{\mathbf{\text{i}}}+0\phantom{\rule{0.167em}{0ex}}\stackrel{^}{\mathbf{\text{j}}}+$
$\stackrel{^}{\mathbf{\text{k}}}$

The surface $S$ is defined to be the portion of the unit sphere above the $xy$-plane. The boundary of this hemisphere is the unit circle on the $xy$-plane.
Concept check: Both of the following parameterize the unit circle on the $xy$-plane, but each with a different orientation. Which one corresponds with the orientation of the hemisphere above the $xy$-plane with outward-facing unit normal vectors? ("Correspond" in the sense that we can apply Stokes' theorem.)

Concept check: Let $C$ represent the boundary of the surface $S$. Use the parameterization of $C$ that you just chose, together with the definition of $\mathbf{\text{F}}$ that you found in the question before that, to solve the following line integral.
${\oint }_{C}\mathbf{\text{F}}\cdot d\mathbf{\text{r}}=$

## Example 2: Wind through a butterfly net

Problem
Suppose you have a butterfly net with a square-shaped rim, and the wind is blowing through the net. Think about the square rim positioned in space on the $yz$-plane such that its four corners are at the following four points:
$\left[\begin{array}{c}0\\ 1\\ 1\end{array}\right]\phantom{\rule{2em}{0ex}}\left[\begin{array}{c}0\\ -1\\ 1\end{array}\right]\phantom{\rule{2em}{0ex}}\left[\begin{array}{c}0\\ -1\\ -1\end{array}\right]\phantom{\rule{2em}{0ex}}\left[\begin{array}{c}0\\ 1\\ -1\end{array}\right]$
Furthermore, let the net be some surface emerging from this rim in the positive $x$-direction.
Suppose the velocity vector field for the wind is given by the following function:
$\begin{array}{rl}& \\ & \mathbf{\text{F}}=\left[\begin{array}{c}{y}^{2}\\ {z}^{2}\\ {x}^{2}\end{array}\right]\end{array}$
Assuming the air has a uniform density of $1\phantom{\rule{0.167em}{0ex}}\text{kg}/{\text{m}}^{3}$, how much air passes through your net per unit time? Specifically, suppose air going from the inside of the net to the outside counts positively towards this sum, and air going from the outside to the inside counts negatively.

Step 1: Dissecting the question
Before anything, we need to compose our thoughts and piece together how this physics-sounding problem is a Stokes' theorem question.

Concept check: More specifically, which of the following integrals represents the answer to the question? Let $S$ denote the surface of the butterfly net, while $C$ is the square rim of that net sitting in the $yz$-plane.

Really, this is all just a way to give a physical interpretation to a surface integral through a vector field.
Step 2: Applying Stokes' theorem
What might feel weird about this problem, and what suggests that you will need Stokes' theorem, is that the surface of the net is never defined! All that is given is the boundary of that surface: A certain square in the $yz$-plane.
If we can find a way to express $\mathbf{\text{F}}\left(x,y,z\right)$ as the curl of some other vector field, say $\mathbf{\text{G}}\left(x,y,z\right)$, we will be able to apply Stokes' theorem to this problem as follows:
$\underset{\text{Target flux integral}}{\underset{⏟}{{\iint }_{S}\left(\mathbf{\text{F}}\cdot \stackrel{^}{\mathbf{\text{n}}}\right)\cdot d\mathrm{\Sigma }}}=\underset{\text{Stokes’ theorem}}{\underset{⏟}{{\iint }_{S}\left(\mathrm{\nabla }×\mathbf{\text{G}}\right)\cdot \stackrel{^}{\mathbf{\text{n}}}\phantom{\rule{0.278em}{0ex}}d\mathrm{\Sigma }={\int }_{C}\mathbf{\text{G}}\cdot d\mathbf{\text{r}}}}$
This is analogous to performing the integral $\int f\left(x\right)\phantom{\rule{0.167em}{0ex}}dx$ in single-variable calculus, where you have to find a new function with the property ${g}^{\prime }\left(x\right)=f\left(x\right)$, which then lets you compute the integral based on the boundary values. In this case, we are looking for the "anti-curl" of $\mathbf{\text{F}}$, so to speak, which will let us compute the surface integral based on the values of this anti-curl function on the boundary of the surface.
Unlike single-variable calculus, not all vector fields $\mathbf{\text{F}}$ have such an anti-curl function. Luckily for us, this particular function is one of the special ones that do.
$\mathbf{\text{F}}=\left[\begin{array}{c}{y}^{2}\\ {z}^{2}\\ {x}^{2}\end{array}\right]$
Concept check: Find a vector field $\mathbf{\text{G}}\left(x,y,z\right)$ satisfying the property $\mathrm{\nabla }×\mathbf{\text{G}}=\mathbf{\text{F}}$.
$\mathbf{\text{G}}\left(x,y,z\right)=$
$\stackrel{^}{\mathbf{\text{i}}}+$
$\stackrel{^}{\mathbf{\text{j}}}+$
$\stackrel{^}{\mathbf{\text{k}}}$

Step 3: Compute the line integral
Given this construction for $\mathbf{\text{G}}$, the final step is to compute the right-hand-side line integral in our core equation:
$\underset{\text{Target flux integral}}{\underset{⏟}{{\iint }_{S}\left(\mathbf{\text{F}}\cdot \stackrel{^}{\mathbf{\text{n}}}\right)\cdot d\mathrm{\Sigma }}}=\underset{\text{Stokes’ theorem}}{\underset{⏟}{{\iint }_{S}\left(\mathrm{\nabla }×\mathbf{\text{G}}\right)\cdot \stackrel{^}{\mathbf{\text{n}}}\phantom{\rule{0.278em}{0ex}}d\mathrm{\Sigma }=\stackrel{\text{Compute this guy now.}}{\stackrel{⏞}{{\int }_{C}\mathbf{\text{G}}\cdot d\mathbf{\text{r}}}}}}$
In this context, the curve $C$ represents the $2×2$ square in the $yz$-plane with vertices at the following four points:
$\left[\begin{array}{c}0\\ 1\\ 1\end{array}\right]\phantom{\rule{2em}{0ex}}\left[\begin{array}{c}0\\ -1\\ 1\end{array}\right]\phantom{\rule{2em}{0ex}}\left[\begin{array}{c}0\\ -1\\ -1\end{array}\right]\phantom{\rule{2em}{0ex}}\left[\begin{array}{c}0\\ 1\\ -1\end{array}\right]$
Before computing the line integral around this square, it needs to be oriented in a way that aligns with the orientation of the butterfly net surface $S$.
Concept check: Given that the butterfly net lies in the positive $x$-direction away from the square $C$, and is oriented with outward-facing unit normal vectors, how should $C$ be oriented so that Stokes' theorem can be applied? Answer this question from the perspective of standing on the positive $x$-axis, and looking directly at $C$.

Concept check: Our construction of $\mathbf{\text{G}}$ looks like this:
$\mathbf{\text{G}}=\frac{1}{3}\left[\begin{array}{c}{z}^{3}\\ {x}^{3}\\ {y}^{3}\end{array}\right]$
Given this, and given the orientation of the square $C$ that you just specified, finish the problem by computing the following line integral:
${\int }_{C}\mathbf{\text{G}}\cdot d\mathbf{\text{r}}=$

## Summary

• Stokes' theorem can be used to turn surface integrals through a vector field into line integrals.
• This only works if you can express the original vector field as the curl of some other vector field.
• Make sure the orientation of the surface's boundary lines up with the orientation of the surface itself.

## Want to join the conversation?

• In the second example G turns out to be 1/3(z^3,x^3,y^3), but then it's changed to 1/3(y^3,z^3,x^3). Is that a mistake?
• Yes, it appears to be a mistake. The wrong vector G is used for the remainder of the problem. Using the correct vector, I got a final result of positive 4/3.
• In the second example, second to last question, the unit normal vector’s direction is negative x-axis(because air going to outside counts positively). so when we are standing on the positive x-axis, the C’s orientation should be clockwise.
• I guess it's worth noting that in the second example you could as well compute a surface integral along the 2x2 square just by knowing that there is such a vector field G that curl G = F.
And it is rather simple:
Integrate y^2 from -1 to 1 and multiply by 2
• in the definition of curl, you take the gradient of F and use that in the integral for stoke's theorem, so why in these examples are we finding the 'anti-curl'? why cant we just find the curl of F?
• In this butterfly net problem, F is the result of cross-product, if we want to use the double integral to evaluate the result, we also need the normal vector expression on the net, which is not given in the example
(1 vote)
• In the Butterfly net example the density of air is taken as 1 kg/m^3. How would the answer change if the density was something else?
• Can we have an example where you solve a line integral using Stoke's?
• In the first example, where's the normal to the patch at each point ? We're looking for function F curl of which is V, but the normal vector is not mentioned at all, though Stoke's theorem requires it. My first though would have been to look for (curlF dot n = v), and n is not constant ! Isn't it ? It's a normal to the patch on the surface and not a normal to the plane in which contour resides.
(1 vote)
• In the second example while finding G vector from ∇×G=F we need G1, G2 and G3 (i, j and k components of G vector ) how did you write G3 =(y^3)/3 from
∂G3/∂y-∂G2/∂z=y^2?
By seeing i can tell that u have integrated the eqn w r to dy
so int[(∂G3/∂y)*dy]−int[(∂G2/∂z)*dy]=integrate[(y^2)*dy]
From the above eqn how did you got G3 =(y^3)/3?
(1 vote)
• We did not take the integral of both sides but just guessed a particular solution. If we assume that ∂G2/∂z = 0, then naturally G3 = (y^3)/3.
(1 vote)
• I am confused. In the example where we need to find the anti-curl of F, why is the i component of G (z^3/3) without a negative sign? According to this course and all other sources, the curl is the determinant of the matrix with the partial derivative operators and the vector field components. Thus, i would assume the j component of this matrix would be subtracted (by the definition of the determinant) and the i component of G would be -z^3/3. Any help would be appreciated.
(1 vote)
• how is the gradient of G equal to F in the second example? How can you make that assumption?