Divergence Calculator
Calculate the divergence ∇·F of any 2D or 3D vector field with step-by-step partial derivative computation. Enter component functions P, Q (and R for 3D), get symbolic divergence, evaluate at a point, identify sources and sinks, and view an interactive vector field visualization with divergence heat map.
Your ad blocker is preventing us from showing ads
MiniWebtool is free because of ads. If this tool helped you, please support us by going Premium (ad‑free + faster tools), or allowlist MiniWebtool.com and reload.
- Allow ads for MiniWebtool.com, then reload
- Or upgrade to Premium (ad‑free)
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
Divergence Formulas and Coordinate Systems
| Coordinate System | Divergence 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
| Identity | Formula |
|---|---|
| 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
| Field | Application | What Divergence Represents |
|---|---|---|
| Electromagnetism | Gauss's Law | \(\nabla \cdot \mathbf{E} = \rho/\varepsilon_0\) — charge density creates electric field divergence |
| Electromagnetism | Magnetic field | \(\nabla \cdot \mathbf{B} = 0\) — no magnetic monopoles exist |
| Fluid Dynamics | Continuity equation | \(\nabla \cdot \mathbf{v} = 0\) for incompressible flow |
| Heat Transfer | Heat equation | Divergence of heat flux relates to temperature change |
| General Relativity | Einstein field equations | Divergence-free condition on stress-energy tensor |
How to Use the Divergence Calculator
- Choose dimension: Select 2D for fields F = ⟨P, Q⟩ or 3D for F = ⟨P, Q, R⟩ using the toggle buttons.
- Enter component functions: Type each component function (P, Q, and optionally R) using standard notation. Use
^for exponents,*for multiplication, and functions likesin(x),cos(y),exp(x),ln(x),sqrt(x). Implicit multiplication is supported (e.g.,2x=2*x). - Enter an evaluation point (optional): Provide comma-separated coordinates to evaluate the divergence numerically and classify the point as a source, sink, or incompressible.
- Click Compute Divergence: View the symbolic divergence formula, step-by-step partial derivative computation, numerical evaluation, and source/sink classification.
- 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
Reference this content, page, or tool as:
"Divergence Calculator" at https://MiniWebtool.com// 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.