Divergence Calculator
Find the divergence of a 3D vector field with monomial components.
Enter P(x), Q(y), R(z) coefficients and evaluation point to get the scalar result.
Divergence measures how much a vector field spreads out from a point.
Positive divergence means the field behaves as a source, with fluid flowing outward. Negative divergence means it behaves as a sink, with fluid flowing inward. Zero divergence is incompressible flow: whatever enters a region also leaves it.
For a 3D vector field F = (P, Q, R), the divergence is:
div F = dP/dx + dQ/dy + dR/dz
This calculator uses component functions that depend on a single variable each: P(x) = ax^m, Q(y) = by^n, R(z) = cz^r. The partial derivatives are:
dP/dx = max^(m-1), dQ/dy = nby^(n-1), dR/dz = rcz^(r-1)
Sum those three values at your evaluation point (x0, y0, z0) to get the scalar divergence.
Worked example: F = (2x^2, 3y, z^3) at point (1, 2, 1). Here a=2, m=2, b=3, n=1, c=1, r=3. dP/dx = 4x = 4(1) = 4 dQ/dy = 3 (constant for linear Q) dR/dz = 3z^2 = 3(1) = 3 div F = 4 + 3 + 3 = 10
A divergence of +10 at that point means the field is expanding outward there, acting as a source.
Every one of those figures is a placeholder in the boxes above, so pressing Calculate on the defaults reproduces this example exactly.
The divergence theorem says the total divergence inside a closed region equals the net flux through its surface. This is how Gauss’s law in electromagnetism relates the charge inside a surface to the electric field passing through it.
For vector fields with cross-terms (P depending on y and z as well as x), you need the partial derivatives of those cross-terms too. The curl calculator on this site handles linear fields with all nine coefficients.
One case worth knowing: an exponent of zero makes that component a constant, and the derivative of a constant is zero no matter where you evaluate it. A component like P(x) = 5 contributes nothing to the divergence at any point, including the origin.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.
More Math Calculators
- Double Integral Calculator
- Error Function Calculator
- Extended Euclidean Algorithm Calculator
- F Distribution Calculator
- F-Test Calculator
- Five Number Summary Calculator
- Frequency Distribution Calculator
- Gamma Function Calculator
- Geometric Distribution Calculator
- Golden Rectangle Calculator
- Gradient Calculator
- Hypergeometric Distribution Calculator