Divergence Calculator
Calculate the divergence of a vector field from its component partial derivatives. Enter values for instant results with step-by-step formulas.
Formula
div(F) = partial Fx/partial x + partial Fy/partial y + partial Fz/partial z
The divergence operator (nabla dot F) sums the partial derivatives of each component with respect to its own coordinate axis. It measures the net outward flux per unit volume at each point, indicating sources (positive), sinks (negative), or incompressible flow (zero).
Worked Examples
Example 1: Linear Vector Field
Problem: Find the divergence of F = (2x, -y, 3z) at any point.
Solution: F = (Fx, Fy, Fz) = (2x, -y, 3z)\npartial Fx / partial x = partial(2x)/partial x = 2\npartial Fy / partial y = partial(-y)/partial y = -1\npartial Fz / partial z = partial(3z)/partial z = 3\ndiv(F) = 2 + (-1) + 3 = 4\nThe divergence is constant everywhere (does not depend on position).
Result: div(F) = 4 (constant source field, positive divergence everywhere)
Example 2: Quadratic Field at a Point
Problem: Find the divergence of F = (x squared, y squared, z squared) at point (1, 2, -1).
Solution: F = (x sq, y sq, z sq)\npartial(x sq)/partial x = 2x = 2(1) = 2\npartial(y sq)/partial y = 2y = 2(2) = 4\npartial(z sq)/partial z = 2z = 2(-1) = -2\ndiv(F) = 2 + 4 + (-2) = 4\nAt (1, 2, -1), the divergence is 4.
Result: div(F) at (1, 2, -1) = 4 (source at this point)
Frequently Asked Questions
What is the divergence of a vector field?
The divergence of a vector field is a scalar function that measures the rate at which the field expands or contracts at each point, representing the net outward flux per unit volume from an infinitesimally small region. Mathematically, for a three-dimensional vector field F = (Fx, Fy, Fz), the divergence is the sum of partial derivatives: div(F) = partial Fx / partial x + partial Fy / partial y + partial Fz / partial z. Positive divergence indicates a source where the field radiates outward (like air flowing from a pump), negative divergence indicates a sink where the field converges inward (like water flowing toward a drain), and zero divergence indicates an incompressible or solenoidal field where what flows in equals what flows out.
How is divergence related to the Divergence Theorem?
The Divergence Theorem, also known as Gauss's theorem, establishes a fundamental relationship between the divergence inside a volume and the flux through its boundary surface. It states that the volume integral of the divergence of a vector field equals the surface integral of the field over the closed boundary: the triple integral of div(F) dV equals the double integral of F dot n dS. This theorem converts between a volume calculation (which may be easier for certain fields) and a surface calculation (which may be easier for certain geometries). The theorem is the three-dimensional generalization of the Fundamental Theorem of Calculus and is extensively used in physics for deriving conservation laws from differential equations.
What does it mean when the divergence is zero everywhere?
A vector field with zero divergence everywhere is called solenoidal or divergence-free, and it represents an incompressible flow where no fluid is created or destroyed at any point. This is a fundamental property in several areas of physics: magnetic fields always have zero divergence (one of Maxwell's equations states div(B) = 0, reflecting the absence of magnetic monopoles), and the velocity field of an incompressible fluid satisfies div(v) = 0. A solenoidal field can always be expressed as the curl of another vector field (F = curl(A)), where A is called the vector potential. This property is used extensively in computational electromagnetics and fluid dynamics to ensure physically consistent solutions.
How do I compute divergence in different coordinate systems?
In Cartesian coordinates, divergence is simply the sum of partial derivatives along each axis, but in curvilinear coordinates the formula changes to account for the geometry. In cylindrical coordinates (r, theta, z), divergence is (1/r) partial(r Fr)/partial r + (1/r) partial F_theta/partial theta + partial Fz/partial z. In spherical coordinates (r, theta, phi), it becomes (1/r squared) partial(r squared Fr)/partial r + (1/(r sin theta)) partial(sin theta F_theta)/partial theta + (1/(r sin theta)) partial F_phi/partial phi. The scale factors (like 1/r and 1/(r sin theta)) account for the fact that coordinate surfaces are not equally spaced in curvilinear systems, and forgetting them is one of the most common errors in vector calculus.
What is the physical meaning of divergence in fluid dynamics?
In fluid dynamics, the divergence of the velocity field represents the rate at which fluid volume expands or compresses per unit volume at each point in the flow. A positive divergence means fluid is being created or expanding at that location, such as gas expanding through a nozzle or fluid being injected through a source. Negative divergence indicates fluid compression or removal, such as suction through a drain. For incompressible fluids like water at normal conditions, the divergence of the velocity field is exactly zero everywhere, which is the mathematical statement of the continuity equation for incompressible flow. This constraint is one of the most important in computational fluid dynamics and directly determines the pressure field.
How does divergence relate to electric fields and charges?
Gauss's law in differential form states that the divergence of the electric field equals the charge density divided by the permittivity of free space: div(E) = rho / epsilon_0. This means that electric charges are sources (positive charges) and sinks (negative charges) of the electric field. Where there is no charge, the divergence of E is zero and the electric field lines neither start nor end. A point charge creates a field whose divergence is zero everywhere except at the charge location, where it becomes infinite (mathematically represented by the Dirac delta function). This connection between divergence and source density is fundamental to electrostatics, and the same mathematical structure appears in gravitational fields.