# Divergence in Spherical Coordinates Derivation and Verification

The derivation of the divergence $$\nabla \cdot v$$ in spherical coordinates begins with the general tensor calculus formula, $$\nabla \cdot v=\frac{1}{\sqrt{g}} \partial\_a\left(\sqrt{g} v^a\right)$$. The crucial geometric factor for this coordinate system is the square root of the metric determinant, $$\sqrt{ g }= r ^{ 2 } \sin (\theta)$$. Substituting this into the formula and simplifying yields the divergence in terms of the contravariant components $$\left(v^a\right): \nabla \cdot v= \frac{1}{r^2} \partial\_r\left(r^2 v^r\right)+\frac{1}{\sin (\theta)} \partial\_\theta\left(\sin (\theta) v^\theta\right)+\partial\_{\varphi} v^{\varphi}$$. To verify this result against the standard physics expression, the contravariant components were converted to the physical components ( $$\tilde{v}\_a$$ ) using the relationship $$\tilde{v}a=\sqrt{\text { g }{a a}} v^a$$, which introduces specific scaling factors like $$1 / r$$ and $$1 /(r \sin (\theta))$$ for the $$\theta$$ and $$\varphi$$ components, confirming the tensor-based derivation is consistent with the traditional vector analysis formula.

{% embed url="<https://youtube.com/shorts/nBYhx1CNItg?feature=share>" %}

{% embed url="<https://viadean.notion.site/Divergence-in-Spherical-Coordinates-Derivation-and-Verification-2801ae7b9a3280c98b0ae8485b51a304?source=copy_link>" %}
