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.
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\).
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
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.
Since \(\mathbf{F}=(P,Q,R)\), we have \(f\mathbf{F}=(fP,fQ,fR)\).
\(\nabla\cdot(f\mathbf{F})=\frac{\partial(fP)}{\partial x}+\frac{\partial(fQ)}{\partial y}+\frac{\partial(fR)}{\partial z}\).
The result is \(f_xP+fP_x+f_yQ+fQ_y+f_zR+fR_z\).
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:
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\):
Next compute the divergence of \(\mathbf{F}\):
The dot product is
Therefore, the product rule gives
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
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
The divergence of \(\mathbf{F}\) is
The two terms in the product rule are
Adding them gives
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\):
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
The dot product term is
The scaled-divergence term is
Adding the terms yields
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
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
If instead \(\mathbf{F}\) is divergence-free, meaning \(\nabla\cdot\mathbf{F}=0\), then
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
But \(\nabla f=(2x,0,0)\), so the missing contribution is
The correct result is therefore
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.
- Compute \(\nabla f\).
- Compute \(\nabla\cdot\mathbf{F}\).
- Form the dot product \(\nabla f\cdot\mathbf{F}\).
- Multiply \(f\) by \(\nabla\cdot\mathbf{F}\).
- 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}\).
Check Your Understanding
For each question, identify both terms in the product rule before simplifying.
- Let \(f=x+y\) and \(\mathbf{F}=(x,0,z)\). Compute \(\nabla\cdot(f\mathbf{F})\).
- Why does \(\nabla\cdot(f\mathbf{F})\) reduce to \(f(\nabla\cdot\mathbf{F})\) when \(f\) is constant?
- If \(\nabla\cdot\mathbf{F}=0\), what expression gives \(\nabla\cdot(f\mathbf{F})\)?
- 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.
- In the product rule, which term accounts for the spatial variation of \(f\)?