Tutorials › Calculus III › The Product Rule for Divergence

Curl and Divergence · Tutorial 904 of 999

The Product Rule for Divergence

Learn to derive and apply the product rule for the divergence of a scalar-weighted vector field, and check when each term contributes.

Advanced 9 min read

What You'll Learn

  • State the differentiability conditions for the divergence product rule
  • Derive the identity one component at a time
  • Compute the divergence of a scalar multiple of a vector field
  • Use a divergence-free vector field to simplify the rule
  • Check a product-rule result by differentiating the components directly
  • Identify and correct common omissions in the formula

Why a Product Rule Is Needed

The divergence of a vector field measures its local source strength. If a vector field is multiplied by a scalar function, the resulting field can change in two ways: the original vectors are rescaled, and the rescaling itself can vary from point to point. Both effects contribute to the divergence.

This is why the divergence of a scalar-weighted vector field is not, in general, just the scalar times the divergence of the original field. A second term accounts for the spatial variation of the scalar. The product rule gives an efficient way to calculate both contributions.

Central formula: The divergence of a scalar function times a vector field includes a term from the gradient of the scalar and a term from the divergence of the vector field.

Definition and Conditions

Let \(U\) be an open subset of \(\mathbb{R}^3\), let \(f:U\to\mathbb{R}\) be a continuously differentiable scalar field, and let \(\mathbf{F}:U\to\mathbb{R}^3\) be a continuously differentiable vector field. Write the component functions of \(\mathbf{F}\) as \(P,Q,R\), so that \(\mathbf{F}=(P,Q,R)\). The scalar multiple \(f\mathbf{F}\) is the vector field whose components are \(fP,fQ,fR\).

Definition: For \(\mathbf{F}=(P,Q,R)\), its divergence is \(\nabla\cdot\mathbf{F}=\frac{\partial P}{\partial x}+\frac{\partial Q}{\partial y}+\frac{\partial R}{\partial z}\). For a scalar field \(f\), its gradient is \(\nabla f=(\frac{\partial f}{\partial x},\frac{\partial f}{\partial y},\frac{\partial f}{\partial z})\). The dot product of two vectors is the sum of the products of their corresponding components.

With these definitions, the product rule is an identity at every point of \(U\). The differentiability assumptions ensure that all of the partial derivatives appearing in the identity exist and are continuous. In coordinates, the result is

$$ \nabla\cdot(f\mathbf{F}) = \nabla f\cdot\mathbf{F} + f(\nabla\cdot\mathbf{F}). $$

The first term, \(\nabla f\cdot\mathbf{F}\), describes the contribution from the variation of the scalar weight in the direction of the vector field. The second term, \(f(\nabla\cdot\mathbf{F})\), is the original divergence scaled by \(f\).

Derivation from the Component Definition

The identity follows from the ordinary one-variable product rule applied to each component derivative in the definition of divergence. This gives a short complete derivation.

1
Write the weighted field.
Since \(\mathbf{F}=(P,Q,R)\), we have \(f\mathbf{F}=(fP,fQ,fR)\).
2
Apply the definition of divergence.
\(\nabla\cdot(f\mathbf{F})=\frac{\partial(fP)}{\partial x}+\frac{\partial(fQ)}{\partial y}+\frac{\partial(fR)}{\partial z}\).
3
Use the ordinary product rule on each term.
The result is \(f_xP+fP_x+f_yQ+fQ_y+f_zR+fR_z\).
4
Group the scalar and vector contributions.
The terms \(f_xP+f_yQ+f_zR\) equal \(\nabla f\cdot\mathbf{F}\), and \(f(P_x+Q_y+R_z)\) equals \(f(\nabla\cdot\mathbf{F})\).

Thus the component calculation proves the identity:

$$ \begin{aligned} \nabla\cdot(f\mathbf{F}) &=f_xP+fP_x+f_yQ+fQ_y+f_zR+fR_z\\ &=(f_xP+f_yQ+f_zR)+f(P_x+Q_y+R_z)\\ &=\nabla f\cdot\mathbf{F}+f(\nabla\cdot\mathbf{F}). \end{aligned} $$

The grouping is essential. The gradient term pairs each partial derivative of \(f\) with the corresponding component of \(\mathbf{F}\), while the remaining derivatives are precisely the divergence of \(\mathbf{F}\).

Worked Example: A Divergence-Free Vector Field

Worked Example: A Divergence-Free Vector Field

