Electromagnetic Theory · Stokes Theorem — Worked Examples

#31 Oriented square circulation, singular vortex and magnetostatic Ampère law

Verify Stokes theorem with directed square edges, then account for the vortex singularity and its connection to a steady line current.

Question

Original English final showing shared-edge cancellation, the unit-square line and curl integrals both equal to minus one third, or the vortex circulation two pi and the line-current Ampère relation.
Match the curve direction to the surface normal. The square result uses the normal component of curl; the vortex disk needs its axis distribution or an excluded inner boundary.

Calculate both sides of Stokes theorem on the unit square, then explain the apparent failure on a disk pierced by a singular vortex. The writing lines use C for the vector curl of A, L for its boundary circulation, and F for the surface integral of normal curl. The original frame also uses C to label the boundary curve; that curve label is distinct from the curl tuple in the writing lines. L_H is magnetic-field circulation. Vector tuples use the stated orthonormal basis. J_x and J_y denote the separate one-dimensional factors of the square surface integral, and L_t is the directed top-edge contribution. The classical theorem requires a continuously differentiable field on an open neighborhood of a suitable oriented, piecewise smooth surface, with its piecewise smooth boundary traversed in the induced positive direction. It equates the closed line integral of A dot the tangent displacement to the surface integral of curl A dot the unit normal. The source’s single integral over S is a surface integral, not a line integral. The phrase “any spanning surface” applies only to surfaces satisfying these domain and regularity conditions, with the same induced oriented boundary. On a small cell, normal curl at a sample point times area approximates circulation; refinement yields the exact integral. Shared-edge integrals cancel exactly because their traversal directions are opposite. A surface with holes has inner boundary components too. The original planar grid illustrates cancellation; its drawn swirl sizes are qualitative. For the square, 0≤x,y≤1 and z=0. Counterclockwise means viewed from the positive z side, giving normal n=e_z. The field is A=(x²y,y²z,z²x) in Cartesian coordinates and its full curl is C=(−y²,−z²,−x²). On the square it is (−y²,0,−x²), so the normal component is −x². Integrating that component over x,y∈[0,1] gives (−1/3) times one, or −1/3. The narration and original closing caption say “curl points along minus z”; in this sign discussion that wording refers to its normal projection. The explicit full-curl equation also has a generally nonzero tangential x component. Do not interpret the caption as saying the entire curl vector lies on the z axis. At x=0 the normal projection vanishes; elsewhere it points toward negative z. Likewise, the circulation sign is an aggregate line integral, not a claim that the field opposes the tangent at every boundary point. Follow the four boundary segments in order: bottom (0,0)→(1,0), right (1,0)→(1,1), top (1,1)→(0,1), then left (0,1)→(0,0). The bottom has A_x=0. On both vertical edges A_y=y²z=0. The top has A_x=x² with x decreasing from one to zero, so its integral is −1/3. The displayed sum groups the three zero terms before the nonzero term; it is not a different traversal order. Reversing both curve and normal gives +1/3 on each side. Reversing only one side breaks the required orientation pairing. The vortex A=(1/ρ)e_phi is defined for cylindrical radius ρ>0 and is independent of φ and z. Its Cartesian expression is (−y,x,0)/(x²+y²). The abbreviated cylindrical curl formula in the source applies to this purely azimuthal field with only radial dependence; it is not the complete formula for every azimuthal field. Its only possible component is C_z=(1/ρ)∂(ρ A_phi)/∂ρ, which vanishes for ρ>0. The original field and its classical curl are undefined on the z axis. A disk crossing the axis therefore fails the classical theorem’s hypotheses. Let R>0 be a fixed circle radius. Traverse the circle once counterclockwise as seen from positive z, so φ increases from zero to 2π radians and the disk normal is +e_z. On the curve A_phi=1/R and the positive tangent displacement has scalar length R d φ. Their dot product is d L=d φ, giving L=2π independent of R. Here d L denotes the scalar circulation contribution after the dot product, not a vector displacement. The water-drain analogy describes circulation direction, not the quantitative radial flow of real water. The source’s “infinite” curl is informal distributional language, not an ordinary pointwise value. Its δ²(ρ) denotes a two-dimensional transverse delta at the axis, not the square of a one-dimensional delta and not simply δ of the scalar radius. In Cartesian transverse coordinates it is δ(x)δ(y); the distributional vector curl is (0,0,2πδ(x)δ(y)). Integration across an upward-facing disk pierced once by the axis gives 2π. A delta distribution is defined by its action under integration against smooth test functions. This extends the source accounting without claiming the singular field has become classically smooth. An ordinary-domain check removes a concentric disk of radius a<R. The annulus has zero classical curl integral, while its induced outer counterclockwise circulation is +2π and its inner clockwise circulation is −2π. They cancel. Shrinking the inner hole does not remove its finite contribution. A smooth regularization A_ε=(−y,x,0)/(ρ²+ε²) has C_z=2ε²/(ρ²+ε²)². Its disk curl integral and circle circulation both equal 2πR²/(R²+ε²), tending to 2π as ε decreases. Pointwise convergence to zero away from the axis does not justify discarding the source under integration. Zero curl outside the axis does not give a single-valued global potential on the punctured plane. A loop winding once about the missing axis cannot contract to a point within that domain and has nonzero circulation. For any closed planar curve avoiding the axis, circulation is 2π times its signed winding number. A reversed loop changes the sign; a loop not enclosing the axis has zero winding and zero circulation. This differs from the inverse-square radial field in three-dimensional space outside one point, which has a single-valued potential there. Scale this normalized vortex by I/(2π) to obtain H_phi=I/(2πρ) for the ideal infinitely long, infinitely thin straight wire carrying steady signed current I along +z. Positive current produces the positive azimuthal direction. A once-positively-linked loop has L_H=I; general signed linking gives the algebraically enclosed current. The source’s “any enclosing loop” assumes that orientation and linking count. Ampère’s magnetostatic law contains physical information: curl H equals current density, with a line-current distribution in this idealization. Stokes theorem converts that physical differential law to its integral form; geometry alone does not establish the electromagnetic law. In time-dependent Maxwell theory the displacement-current contribution must also be included. Symmetry permits easy field-magnitude calculations for the ideal straight wire, but the geometric theorem itself does not require circular symmetry. These qualifications also apply to the recap’s statement that the divergence and Stokes theorems produce Gauss and Ampère laws.

