Spherical Coordinates Divergence Calculator

Solve divergence using r, theta, and phi inputs. Choose direct derivatives or numeric sampling mode. Download results as CSV or PDF for reports fast.

Calculator

Must be positive.
Angle from +z axis.
Angle in x-y plane from +x.
Derivatives follow this same unit.
Formatting only; internal math stays full.
Derivative method
Enter ∂Ar/∂r, ∂Aθ/∂θ, ∂Aφ/∂φ at the point.
Provide values at ±h around r, θ, and φ.
Derivative with respect to r.
Per your selected angle unit.
Per your selected angle unit.
In your selected angle unit.
In your selected angle unit.
Central difference: dA/dx ≈ (A(x+h) − A(x−h)) / (2h). Smaller h can improve accuracy, but too small can amplify rounding noise.
Reset

Formula used

For a vector field A = Ar e_r + Aθ e_θ + Aφ e_φ, the divergence in spherical coordinates is:

∇·A = (1/r²) ∂(r² Ar)/∂r + (1/(r sinθ)) ∂(Aθ sinθ)/∂θ + (1/(r sinθ)) ∂Aφ/∂φ

This calculator uses the expanded numeric form: 2Ar/r + ∂Ar/∂r + (cosθ·Aθ)/(r sinθ) + (1/r)∂Aθ/∂θ + (1/(r sinθ))∂Aφ/∂φ, where angular derivatives are interpreted per radian internally.

How to use this calculator

  1. Enter the evaluation point: r, θ, and φ, then select the angle unit.
  2. Enter Ar, Aθ, and Aφ values at that same point.
  3. Pick a derivative method: direct derivatives, or numeric sampling with steps.
  4. Click Calculate to see divergence and each term’s contribution.
  5. Use the CSV/PDF buttons to export the computed result.

Example data table

r θ φ Unit Ar ∂Ar/∂r ∂Aθ/∂θ ∂Aφ/∂φ ∇·A
2 60 30 Degrees 1.2 0.5 -0.3 0.4 0.2 (per rad) -0.1 (per rad) 1.786603

Note: If you select degrees, enter angular derivatives per degree; the calculator converts them to per-radian internally.

Article

1) What this divergence calculator measures

Divergence is the net “outflow” of a vector field from a tiny volume. This calculator evaluates ∇·A at one point (r, θ, φ) using your component values Ar, Aθ, and Aφ. It also reports radial, theta, and phi terms so you can see which direction dominates the result. Exports to CSV and PDF make documentation easy, and the term breakdown is useful for checking symmetry, units, and sign conventions quickly later.

2) Meaning of r, θ, and φ in this tool

r is distance from the origin and must be positive. θ is the polar angle from the +z axis, and φ is the azimuth angle in the x–y plane from +x. Trigonometric factors use radians internally, and the tool converts when you choose degrees.

3) Core spherical divergence formula used

The calculator follows the standard identity:

∇·A = (1/r²) ∂(r² Ar)/∂r + (1/(r sinθ)) ∂(Aθ sinθ)/∂θ + (1/(r sinθ)) ∂Aφ/∂φ

An expanded view separates 2Ar/r and ∂Ar/∂r, the cotangent factor (cosθ/sinθ)·Aθ/r, plus the angular derivative terms.

4) Direct derivatives vs numeric sampling

Direct mode uses ∂Ar/∂r, ∂Aθ/∂θ, and ∂Aφ/∂φ at the point. Numeric mode estimates them from nearby samples using central differences: dA/dx ≈ (A(x+h) − A(x−h)) / (2h). This supports simulation outputs and measured datasets.

5) Angle units and derivative conversion data

Angular derivatives must be per radian inside the formula. If you enter degrees, the tool converts your ∂/∂degree values using 180/π ≈ 57.2958 before computing the theta and phi terms.

6) Stability near sin(θ) ≈ 0

The theta and phi terms include 1/(r sinθ). When θ is near 0 or π, sinθ is near zero and the expression can be undefined or unstable. The warning helps you recognize pole behavior in spherical coordinates.

7) Example result and practical uses

With r=2, θ=60°, φ=30°, Ar=1.2, Aθ=0.5, Aφ=−0.3, ∂Ar/∂r=0.4, ∂Aθ/∂θ=0.2 per rad, and ∂Aφ/∂φ=−0.1 per rad, the tool returns ∇·A ≈ 1.786603. Use it for fluid sources/sinks, electric flux checks, and validating conservation constraints in models.

FAQs

1) What is divergence in simple terms?

Divergence is the net outflow rate of a vector field from a tiny volume around a point. Positive divergence suggests a source; negative divergence suggests a sink.

2) Do I need the full functions Ar(r,θ,φ), Aθ(r,θ,φ), Aφ(r,θ,φ)?

No. This calculator works at a single point. Provide component values at that point and either the partial derivatives or nearby samples for numeric estimation.

3) If I choose degrees, how should I enter ∂Aθ/∂θ and ∂Aφ/∂φ?

Enter derivatives per degree. The calculator converts them to per radian using 180/π before evaluating the divergence formula.

4) Why does the tool warn about sin(θ) near zero?

The formula contains 1/(r sinθ). When θ is near 0 or π, sinθ is near zero, causing division blow‑ups and undefined behavior at the coordinate pole.

5) Which numeric step sizes h should I use?

Choose small steps that reflect how smooth your data is. Too large reduces accuracy; too small can amplify rounding noise. A practical start is 0.1–1% of the local variable scale.

6) What do the three reported terms mean?

The radial term depends on Ar and ∂Ar/∂r, the theta term depends on Aθ and ∂Aθ/∂θ, and the phi term depends on ∂Aφ/∂φ. Their sum equals ∇·A.

Related Calculators

average rate of change calculator with pointsslope of a parallel line calculatorperpendicular and parallel line calculatorequation of a parallel line calculatorpoint slope form of parallel line calculatordistance between parallel line calculatorline parallel to another line calculatoronline parallel capacitor calculatorparallel circular conductor transmission line calculatorparallel square conductor transmission line calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.