Let \(f(x,y,z)=x^2+y\) and \(\mathbf{F}(x,y,z)=(y,z,x)\). Find \(\nabla\cdot(f\mathbf{F})\) using the product rule, then verify it by differentiating the components directly.

First compute the gradient of \(f\):

$$ \nabla f=(2x,1,0). $$

Next compute the divergence of \(\mathbf{F}\):

$$ \nabla\cdot\mathbf{F} =\frac{\partial y}{\partial x} +\frac{\partial z}{\partial y} +\frac{\partial x}{\partial z} =0+0+0=0. $$

The dot product is

$$ \nabla f\cdot\mathbf{F} =(2x,1,0)\cdot(y,z,x) =2xy+z+0 =2xy+z. $$

Therefore, the product rule gives

$$ \nabla\cdot(f\mathbf{F}) =(2xy+z)+(x^2+y)(0) =2xy+z. $$

For a direct check, first form the product: \(\displaystyle f\mathbf{F}=((x^2+y)y,(x^2+y)z,(x^2+y)x)\). Its divergence is

$$ \begin{aligned} \nabla\cdot(f\mathbf{F}) &=\frac{\partial}{\partial x}\big((x^2+y)y\big) +\frac{\partial}{\partial y}\big((x^2+y)z\big) +\frac{\partial}{\partial z}\big((x^2+y)x\big)\\ &=2xy+z+0\\ &=2xy+z. \end{aligned} $$

The direct result agrees with the product-rule result. Since \(\nabla\cdot\mathbf{F}=0\), the term \(f(\nabla\cdot\mathbf{F})\) vanishes, leaving only the contribution from the variation of \(f\).

Worked Example: An Exponential Weight

Worked Example: An Exponential Weight

Let \(f(x,y,z)=e^z\) and \(\mathbf{F}(x,y,z)=(x,y,z^2)\). Compute \(\nabla\cdot(f\mathbf{F})\) and verify the result directly.

The gradient of \(f\) is

$$ \nabla f=(0,0,e^z). $$

The divergence of \(\mathbf{F}\) is

$$ \nabla\cdot\mathbf{F} =\frac{\partial x}{\partial x} +\frac{\partial y}{\partial y} +\frac{\partial z^2}{\partial z} =1+1+2z =2+2z. $$

The two terms in the product rule are

$$ \begin{aligned} \nabla f\cdot\mathbf{F} &=(0,0,e^z)\cdot(x,y,z^2)=e^z z^2,\\ f(\nabla\cdot\mathbf{F}) &=e^z(2+2z). \end{aligned} $$

Adding them gives

$$ \nabla\cdot(f\mathbf{F}) =e^z z^2+e^z(2+2z) =e^z(z^2+2z+2). $$

To check, the product field is \((xe^z,ye^z,z^2e^z)\). Differentiate its first component with respect to \(x\), its second with respect to \(y\), and its third with respect to \(z\):

$$ \begin{aligned} \nabla\cdot(f\mathbf{F}) &=\frac{\partial(xe^z)}{\partial x} +\frac{\partial(ye^z)}{\partial y} +\frac{\partial(z^2e^z)}{\partial z}\\ &=e^z+e^z+(2ze^z+z^2e^z)\\ &=e^z(z^2+2z+2). \end{aligned} $$

The direct calculation confirms the result. The \(e^zz^2\) contribution comes from the change of the weight \(e^z\) in the \(z\)-direction, while the other contribution scales the original divergence.

Worked Example: A Polynomial Weight on a Simple Field

Worked Example: A Polynomial Weight on a Simple Field

Let \(f(x,y,z)=x^2+y^2+z^2\) and \(\mathbf{F}(x,y,z)=(x,y,z)\). Find the divergence of \(f\mathbf{F}\), and check it by expanding the product field.

The gradient and divergence needed for the product rule are

$$ \nabla f=(2x,2y,2z), \qquad \nabla\cdot\mathbf{F}=1+1+1=3. $$

The dot product term is

$$ \nabla f\cdot\mathbf{F} =(2x,2y,2z)\cdot(x,y,z) =2x^2+2y^2+2z^2. $$

The scaled-divergence term is

$$ f(\nabla\cdot\mathbf{F}) =3(x^2+y^2+z^2) =3x^2+3y^2+3z^2. $$

Adding the terms yields

$$ \nabla\cdot(f\mathbf{F}) =5x^2+5y^2+5z^2 =5(x^2+y^2+z^2). $$

For the direct check, the product field is \(\big(x(x^2+y^2+z^2),y(x^2+y^2+z^2),z(x^2+y^2+z^2)\big)\). The three component derivatives are

