Flux Integral Calculator

Measure outward flow across a closed curve and verify the divergence theorem numerically.

Flux Integral Calculator

Outward flux of F = ⟨P, Q⟩ across a closed curve, verified by the 2D divergence theorem.

What Is a Flux Integral?

A flux integral measures the net rate at which a vector field flows outward across a closed curve. For a field F = ⟨P, Q⟩ and a curve C bounding a region D, the outward flux is

C F · n ds = ∫∫D (Px + Qy) dA

where n is the outward unit normal. The equality is the two-dimensional divergence theorem (also called Green's theorem in flux form): the total outward flow through the boundary equals the integral of the field's divergence over the enclosed region. Divergence div F = Px + Qy measures how much the field spreads out at each point, a source where it is positive, a sink where negative, so summing it inside gives the net production, which must escape through the boundary. This calculator computes the flux both ways, as a boundary line integral and as a divergence area integral, and confirms they agree, making the divergence theorem tangible.

How to Use the Flux Integral Calculator

Enter the field components P and Q, choose a circular or square region, and set its center and size. The steps state the divergence theorem, compute the divergence Px + Qy, evaluate the flux as a boundary integral and as a divergence double integral, confirm they match, and interpret the sign (net source, net sink, or balanced). The graph shows the field arrows with the boundary curve. This is the flux companion to the circulation-form Green's theorem calculator, uses the divergence, and its 3D analog is the surface flux underlying the full divergence theorem.

Worked Example

Take the radial field F = ⟨x, y⟩, which points straight outward everywhere, across the circle of radius 2. Its divergence is

div F = ∂x/∂x + ∂y/∂y = 1 + 1 = 2

constant everywhere. By the divergence theorem, the flux is 2 times the area of the disk: 2 · π(2)² = 8π ≈ 25.13. Computing it directly as a boundary integral gives the same 8π, confirming the theorem. The positive flux means the region is a net source: this field pumps outward, more flows out than in, exactly as a uniform expansion should. Contrast the rotation field F = ⟨−y, x⟩ (the second chip): its divergence is ∂(−y)/∂x + ∂x/∂y = 0 + 0 = 0, so the flux is zero. The field swirls around the center without any net outward flow, every bit that enters one side exits another. This is the signature of an incompressible, divergence-free flow, and the contrast between the two examples captures the whole meaning of flux: it detects net expansion, not rotation.

Why Boundary Flux Equals Interior Divergence

The divergence theorem is a conservation statement, and its logic is worth internalizing. Divide the region D into many tiny cells. For each cell, the outward flux across its own boundary is approximately (div F) times the cell's area, because divergence is defined as the outward flux per unit area in the small-cell limit. Now add up the flux over all cells. Along every internal edge shared by two adjacent cells, the outward flux from one cell is the inward flux to its neighbor, so these contributions cancel in pairs. Only the outermost edges, the ones on the boundary C of the whole region, have no neighbor to cancel with, so their contributions survive. The result: the sum of all the little divergences (which is the double integral of div F) equals the flux across the outer boundary alone. This telescoping cancellation of interior fluxes is exactly parallel to how the Fundamental Theorem of Calculus works in one dimension, and it is the same idea behind Green's, Stokes', and the general divergence theorems.

Common Mistakes to Avoid

  • Confusing flux with circulation. Flux uses the outward normal (flow across the boundary) and the divergence; circulation uses the tangent (flow along the boundary) and the curl. The rotation field has zero flux but nonzero circulation, they measure different things.
  • Getting the divergence wrong. Divergence is Px + Qy, each component differentiated by its own variable. Mixing the derivatives (like Py + Qx) computes something unrelated.
  • Wrong orientation of the normal. The divergence theorem uses the outward normal. An inward normal flips the sign of the flux, turning sources into apparent sinks.
  • Forgetting the curve must be closed. The divergence theorem applies to closed curves bounding a region. For an open arc, the flux is just a line integral with no divergence shortcut available.
  • Assuming zero divergence means zero field. A divergence-free field can be strong (the rotation field has large arrows) but produces no net flux because its flow is purely rotational, spreading nowhere.

Real-World Applications

Flux integrals and the divergence theorem are among the most physically important tools in all of mathematics, because they express conservation laws. In fluid dynamics, the flux of the velocity field across a closed surface is the net volume of fluid leaving the region per unit time, and the divergence theorem is how the continuity equation (conservation of mass) is derived: a divergence-free velocity field describes an incompressible fluid, which is why div v = 0 is a defining equation of water flow and low-speed aerodynamics. In electromagnetism, Gauss's law states that the electric flux out of a closed surface equals the enclosed charge divided by a constant, and it is one of Maxwell's four equations; the divergence theorem converts it between its integral form (flux) and differential form (divergence equals charge density), and the same holds for the magnetic field's zero-divergence law (no magnetic monopoles).

Frequently Asked Questions

What does a flux integral measure?

The net rate at which a vector field flows outward across a closed curve (in 2D) or surface (in 3D). Positive flux means more flows out than in (a net source inside); negative means net inflow (a sink); zero means inflow and outflow balance.

What is the divergence theorem?

It equates the outward flux across a closed boundary with the integral of the field's divergence over the enclosed region: ∮ F · n ds = ∫∫ div F dA. It converts a boundary integral into an interior one, expressing that net production inside equals net escape through the boundary.

What is divergence?

Divergence div F = Px + Qy measures how much a field spreads out at a point, the outward flux per unit area in the small-region limit. Positive divergence marks a source (field emanating), negative marks a sink (field converging), zero marks incompressible flow.

How is flux different from circulation?

Flux measures flow across the boundary using the outward normal and relates to divergence; circulation measures flow along the boundary using the tangent and relates to curl. A rotating field has zero flux but nonzero circulation; a spreading field has nonzero flux but may have zero circulation.

Why does the rotation field have zero flux?

Because F = ⟨−y, x⟩ has divergence zero: it swirls around the center without spreading out or in. Everything that flows across one part of the boundary is balanced by flow across another, so the net outward flux is zero even though the field is strong and everywhere nonzero.

Why do interior contributions cancel in the divergence theorem?

When you sum the flux over many small cells, each internal edge is shared by two cells with opposite outward normals, so their flux contributions cancel. Only the outer boundary edges survive, leaving the total interior divergence equal to the boundary flux, a telescoping cancellation.

Does the orientation of the normal matter?

Yes. The divergence theorem uses the outward-pointing normal. Using the inward normal negates the flux, which would incorrectly report a source as a sink. Always orient the normal outward from the enclosed region for the standard theorem.

How is this related to Gauss's law?

Gauss's law is the divergence theorem applied to the electric field: the flux out of a closed surface equals the enclosed charge (over a constant). Converting between its integral form (flux) and differential form (divergence equals charge density) is exactly the divergence theorem in action, one of Maxwell's equations.

What does zero divergence mean physically?

Incompressibility: the field neither creates nor destroys anything, so what flows into any region flows out. For fluid velocity, div v = 0 means the fluid is incompressible (constant density); for the magnetic field, zero divergence means no magnetic monopoles exist.

How does the 2D flux integral extend to 3D?

In three dimensions, flux is a surface integral ∫∫ F · n dS over a closed surface, and the divergence theorem equates it to the triple integral of div F = Px + Qy + Rz over the enclosed solid. The 2D version here is the accessible model of the 3D theorem central to physics.