TITLE: How would you discover Stokes's theorem?
QUESTION [72 upvotes]: Let $S$ be a smooth oriented surface in $\mathbb R^3$ with boundary $C$, and let $f: \mathbb R^3 \to \mathbb R^3$ be a continuously differentiable vector field on $\mathbb R^3$.

Stokes's theorem states that
$$
\int_C f \cdot dr = \int_S (\nabla \times f) \cdot dA.
$$
In other words, the line integral of $f$ over the curve $C$ is equal to the integral of the curl of $f$ over the surface $S$.
Here the orientation of the boundary $C$ is induced by the orientation of $S$.
Question: How might somebody have derived or discovered this formula? Where does this formula come from?
The goal is to provide an intuitive explanation of Stokes's theorem, rather than a rigorous proof.
(I'll post an answer below.)

REPLY [4 votes]: A first simplification is that in Stokes' theorem, everything is happening on the surface. So in a certain sense it is a 2D theorem, not a 3D theorem. If we restrict to the parametrisation on the surface, Stokes' theorem is precisely Green's theorem.
So: how would you discover Green's theorem?
Let us start with a more intuitive theorem: the divergence theorem. The divergence theorem says that if you have a steady flow of water with a bunch of sources and sinks, then for any volume $V$ we pick, the net amount of water created inside $V$ is equal to the net amount water flowing through the surface of $V$.
I hope the idea behind this theorem is intuitive enough, even though translating it into formal language is another matter.
Notice now that there surely is a 2D version of the divergence theorem, where all the flowing of the water is happening in the plane. That theorem says that the net source in an area is equal to the net flow through the boundary curve of the area.
As it turns out, this is precisely Green's theorem. This is very unclear the way it is usually presented, where Green's theorem says something like "the amount of swirly in an area is equal to the line integral along the boundary", whatever that means.
Fortunately, it becomes much clearer when we rotate each vector of the vector field by $90$ degrees. Rotating the vector field by $90$ degrees turns every bit of swirly into a bit of divergence! And it turns the line integral along the curve into the flow through the curve, a much more intuitive concept.
If we look at the statement it becomes more clear. The usual statement is if you have a vector field $(L,M)$ then we have
$$\oint Ldx + Mdy = \iint \left(\frac{\partial M}{\partial x} - \frac{\partial L}{\partial y}\right)\,dxdy$$
Notice that rotating by $90$ degrees gives $(L,M) \mapsto (-M,L)$ so we get
$$\oint Ldy - Mdx = \iint \left(\frac{\partial L}{\partial x} + \frac{\partial M}{\partial y}\right)\,dxdy$$
We see the 2D divergence $\frac{\partial L}{\partial x} + \frac{\partial M}{\partial y}$ on the right hand side, and on the left we see $$Ldy - Mdx = (L,M) \cdot (dy,-dx) = (L,M) \cdot \hat{n},$$ i.e. the flow through the boundary.