Divergence Calculator
Calculate the divergence of a three-dimensional vector field. Enter its component functions to find symbolic partial derivatives, combine them into the divergence, and evaluate the result at a point of your choice.
Calculate vector field divergence
Enter a vector field
F(x,y,z) = (P,Q,R).
Use ^ for powers and explicit multiplication such
as 2*x. Trigonometric functions use radians.
Try an example
Select an example to load its vector field into the calculator. You can change the evaluation coordinates before calculating.
Example 1: Polynomial vector field
P = x^2*y
Q = y^2*z
R = z^2*x
Expected divergence:
2*x*y + 2*y*z + 2*z*x
Example 2: Linear vector field
P = 2*x
Q = 3*y
R = 4*z
Expected divergence: 9
Example 3: Trigonometric field
P = sin(x)
Q = cos(y)
R = z^2
Divergence:
cos(x) - sin(y) + 2*z
Example 4: Zero divergence
P = y
Q = z
R = x
Divergence: 0
What is divergence?
Divergence is a scalar quantity that measures the local net outward flow of a vector field from a point. It is widely used in vector calculus, fluid mechanics, electromagnetism and continuum physics.
The divergence formula in three dimensions
For a differentiable vector field F(x,y,z) = P(x,y,z)i + Q(x,y,z)j + R(x,y,z)k, divergence is the sum of three partial derivatives:
The first component is differentiated with respect to x, the second with respect to y, and the third with respect to z. These derivatives are then added together.
How to calculate divergence
- Identify the three components P, Q and R.
- Calculate the partial derivative of P with respect to x.
- Calculate the partial derivative of Q with respect to y.
- Calculate the partial derivative of R with respect to z.
- Add the three partial derivatives.
- Substitute the selected coordinates if a numerical value is needed.
Worked example
Consider the vector field:
Differentiate each component with respect to its corresponding variable:
Therefore, the divergence is:
At the point (1, 2, 3), the divergence is 2 + 4 + 6 = 12.
How to interpret divergence
- Positive divergence: indicates local net outward flow.
- Negative divergence: indicates local net inward flow.
- Zero divergence: indicates no local net source or sink to first order.
A vector field with zero divergence throughout a region is called divergence-free or solenoidal. Zero divergence does not mean that the vector field itself is zero.
Supported mathematical expressions
This calculator accepts algebraic expressions with the variables x, y and z, numerical constants, parentheses and the following operations and functions.
The calculator uses radians for trigonometric functions. Symbolic differentiation of the remainder operator and abs() is not supported. The general variable-exponent power rule is valid on its usual positive-base domain. Expressions that are undefined at the selected point will return an error.
Frequently asked questions
What does a divergence calculator do?
It calculates the divergence of a vector field by finding the appropriate partial derivatives of its components and adding them together.
Is divergence a scalar or a vector?
Divergence is a scalar. It assigns a single value to each point in the domain of a differentiable vector field.
What is the difference between divergence and curl?
Divergence measures local net outward flow, while curl measures local rotational tendency. Both are differential operators used in vector calculus.
What does zero divergence mean?
Zero divergence means the field has no local net outward flow to first order at that point. If the divergence is zero throughout a region, the field is divergence-free there.
Can I use this calculator for any vector field?
You can use supported expressions in three dimensions involving x, y and z. The components must be differentiable at the point of interest, and the expressions must fit the calculator's supported syntax.
Related calculators
Continue exploring multivariable calculus with these related tools on Summe.org.