Skip to main content
Physics LibreTexts

4.6: Divergence

  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    In this section, we present the divergence operator, which provides a way to calculate the flux associated with a point in space. First, let us review the concept of flux.

    The integral of a vector field over a surface is a scalar quantity known as flux. Specifically, the flux \(F\) of a vector field \({\bf A}({\bf r})\) over a surface \({\mathcal S}\) is

    \[\int_{\mathcal S}{\bf A}\cdot d{\bf s} = F \nonumber \]

    Note that \({\bf A}\) could be fairly described as a flux density; i.e., a quantity having units equal to the units of \(F\), but divided by area (i.e., m\(^2\)). Also worth noting is that the flux of a vector field that has unit magnitude and is normal to all points on \({\mathcal S}\) is simply the area of \({\mathcal S}\).

    It is quite useful to identify some electromagnetic quantities as either fluxes or flux densities. Here are two important examples:

    • The electric flux density \({\bf D}\), having units of C/m\(^2\), is a description of the electric field as a flux density. (See Section 2.4 for more about electric flux density.) The integral of \({\bf D}\) over a closed surface yields the enclosed charge \(Q_{encl}\), having units of C. This relationship is known as Gauss’ Law: \[\oint_{\mathcal S} {\bf D}\cdot d{\bf s} = Q_{encl} \label{m0044_GaussLawIntegralForm} \] (See Section 5.5 for more about Gauss’ Law.)
    • The magnetic flux density \({\bf B}\), having units of Wb/m\(^2\), is a description of the magnetic field as a flux density. (See Section 2.5 for more about magnetic flux density.) The integral of \({\bf B}\) over a surface (open or closed) yields the magnetic flux \(\Phi\), having units of Wb: \[\int_{\mathcal S} {\bf B}\cdot d{\bf s} = \Phi \nonumber \] This is important because, for example, the time rate of change of \(\Phi\) is proportional to electric potential. (See Section 8.3 for more about this principle, called Faraday’s Law.)


    Flux is the scalar quantity obtained by integrating a vector field, interpreted in this case as a flux density, over a specified surface.

    The concept of flux applies to a surface of finite size. However, what is frequently of interest is behavior at a single point, as opposed to the sum or average over a region of space. For example, returning to the idea of electric flux density (\({\bf D}\)), perhaps we are not concerned about the total charge (units of C) enclosed by a surface, but rather the charge density (C/m\(^3\)) at a point. In this case, we could begin with Equation \ref{m0044_GaussLawIntegralForm} and divide both sides of the equation by the volume \(V\) enclosed by \({\mathcal S}\):

    \[\frac{\oint_{\mathcal S}{ {\bf D} \cdot d{\bf s} } }{V} = \frac{ Q_{encl} }{V} \nonumber \]

    Now we let \(V\) shrink to zero, giving us an expression that must be true at whatever point we decide to converge upon. Taking the limit as \(V \to 0\):

    \[\lim_{V \to 0} \frac{ \oint_{\mathcal S}{ {\bf D} \cdot d{\bf s} } }{V} = \lim_{V \to 0} \frac{ Q_{encl} }{V} \nonumber \]

    The quantity on the right hand side is by definition the volume charge density \(\rho_v\) (units of C/m\(^3\)) at the point at which we converge. The left hand side is the divergence of \({\bf D}\), sometimes abbreviated “div \({\bf D}\).” Thus, the above equation can be written \[\mbox{div}~{\bf D} = \rho_v \nonumber \]


    Divergence is the flux per unit volume through an infinitesimally-small closed surface surrounding a point.

    We will typically not actually want to integrate and take a limit in order to calculate divergence. Fortunately, we do not have to. It turns out that this operation can be expressed as the dot product \(\nabla \cdot {\bf D}\); where, for example,

    \[\nabla \triangleq \hat{\bf x}\frac{\partial}{\partial x} + \hat{\bf y}\frac{\partial}{\partial y} + \hat{\bf z}\frac{\partial}{\partial z} \nonumber \]

    in the Cartesian coordinate system. This is the same “\(\nabla\)” that appears in the definition of the gradient operator (Section 4.5) and is same operator that often arises when considering other differential operators. If we expand \({\bf D}\) in terms of its Cartesian components:

    \[{\bf D} = \hat{\bf x}D_x + \hat{\bf y}D_y + \hat{\bf z}D_z \nonumber \] Then \[\mbox{div}~{\bf D} = \nabla \cdot {\bf D} = \frac{\partial D_x}{\partial x} + \frac{\partial D_y}{\partial y} + \frac{\partial D_z}{\partial z} \nonumber \]

    This seems to make sense for two reasons. First, it is dimensionally correct. Taking the derivative of a quantity having units of C/m\(^2\) with respect to distance yields a quantity having units of C/m\(^3\). Second, it makes sense that flux from a point should be related to the sum of the rates of change of the flux density in each basis direction. Summarizing:

    The divergence of a vector field \({\bf A}\) is \(\nabla\cdot{\bf A}\).

    Example \(\PageIndex{1}\): Divergence of a uniform field

    A field \({\bf A}\) that is constant with respect to position is said to be uniform. A completely general description of such a field is \({\bf A} = \hat{\bf x}A_x + \hat{\bf y}A_y + \hat{\bf z}A_z\) where \(A_x\), \(A_y\), and \(A_z\) are all constants. We see immediately that the divergence of such a field must be zero. That is, \(\nabla \cdot {\bf A} = 0\) because each component of \({\bf A}\) is constant with respect to position. This also makes sense from the perspective of the “flux through an infinitesimally-small closed surface” interpretation of divergence. If the flux is uniform, the flux into the surface equals the flux out of the surface resulting in a net flux of zero.

    Example \(\PageIndex{2}\): Divergence of a linearly-increasing field

    Consider a field \({\bf A}=\hat{\bf x}A_0 x\) where \(A_0\) is a constant. The divergence of \({\bf A}\) is \(\nabla \cdot {\bf A} = A_0\). If we interpret \({\bf A}\) as a flux density, then we have found that the net flux per unit volume is simply the rate at which the flux density is increasing with distance.

    To compute divergence in other coordinate systems, we merely need to know \(\nabla\) for those systems. In the cylindrical system:

    \[\nabla = \hat{\bf \rho}\frac{1}{\rho}\frac{\partial}{\partial \rho}\rho +\hat{\bf \phi}\frac{1}{\rho}\frac{\partial}{\partial \phi}\rho + \hat{\bf z}\frac{\partial}{\partial z} \nonumber \]

    and in the spherical system:

    \[\nabla = \hat{\bf r}\frac{1}{r^2}\frac{\partial}{\partial r}r^2 +\hat{\bf \theta}\frac{1}{r\sin\theta}\frac{\partial}{\partial \theta}\sin\theta +\hat{\bf \phi}\frac{1}{r\sin\theta}\frac{\partial}{\partial \phi} \label{eDelSph} \]

    Alternatively, one may use the explicit expressions for divergence given in Appendix B2.

    Example \(\PageIndex{3}\): Divergence of a radially-decreasing field

    Consider a vector field that is directed radially outward from a point and which decreases linearly with distance; i.e., \({\bf A}=\hat{\bf r}A_0/r\) where \(A_0\) is a constant. In this case, the divergence is most easily computed in the spherical coordinate system since partial derivatives in all but one direction (\(r\)) equal zero. Neglecting terms that include these zero-valued partial derivatives, we find:

    \[\nabla \cdot {\bf A} = \frac{1}{r^2}\frac{\partial}{\partial r}\left( r^2 \left[ \frac{A_0}{r} \right] \right) = \frac{A_0}{r^2} \nonumber \]

    In other words, if we interpret \({\bf A}\) as a flux density, then the flux per unit volume is decreasing with as the square of distance from the origin.

    It is useful to know that divergence, like \(\nabla\) itself, is a linear operator; that is, for any constant scalars \(a\) and \(b\) and vector fields \({\bf A}\) and \({\bf B}\):

    \[\nabla \cdot \left( a{\bf A} + b{\bf B} \right) = a \nabla \cdot {\bf A} + b \nabla \cdot {\bf B} \nonumber \]

    This page titled 4.6: Divergence is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Steven W. Ellingson (Virginia Tech Libraries' Open Education Initiative) .

    • Was this article helpful?