Since 2010 · Powering 2M+ tool runs every month
Since 2010
Add to Chrome

My Toolbox

Automatic Mode

No saved tools yet.

Go Premium
Related tools
Curl CalculatorLine Integral CalculatorGradient Calculator (Multivariable)Surface Integral CalculatorDirectional Derivative CalculatorTriple Integral CalculatorDerivative Calculator
Home Page > Math > Calculus

Divergence Calculator

Calculate the divergence of any 2D or 3D vector field with step-by-step partial derivatives. Enter the component functions, get the symbolic divergence, evaluate it at a point, identify sources and sinks, and view a heat map.

Free to useNo sign-up requiredInstant Results
Divergence CalculatorTry it now — free ▼
Examples:
P = F₁(x,y)
Q = F₂(x,y)
Comma-separated coordinates matching the dimension
DIVERGENCE PREVIEW
Enter P and Q to preview

Embed Divergence Calculator Widget

About Divergence Calculator

The Divergence Calculator computes the divergence ∇·F of any 2D or 3D vector field with full step-by-step partial derivative computation. Enter your vector field components P, Q (and R for 3D), optionally evaluate at a specific point, and get the symbolic divergence, source/sink classification, and for 2D fields, an interactive visualization with a divergence heat map and animated particle flow.

What Is Divergence?

The divergence of a vector field \(\mathbf{F}\) is a scalar-valued operator that measures the rate at which the field "spreads out" from a point. For a 3D vector field \(\mathbf{F} = \langle P, Q, R \rangle\):

$$\nabla \cdot \mathbf{F} = \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y} + \frac{\partial R}{\partial z}$$

For a 2D field \(\mathbf{F} = \langle P, Q \rangle\), the divergence is \(\frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y}\). Divergence is a fundamental concept in vector calculus, fluid dynamics, electromagnetism, and differential equations.

Physical Meaning of Divergence

🔴
Source (∇·F > 0)
Fluid flows outward — more leaving than entering. Like water gushing from a fountain.
🔵
Sink (∇·F < 0)
Fluid flows inward — more entering than leaving. Like water draining into a hole.
🟢
Zero (∇·F = 0)
Incompressible flow — what enters equals what leaves. The field is solenoidal.
🔄
Divergence Theorem
Total divergence inside a volume equals the net flux through its boundary surface.

Divergence Formulas and Coordinate Systems

Coordinate SystemDivergence Formula
Cartesian 2D\(\nabla \cdot \mathbf{F} = \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y}\)
Cartesian 3D\(\nabla \cdot \mathbf{F} = \frac{\partial P}{\partial x} + \frac{\partial Q}{\partial y} + \frac{\partial R}{\partial z}\)
Cylindrical\(\nabla \cdot \mathbf{F} = \frac{1}{r}\frac{\partial(rF_r)}{\partial r} + \frac{1}{r}\frac{\partial F_\theta}{\partial \theta} + \frac{\partial F_z}{\partial z}\)
Spherical\(\nabla \cdot \mathbf{F} = \frac{1}{r^2}\frac{\partial(r^2 F_r)}{\partial r} + \frac{1}{r\sin\theta}\frac{\partial(\sin\theta\, F_\theta)}{\partial \theta} + \frac{1}{r\sin\theta}\frac{\partial F_\phi}{\partial \phi}\)

Important Identities Involving Divergence

IdentityFormula
Linearity\(\nabla \cdot (a\mathbf{F} + b\mathbf{G}) = a(\nabla \cdot \mathbf{F}) + b(\nabla \cdot \mathbf{G})\)
Product rule (scalar × vector)\(\nabla \cdot (f\mathbf{F}) = f(\nabla \cdot \mathbf{F}) + \mathbf{F} \cdot (\nabla f)\)
Curl of gradient\(\nabla \cdot (\nabla \times \mathbf{F}) = 0\) (always)
Laplacian\(\nabla \cdot (\nabla f) = \nabla^2 f\) (divergence of gradient = Laplacian)
Divergence theorem\(\displaystyle\iiint_V (\nabla \cdot \mathbf{F})\,dV = \unicode{x222F}_S \mathbf{F} \cdot d\mathbf{S}\)

Applications of Divergence