$$ \begin{aligned} \frac{\partial}{\partial x}\big(x(x^2+y^2+z^2)\big) &=3x^2+y^2+z^2,\\ \frac{\partial}{\partial y}\big(y(x^2+y^2+z^2)\big) &=x^2+3y^2+z^2,\\ \frac{\partial}{\partial z}\big(z(x^2+y^2+z^2)\big) &=x^2+y^2+3z^2. \end{aligned} $$

Adding all three gives \(5x^2+5y^2+5z^2\), exactly as obtained from the product rule.

When the Formula Simplifies

The product rule is especially useful when one of its terms is zero or easy to calculate. If \(f\) is constant, then \(\nabla f=\mathbf{0}\), so

$$ \nabla\cdot(f\mathbf{F})=f(\nabla\cdot\mathbf{F}). $$

If instead \(\mathbf{F}\) is divergence-free, meaning \(\nabla\cdot\mathbf{F}=0\), then

$$ \nabla\cdot(f\mathbf{F})=\nabla f\cdot\mathbf{F}. $$

These simplifications do not mean that the divergence is necessarily zero. A varying scalar factor can create divergence even when the original vector field has none. The first worked example illustrates this: its vector field has zero divergence, but the weighted field has divergence \(2xy+z\), which is not zero in general.

The identity also clarifies why multiplying by a constant and multiplying by a variable function are different operations for divergence. A constant changes the size of the original divergence uniformly. A variable scalar can also change from point to point, adding the gradient contribution.

Common Mistake: Dropping a Product-Rule Term

A frequent error is to treat the scalar \(f\) as if it were constant, even when it varies with position. For example, take \(f=x^2\) and \(\mathbf{F}=(x,0,0)\). Since \(\nabla\cdot\mathbf{F}=1\), omitting the gradient term would incorrectly give

$$ f(\nabla\cdot\mathbf{F})=x^2. $$

But \(\nabla f=(2x,0,0)\), so the missing contribution is

$$ \nabla f\cdot\mathbf{F} =(2x,0,0)\cdot(x,0,0) =2x^2. $$

The correct result is therefore

$$ \nabla\cdot(f\mathbf{F}) =2x^2+x^2 =3x^2. $$

A direct check confirms the correction: \(f\mathbf{F}=(x^3,0,0)\), and its divergence is \(\frac{\partial x^3}{\partial x}+0+0=3x^2\). The incorrect expression \(x^2\) fails this component check.

How to Apply the Rule Reliably

For a scalar field \(f\) and vector field \(\mathbf{F}\), first verify that both are differentiable on the region under consideration. Then identify the two terms separately. This makes it harder to lose a contribution or confuse a scalar with a vector.

  1. Compute \(\nabla f\).
  2. Compute \(\nabla\cdot\mathbf{F}\).
  3. Form the dot product \(\nabla f\cdot\mathbf{F}\).
  4. Multiply \(f\) by \(\nabla\cdot\mathbf{F}\).
  5. Add the two results, then check by differentiating \(f\mathbf{F}\) directly when practical.

Keep the types of the expressions in view: \(\nabla f\) and \(\mathbf{F}\) are vectors, so their dot product is a scalar; \(f\) and \(\nabla\cdot\mathbf{F}\) are scalars, so their product is also a scalar. Both terms can therefore be added to give the divergence of \(f\mathbf{F}\).

Theorem: If \(f:U\to\mathbb{R}\) and \(\mathbf{F}:U\to\mathbb{R}^3\) are continuously differentiable on an open set \(U\subseteq\mathbb{R}^3\), then at every point of \(U\), \(\nabla\cdot(f\mathbf{F})=\nabla f\cdot\mathbf{F}+f(\nabla\cdot\mathbf{F})\).

Check Your Understanding

For each question, identify both terms in the product rule before simplifying.

  1. Let \(f=x+y\) and \(\mathbf{F}=(x,0,z)\). Compute \(\nabla\cdot(f\mathbf{F})\).
  2. Why does \(\nabla\cdot(f\mathbf{F})\) reduce to \(f(\nabla\cdot\mathbf{F})\) when \(f\) is constant?
  3. If \(\nabla\cdot\mathbf{F}=0\), what expression gives \(\nabla\cdot(f\mathbf{F})\)?
  4. For \(f=z^2\) and \(\mathbf{F}=(0,0,1)\), calculate the divergence using the product rule and verify it by differentiating the product field.
  5. In the product rule, which term accounts for the spatial variation of \(f\)?