Report

Help us improve this tool

Divergence Calculator

Calculate the divergence of any 2D or 3D vector field with step-by-step partial derivative computation. Evaluate at a point and classify sources and sinks.

O M T

What is a Divergence Calculator?

A divergence calculator computes the divergence of a vector field in 2D or 3D. Divergence measures the rate at which a vector field spreads out from a point. It is a scalar operator that takes a vector-valued function and returns a scalar value indicating whether the field is expanding (source), contracting (sink), or incompressible at each point. This calculator uses symbolic differentiation to compute exact partial derivatives of your vector field components.

Divergence is a fundamental concept in vector calculus with applications in fluid dynamics, electromagnetism, heat transfer, and general relativity. Understanding divergence helps you analyze how fields behave, identify sources and sinks, and apply conservation laws in physics and engineering.

The Divergence Formula

For a 2D vector field $\mathbf{F} = \langle P, Q \rangle$, the divergence is:

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

For a 3D vector field $\mathbf{F} = \langle P, Q, R \rangle$, the divergence is:

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

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.

How to Use This Calculator

  1. Select dimension: Choose 2D or 3D for your vector field.
  2. Enter component functions: Type the P, Q (and R for 3D) component functions using standard notation. Use ^ for exponents, * for multiplication. Supported functions include sin, cos, tan, exp, ln, sqrt, and more.
  3. Enter evaluation point (optional): Provide comma-separated coordinates to evaluate the divergence numerically and classify the point.
  4. Read the result: The symbolic divergence is displayed instantly with step-by-step partial derivative computation.

Applications of Divergence

  • Electromagnetism: Gauss's law relates electric field divergence to charge density.
  • Fluid Dynamics: The continuity equation uses divergence to describe incompressible flow.
  • Heat Transfer: Divergence of heat flux relates to temperature change in the heat equation.
  • General Relativity: Divergence-free conditions on the stress-energy tensor.

Frequently Asked Questions

What is divergence of a vector field?

Divergence is a scalar 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, negative indicates a sink, 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.

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. Magnetic fields always have zero divergence (Gauss's law for magnetism: ∇⋅B = 0).

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.

Can I evaluate divergence at a specific point?

Yes. Enter the coordinates of the point (comma-separated) in the evaluation field. The calculator will evaluate the symbolic divergence expression at that point and classify it as a source, sink, or incompressible based on the sign of the result.