Vector Calculus Theorems
Theorem Regions
Draw the region of a vector calculus theorem with its oriented boundary. Stokes and the divergence theorem use the existing 3D viewer.
Generate Graph draws greens_theorem(-y,x,circle(0,0,1)) as the unit disk. The boundary is counterclockwise, direction arrows follow that orientation, and the vector field starts visible. The filled region is the domain of the double integral, and the caption reports 2*pi. Zoom and pan stay on the existing board.
stokes_theorem(-y,x,0,disk(0,0,1)) draws the flat disk in the existing 3D viewer. Surface normals point upward and the boundary arrows follow the right-hand rule, so both sides of Stokes' theorem use the same orientation. The value is 2*pi. divergence_theorem(x,y,z,sphere(0,0,0,1)) keeps the closed unit sphere and the value 4*pi. Orbit, zoom, and pan stay on that viewer.
Equation
greens_theorem(-y,x,circle(0,0,1))
Graph preview
When a vector calculus theorem applies
Green's theorem says the circulation of a planar field F = (P, Q) around a positively oriented simple closed curve equals the double integral of ∂Q/∂x − ∂P/∂y over the enclosed region. Positive orientation is counterclockwise. The circulation and the double integral are computed separately. A value is returned only when those two sides agree. Clockwise orientation changes the sign of both sides. A circle, an ellipse, and a rectangle with x0 < x1 and y0 < y1 are accepted. A zero radius, a reversed rectangle, an unknown region, or a field that is singular inside the region is rejected.
Stokes' theorem says the circulation of F along the oriented boundary of an oriented surface equals the flux of curl F through the surface. The normal and the boundary follow the right-hand rule. An upward disk in a horizontal plane has normal +k and a counterclockwise boundary. Downward reverses both. A parametric surface uses r_u × r_v, and the boundary of the parameter rectangle is traversed so that it matches that normal. A surface whose partial derivatives are parallel has no normal. The divergence theorem is unchanged: outward flux through a closed sphere, ellipsoid, cylinder, or cube equals the triple integral of div F.
Reading the input
greens_theorem(-y,x,circle(0,0,1))— This is a command. The name selects the routine, and the items inside the parentheses are its arguments.
Other versions of this example
These stay on this page so each version keeps the same explanation. Choose Try example to run a version in its Studio workflow, or copy it into the editable field below.
Green's theorem
Expected value 2*pi. The unit disk is oriented counterclockwise, and the curl is 2.
greens_theorem(-y,x,circle(0,0,1))
Stokes' theorem
Expected value 2*pi. The disk is oriented upward, and curl F is (0, 0, 2).
stokes_theorem(-y,x,0,disk(0,0,1))
Divergence theorem
Expected value 4*pi. The sphere is oriented outward, and the divergence is 3.
divergence_theorem(x,y,z,sphere(0,0,0,1))
Try a change
- Add clockwise to greens_theorem(-y,x,circle(0,0,1)). Both the circulation and the double integral change sign, and the value is -2*pi. Adding downward to stokes_theorem(-y,x,0,disk(0,0,1)) gives -2*pi.
- Try greens_theorem(-y/(x^2+y^2), x/(x^2+y^2), circle(0,0,1)). The origin is singular inside the disk, so Green's theorem is not applied.
- Try stokes_theorem(0,0,1,u,0,0,u,0,1,v,0,1). The partial derivatives are parallel, so the surface has no normal.
Generate Graph fills the planar region and draws the oriented boundary together with the vector field. A Stokes surface uses the existing 3D viewer, with normal arrows, boundary direction, and the field. Orbit, zoom, and pan stay on that viewer. The divergence theorem keeps the existing closed-surface picture.