Written solution and narration transcript(shows the full solution)

Below are all the lines written in the notebook together with the full narration transcript.

  1. 1. From local curl to circulation

    Original English final showing shared-edge cancellation, the unit-square line and curl integrals both equal to minus one third, or the vortex circulation two pi and the line-current Ampère relation.
    Match the curve direction to the surface normal. The square result uses the normal component of curl; the vortex disk needs its axis distribution or an excluded inner boundary.
    Stokes theorem
    The divergence theorem connects sources to outward flux.
    Now connect local curl to circulation.
    Use a smooth field and a consistently oriented spanning surface.
    Circulation L equals normal curl flux F:
    L=F\displaystyle L = F
    Why do internal edges cancel?
    Apply the cancellation argument on a surface.
    Subdivide the surface into small oriented cells.
    Normal curl times a small cell area approximates its circulation.
    Sum the cell circulations.
    Each shared edge is traversed in opposite directions.
    Only the boundary edges remain.
    Their sum is the circulation around the full rim.
    Take the refinement limit to obtain Stokes theorem.
    The physical magnetic-field law supplies the Ampère connection.

    Narration transcript

    Hello friends, welcome back. Last time, the divergence theorem took us from local to global: tiny sources summed inside a volume equal the flux through its skin. Today, its twin sister, and the last tool in our vector-calculus box: Stokes' theorem. The statement: the circulation of A around a closed curve C equals the flux of the curl of A through any surface S that hangs on that curve. In symbols: the closed line integral of A dot dl, equals the surface integral of curl A, dot dS. Why does it work? It is the same trick as last time, one dimension down. Tile the surface into millions of tiny cells. Each cell carries its own tiny circulation — its curl times its area. Now add them all up. Every interior edge is walked twice, once by each neighboring cell, in opposite directions — so those contributions cancel. The only edges that survive are the outer ones, and together they form exactly the boundary curve C. So the sum of all the tiny swirls equals one big walk around the rim. That is Stokes' theorem. And just as the divergence theorem handed us Gauss's law at the end of the last video, this theorem will hand us Ampère's law before this one ends.

  2. 2. Oriented unit-square verification

    Original English final showing shared-edge cancellation, the unit-square line and curl integrals both equal to minus one third, or the vortex circulation two pi and the line-current Ampère relation.
    Match the curve direction to the surface normal. The square result uses the normal component of curl; the vortex disk needs its axis distribution or an excluded inner boundary.
    Worked example 1: the oriented unit square
    Cartesian field components:
    A=(x2y,y2z,z2x)\displaystyle A = \left(x^{2} y, y^{2} z, z^{2} x\right)
    Use the unit square in the xy plane.
    Traverse its rim counterclockwise when viewed from positive z.
    Match the normal to the boundary direction.
    Apply the right-hand rule.
    The right thumb points toward positive z.
    Cartesian unit normal:
    n=(0,0,1)\displaystyle n = \left(0, 0, 1\right)
    Compute the surface integral of normal curl.
    Full Cartesian curl components:
    C=(y2,z2,x2)\displaystyle C = \left(-y^{2}, -z^{2}, -x^{2}\right)
    Normal curl on the square:
    Cz=x2\displaystyle C_{z} = -x^{2}
    Integrate over both unit coordinate intervals.
    Integral over x from zero to one:
    Jx=13\displaystyle J_{x} = -\frac{1}{3}
    Integral over y from zero to one:
    Jy=1\displaystyle J_{y} = 1
    Surface result:
    F=13\displaystyle F = -\frac{1}{3}
    Now integrate along all four directed edges.
    The y component simplifies on this plane.
    On the square:
    Ay=y20=0\displaystyle A_{y} = y^{2}\cdot 0 = 0
    Both edges parallel to the y axis contribute zero.
    On the bottom edge:
    Ax=x20=0\displaystyle A_{x} = x^{2}\cdot 0 = 0
    The bottom contribution is zero.
    Only the top edge contributes.
    At the top, traverse x from one down to zero.
    Directed top-edge integral:
    Lt=13\displaystyle L_{t} = -\frac{1}{3}
    Sum all four contributions:
    L=0+0+013\displaystyle L = 0 + 0 + 0 -\frac{ 1}{3}
    Line result:
    L=13\displaystyle L = -\frac{1}{3}
    Both sides agree:
    L=F=13\displaystyle L = F = -\frac{1}{3}
    The normal component of curl opposes the chosen positive normal.
    Reversing the boundary and normal reverses both signs.
    Stokes theorem is verified.

    Narration transcript

    Worked example one — a unit square. The field is the one we have carried since PS05: x squared y x-hat, plus y squared z y-hat, plus z squared x z-hat. This time the region is not a volume but a surface: the unit square in the z equals zero plane, x and y each from zero to one. Its boundary is the square's rim, and we will walk it counter-clockwise. One bookkeeping rule before we compute: the right-hand rule. Curl the fingers of your right hand along the walking direction, counter-clockwise. Your thumb points up — plus z-hat. So the surface normal is z-hat. Surface side first. The curl we do not even need to compute, because PS06 already did: curl of A equals minus y squared x-hat, minus z squared y-hat, minus x squared z-hat. We only need the component along our normal, z-hat, evaluated on the plane z equals zero: minus x squared. Integrate it over the square. Minus x squared, dx from zero to one, gives minus one third. The y integral gives one. Surface side: minus one third. Now the line side — four edges. First, a gift. The y component of A is y squared z, and on our plane z is zero. So A y vanishes everywhere on the square, and the two vertical edges, where we move along y, contribute nothing. The bottom edge, y equals zero: there A x is x squared times y, which is x squared times zero. Zero again. Everything hangs on the top edge. There y equals one, so A x is x squared — and we walk from x equals one back to x equals zero, against the x direction. The integral of x squared from one to zero is minus one third. Add the four edges: zero, zero, zero, minus one third. Line side: minus one third. Minus one third equals minus one third — and savor that minus sign for a second. The curl points along minus z, while our walk circles the plus z way, so the circulation comes out negative. Even the sign agrees. The theorem is verified.

  3. 3. Singular vortex and Ampère’s law

    Original English final showing shared-edge cancellation, the unit-square line and curl integrals both equal to minus one third, or the vortex circulation two pi and the line-current Ampère relation.
    Match the curve direction to the surface normal. The square result uses the normal component of curl; the vortex disk needs its axis distribution or an excluded inner boundary.
    Worked example 2: a singular vortex
    Cylindrical components for positive rho:
    A=(0,1ρ,0)\displaystyle A = \left(0,\frac{ 1}{\rho }, 0\right)
    The field circles the z axis and diverges in magnitude near it.
    The swirling-water picture illustrates direction only.
    Choose a positively oriented circle and its upward-facing disk.
    First inspect curl away from the singular axis.
    For this azimuthal field:
    Cz=(1ρ)(ρAφ)ρ\displaystyle C_{z} = \left(\frac{1}{\rho }\right)\cdot \frac{\partial \left(\rho A_{\varphi }\right)}{\partial \rho }
    Radial product:
    ρAφ=ρ(1ρ)=1\displaystyle \rho A_{\varphi } = \rho \cdot \left(\frac{1}{\rho }\right) = 1
    This product is constant away from the axis.
    Its radial derivative is zero.
    Classical curl away from the axis:
    C=(0,0,0)\displaystyle C = \left(0, 0, 0\right)
    The full disk still includes the excluded axis.
    Compute the boundary circulation directly.
    On the fixed-radius circle:
    Aφ=1R\displaystyle A_{\varphi } =\frac{ 1}{R}
    Scalar circulation element:
    dL=(1R)(Rdφ)=dφ\displaystyle d L = \left(\frac{1}{R}\right)\left(R d \varphi \right) = d \varphi
    Integrate the azimuth from zero to two pi radians.
    Positive circle circulation:
    L=2π\displaystyle L = 2\pi
    The mismatch exposes the invalid smoothness assumption.
    The naive disk calculation omitted the singular source.
    The boundary calculation gives two pi.
    The circle radius cancels completely.
    Every once-traversed positive circle has the same result.
    The distributional curl is supported on the z axis.
    Classical pointwise curl is undefined at that axis.
    A two-dimensional delta represents the concentrated source.
    Distributional normal curl:
    Cz=2πδ(x)δ(y)\displaystyle C_{z} = 2\pi \delta \left(x\right) \delta \left(y\right)
    Distributional disk integral:
    F=2π\displaystyle F = 2\pi
    Alternatively exclude a small disk and include its inner boundary.
    Connect the result to a steady line current.
    Scale factor:
    k=I2π\displaystyle k =\frac{ I}{2\pi }
    Magnetic cylindrical components:
    H=(0,I2πρ,0)\displaystyle H = \left(0,\frac{ I}{2\pi \rho }, 0\right)
    For one positive linking:
    LH=I\displaystyle L_{H} = I
    This is the magnetostatic Ampère circulation law.
    Combine Stokes geometry with the physical current-source law.
    Keep current direction and loop orientation consistent.

    Narration transcript

    Worked example two — and just like last time, this is where the real lesson lives. Take the vortex field: A equals one over rho, in the phi-hat direction. In words: the field circles around the z axis, and it grows stronger as you approach the axis. Picture water swirling around a drain. Let C be a circle of radius R around the axis, and S the flat disk it bounds. Surface side first — naively. For an azimuthal field in cylindrical coordinates, the curl is one over rho, times the partial derivative with respect to rho, of rho times A phi, in the z-hat direction. But rho times A phi is rho times one over rho — just one. A constant. Its derivative is zero. So away from the axis the curl is exactly zero, and the naive surface integral gives zero. Hold that. Line side. On the circle of radius R, the field has magnitude one over R, and the path element is R d phi, pointing the same way. Multiply them: the R's cancel, leaving just d phi. Walk the full circle, phi from zero to two pi. The circulation is two pi. Stop and feel the contradiction, again. The surface side said zero. The line side said two pi. And notice something striking: the answer does not even depend on R. Any circle around the axis, big or small, gives exactly two pi. All the swirl is concentrated in one place — the axis itself, where the field blows up. Just like the point charge last time, the curl there is not zero. It is infinite: a two-dimensional delta function. Curl of phi-hat over rho equals two pi, times the two-dimensional delta of rho, in z-hat. Integrate that over the disk, and the surface side gives two pi as well. The theorem is restored — once we are honest about the singularity. And now the payoff. Multiply the field by I over two pi. One over rho phi-hat becomes I over two pi rho, phi-hat — and that is exactly the magnetic field H of a straight wire carrying current I. The circulation of H around any loop enclosing the wire becomes I — the enclosed current. That is Ampère's law. Ampère's law is Stokes' theorem applied to the vortex field, with the singularity — the wire itself — properly handled. Every Amperian-loop calculation in magnetostatics rides on this.

  4. 4. Stokes theorem recap

    Original English final showing shared-edge cancellation, the unit-square line and curl integrals both equal to minus one third, or the vortex circulation two pi and the line-current Ampère relation.
    Match the curve direction to the surface normal. The square result uses the normal component of curl; the vortex disk needs its axis distribution or an excluded inner boundary.
    Stokes theorem recap
    For a suitable oriented surface:
    L=F\displaystyle L = F
    Normal curl over the surface equals boundary circulation.
    Two examples illustrate the applicability conditions.
    First use the smooth polynomial field on the unit square.
    Square surface result:
    F=13\displaystyle F = -\frac{1}{3}
    Square line result:
    L=13\displaystyle L = -\frac{1}{3}
    The orientation fixes the negative sign.
    Then use the vortex outside its singular axis.
    The missing axis source restores the disk result of two pi.
    For one positive linking:
    LH=I\displaystyle L_{H} = I
    Review the eight vector-calculus problem sessions.
    Gradient, divergence and curl describe local variation.
    The physical source laws connect the two integral theorems to electromagnetism.
    Use the correct operator and its domain.
    These bridges relate differential laws to suitable integral forms.
    Carry the orientation and smoothness checks into later problems.

    Narration transcript

    Quick recap. Stokes' theorem says the circulation of a vector field around a closed curve equals the flux of its curl through any surface spanning that curve. Local swirls, summed up, equal one walk around the rim. Two worked examples. First, the unit square with our running polynomial field. Surface side, minus one third. Line side, minus one third — sign and all. A clean, no-tricks verification. Second, the vortex field, one over rho phi-hat. The naive surface integral gave zero, the circulation gave two pi, and the mismatch was the whole point: the curl hides on the axis as a delta function. Scale by I over two pi, and out comes Ampère's law — the circulation of H equals the enclosed current. Now step back and look at what we have built across these eight problem videos. Gradient, divergence, curl. Then the divergence theorem turned local sources into Gauss's law, and today Stokes' theorem turned local swirls into Ampère's law. The vector-calculus toolbox is complete. These two theorems are the bridges between Maxwell's differential and integral forms, and from here on, we will use them everywhere. See you in the next one.

Source video: Electromagnetic Theory (v2) #31 | Problem Solving #08: Stokes' Theorem & Ampère's Law (8:33)