FieldApplicationWhat Divergence Represents
ElectromagnetismGauss's Law\(\nabla \cdot \mathbf{E} = \rho/\varepsilon_0\) — charge density creates electric field divergence
ElectromagnetismMagnetic field\(\nabla \cdot \mathbf{B} = 0\) — no magnetic monopoles exist
Fluid DynamicsContinuity equation\(\nabla \cdot \mathbf{v} = 0\) for incompressible flow
Heat TransferHeat equationDivergence of heat flux relates to temperature change
General RelativityEinstein field equationsDivergence-free condition on stress-energy tensor

How to Use the Divergence Calculator

  1. Choose dimension: Select 2D for fields F = ⟨P, Q⟩ or 3D for F = ⟨P, Q, R⟩ using the toggle buttons.
  2. Enter component functions: Type each component function (P, Q, and optionally R) using standard notation. Use ^ for exponents, * for multiplication, and functions like sin(x), cos(y), exp(x), ln(x), sqrt(x). Implicit multiplication is supported (e.g., 2x = 2*x).
  3. Enter an evaluation point (optional): Provide comma-separated coordinates to evaluate the divergence numerically and classify the point as a source, sink, or incompressible.
  4. Click Compute Divergence: View the symbolic divergence formula, step-by-step partial derivative computation, numerical evaluation, and source/sink classification.
  5. Explore the visualization: For 2D fields, view the vector field arrows with a color-coded divergence heat map (red = source, blue = sink) and animated particle flow showing the field behavior.

Worked Example

Find the divergence of \(\mathbf{F}(x, y) = \langle x, y \rangle\) at the point \((1, 1)\):

Step 1: Identify components: \(P = x\), \(Q = y\).

Step 2: Compute partial derivatives: \(\frac{\partial P}{\partial x} = 1\), \(\frac{\partial Q}{\partial y} = 1\).

Step 3: Sum them: \(\nabla \cdot \mathbf{F} = 1 + 1 = 2\).

Interpretation: Since \(\nabla \cdot \mathbf{F} = 2 > 0\), every point is a source. The field uniformly expands outward — imagine fluid being pumped out everywhere in the plane.

FAQ

What is divergence of a vector field?
Divergence is a scalar-valued differential operator that measures the rate at which a vector field expands or contracts at a given point. For a 3D field F = (P, Q, R), the divergence is the sum of partial derivatives: ∇·F = ∂P/∂x + ∂Q/∂y + ∂R/∂z. Positive divergence indicates a source (outward flow), negative indicates a sink (inward flow), and zero means incompressible flow.
How do you calculate divergence?
To calculate divergence, take the partial derivative of each component function with respect to its corresponding variable, then sum them all up. For a 2D field F = (P, Q), compute ∂P/∂x + ∂Q/∂y. For 3D, add ∂R/∂z. The result is a scalar function (not a vector), which tells you how much the field is expanding or compressing at each point.
What does it mean when divergence is zero?
When the divergence is zero everywhere, the vector field is called solenoidal or divergence-free. In fluid dynamics, this means the fluid is incompressible — there is no net expansion or contraction at any point. Magnetic fields always have zero divergence (Gauss's law for magnetism: ∇·B = 0), and the curl of any vector field is always divergence-free (∇·(∇×F) = 0).
What is the physical meaning of divergence?
Physically, divergence measures the net outward flux per unit volume at a point. Imagine a tiny box in a fluid: if more fluid leaves the box than enters, the divergence is positive (source). If more enters than leaves, it's negative (sink). This concept is central to conservation laws in physics, appearing in the continuity equation, Maxwell's equations, and the heat equation.
What is the difference between divergence and curl?
Divergence and curl are both differential operators on vector fields, but they measure different things. Divergence (∇·F) measures expansion or contraction and produces a scalar. Curl (∇×F) measures rotation or circulation and produces a vector. A field can have nonzero divergence but zero curl (like F = (x, y)), or zero divergence but nonzero curl (like F = (−y, x)), or both, or neither.

Reference this content, page, or tool as:

"Divergence Calculator" at https://MiniWebtool.com/divergence-calculator/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: 2026-04-08

You can also try our AI Math Solver GPT to solve your math problems through natural language question and answer.

Calculus:

Top & Updated:

Partial Derivative CalculatorDouble Integral CalculatorImplicit Derivative CalculatorView all →
Home Page > Math > Calculus > Divergence Calculator