Tutorials › Calculus III › Common Sign and Component Errors

Curl and Divergence · Tutorial 921 of 999

Common Sign and Component Errors

Use component-by-component checks and coordinate-aware formulas to find and correct frequent errors in curl and divergence calculations.

Advanced 10 min read

What You'll Learn

  • Match each curl component with the correct pair of component derivatives.
  • Track the negative cofactor sign in the determinant mnemonic for curl.
  • Distinguish planar scalar curl from the vector curl in three dimensions.
  • Include coordinate scale factors when differentiating in orthogonal coordinates.
  • Check curl and divergence results using Cartesian components or a Jacobian matrix.

Why Component Checks Matter

Curl and divergence are built from partial derivatives, so a small change in the order of two derivatives can change a sign or even produce a different quantity. In Cartesian coordinates, the formulas are compact enough to memorize, but that can encourage treating them as symbol patterns rather than matching each derivative to the correct component.

The risk increases in curvilinear coordinates. There, the component formulas include scale factors that account for how coordinate distances and directions vary from point to point. Differentiating the components while omitting those factors can give a plausible-looking but incorrect answer.

A reliable calculation starts by identifying the field’s components, the coordinate system, and the quantity being computed. It ends with a check: compare against the component formula, the Jacobian matrix, or a Cartesian expression when one is available.

Definition: For a differentiable vector field \(\mathbf{v}=(P,Q,R)\) in Cartesian coordinates \((x,y,z)\), its divergence is the scalar \(\nabla\cdot\mathbf{v}=P_x+Q_y+R_z\), and its curl is the vector \(\nabla\times\mathbf{v}=(R_y-Q_z,\;P_z-R_x,\;Q_x-P_y)\). Here subscripts denote partial derivatives, such as \(P_x=\partial P/\partial x\).

Match Each Derivative to Its Component

Divergence uses the derivative of each component with respect to its own coordinate: the first component is differentiated with respect to \(x\), the second with respect to \(y\), and the third with respect to \(z\). Curl instead combines cross-derivatives in pairs. Keeping the component names visible while calculating helps prevent swapping them.

The standard determinant mnemonic for curl is

$$ \nabla\times\mathbf{v} = \begin{vmatrix} \mathbf{i}&\mathbf{j}&\mathbf{k}\\ \partial_x&\partial_y&\partial_z\\ P&Q&R \end{vmatrix} = (R_y-Q_z)\mathbf{i} -(R_x-P_z)\mathbf{j} +(Q_x-P_y)\mathbf{k}. $$

The middle term carries a minus sign because it is the second cofactor in expansion along the first row. Rewriting it as \(P_z-R_x\) gives the component formula above. The determinant is a mnemonic for this expansion; it is not an ordinary determinant whose entries are all numbers.

Worked Example: Keeping the Curl Signs Straight

Worked Example: Keeping the Curl Signs Straight

Find the curl of \(\mathbf{v}=(y,z,x)\). Then check it using the determinant expansion.

The components are \(P=y\), \(Q=z\), and \(R=x\). Compute the derivatives needed for each curl component:

$$ R_y=0,\quad Q_z=1,\quad P_z=0,\quad R_x=1,\quad Q_x=0,\quad P_y=1. $$

Therefore,

$$ \nabla\times\mathbf{v} = (R_y-Q_z,\;P_z-R_x,\;Q_x-P_y) = (0-1,\;0-1,\;0-1) = (-1,-1,-1). $$

For the determinant check, expansion gives \((R_y-Q_z,\;-(R_x-P_z),\;Q_x-P_y)\). Substitution gives \((0-1,\;-(1-0),\;0-1)=(-1,-1,-1)\), agreeing with the component calculation. In particular, dropping the minus sign on the middle cofactor would incorrectly give a positive second component.

Use the Jacobian as a Check

The Jacobian matrix of \(\mathbf{v}=(P,Q,R)\) has the component derivatives arranged by rows:

$$ \mathbf{J}_{\mathbf{v}} = \begin{pmatrix} P_x&P_y&P_z\\ Q_x&Q_y&Q_z\\ R_x&R_y&R_z \end{pmatrix}. $$

Its trace, the sum of its diagonal entries, is the divergence. The curl components are differences between paired off-diagonal entries: \(\nabla\times\mathbf{v}=(R_y-Q_z,\;P_z-R_x,\;Q_x-P_y)\). This gives a useful independent way to check whether a derivative came from the correct row and column.

Worked Example: Checking Divergence with the Jacobian

For \(\mathbf{v}=(x^2y,\;yz,\;z^2x)\), find the divergence and evaluate it at \((1,2,3)\).

The components are \(P=x^2y\), \(Q=yz\), and \(R=z^2x\). Differentiate each with respect to its matching coordinate:

$$ P_x=2xy,\qquad Q_y=z,\qquad R_z=2zx. $$

Thus \(\nabla\cdot\mathbf{v}=2xy+z+2zx\). At \((x,y,z)=(1,2,3)\), the three contributions are \(2(1)(2)=4\), \(3\), and \(2(3)(1)=6\). Therefore the divergence is \(4+3+6=13\).

The Jacobian diagonal is \((2xy,z,2zx)\). At the stated point it is \((4,3,6)\), whose trace is \(4+3+6=13\). This checks both the derivative assignments and the final value.

Planar Scalar Curl Is Not the Whole Three-Dimensional Curl

For a planar vector field \(\mathbf{v}=(P,Q)\), the scalar curl is defined to be \(\partial Q/\partial x-\partial P/\partial y\). It measures the component of the three-dimensional curl perpendicular to the plane when the planar field is extended to have zero \(z\)-component and no \(z\)-dependence.

The planar scalar is therefore not a three-component vector. For the extended field \((P,Q,0)\), the full curl is \((0,0,\partial Q/\partial x-\partial P/\partial y)\). Calling the planar scalar “the curl” is common shorthand, but it matters to specify which object is meant.

Worked Example: Relating Planar and Three-Dimensional Curl

Let \(\mathbf{v}(x,y)=(-y/2,x/2)\). Find its planar scalar curl and the curl of its zero-\(z\)-component extension.

Here \(P=-y/2\) and \(Q=x/2\). The required derivatives are \(\partial Q/\partial x=1/2\) and \(\partial P/\partial y=-1/2\). Hence the planar scalar curl is

$$ \frac{\partial Q}{\partial x}-\frac{\partial P}{\partial y} = \frac12-\left(-\frac12\right) =1. $$

Extend the field to \(\mathbf{v}(x,y,z)=(-y/2,x/2,0)\). Then \(R_y=0\), \(Q_z=0\), \(P_z=0\), \(R_x=0\), \(Q_x=1/2\), and \(P_y=-1/2\). Thus

$$ \nabla\times\mathbf{v} = (0-0,\;0-0,\;1/2-(-1/2)) = (0,0,1). $$

The third component matches the planar scalar curl, as expected. The full three-dimensional answer is a vector, not the scalar \(1\).

Scale Factors Cannot Be Dropped

In orthogonal curvilinear coordinates, component derivatives alone do not generally give divergence or curl. If the coordinates are \((q_1,q_2,q_3)\), let \(h_1,h_2,h_3\) be their scale factors, and let \(F_1,F_2,F_3\) be the components of the field in the corresponding unit-vector directions. The divergence formula is

$$ \nabla\cdot\mathbf{F} = \frac{1}{h_1h_2h_3} \left[ \frac{\partial}{\partial q_1}(h_2h_3F_1) + \frac{\partial}{\partial q_2}(h_3h_1F_2) + \frac{\partial}{\partial q_3}(h_1h_2F_3) \right]. $$

The curl also contains scale factors. Its components in the orthonormal coordinate directions are

$$ \nabla\times\mathbf{F} = \frac{1}{h_2h_3} \left[ \frac{\partial(h_3F_3)}{\partial q_2} - \frac{\partial(h_2F_2)}{\partial q_3} \right]\mathbf{e}_1 + \frac{1}{h_3h_1} \left[ \frac{\partial(h_1F_1)}{\partial q_3} - \frac{\partial(h_3F_3)}{\partial q_1} \right]\mathbf{e}_2 + \frac{1}{h_1h_2} \left[ \frac{\partial(h_2F_2)}{\partial q_1} - \frac{\partial(h_1F_1)}{\partial q_2} \right]\mathbf{e}_3. $$

These formulas require a regular orthogonal coordinate chart at the point of calculation. At coordinate singularities, the formulas may not be directly usable in that chart; a field can still be smooth there, so a different chart or Cartesian calculation may be needed.

For cylindrical coordinates \((r,\theta,z)\), the scale factors are \(1,r,1\). In particular, \(\nabla\cdot\mathbf{F}=(1/r)\partial_r(rF_r)+(1/r)\partial_\theta F_\theta+\partial_zF_z\), and the \(z\)-component of curl is \((1/r)[\partial_r(rF_\theta)-\partial_\theta F_r]\). The factors of \(r\) are part of the formulas, not optional corrections.

Worked Example: Finding a Missing Cylindrical Scale Factor

For \(r>0\), let \(\mathbf{F}=r\mathbf{e}_\theta\). Compute its cylindrical curl and check the result in Cartesian coordinates.

The components are \(F_r=0\), \(F_\theta=r\), and \(F_z=0\). The radial and angular components of curl vanish because all terms involving \(F_r\) or \(F_z\) and their relevant derivatives are zero. The \(z\)-component is

$$ (\nabla\times\mathbf{F})_z = \frac{1}{r}\frac{\partial(rF_\theta)}{\partial r} = \frac{1}{r}\frac{\partial(r^2)}{\partial r} = \frac{1}{r}(2r) = 2. $$

So \(\nabla\times\mathbf{F}=2\mathbf{e}_z\). Omitting the scale factor and differentiating \(F_\theta\) alone would give \(1\), which is wrong.

Since \(\mathbf{e}_\theta=(-\sin\theta,\cos\theta,0)\) and \(x=r\cos\theta,\ y=r\sin\theta\), the same field is \(\mathbf{F}=(-y,x,0)\). Its Cartesian curl has \(z\)-component \(\partial_x(x)-\partial_y(-y)=1-(-1)=2\), with the other components zero. This confirms the cylindrical result. The Cartesian expression also shows that the field extends smoothly to the axis, even though the cylindrical formula uses \(r>0\).

A Spherical Scale-Factor Check

In spherical coordinates with polar angle \(\theta\), azimuthal angle \(\phi\), and radial component \(F_r\), the divergence contains the factor \(r^2\sin\theta\):

$$ \nabla\cdot\mathbf{F} = \frac{1}{r^2}\frac{\partial}{\partial r}(r^2F_r) + \frac{1}{r\sin\theta}\frac{\partial}{\partial\theta}(\sin\theta F_\theta) + \frac{1}{r\sin\theta}\frac{\partial F_\phi}{\partial\phi}. $$

For example, take the radial field \(\mathbf{F}=r\mathbf{e}_r\), away from the coordinate singularities. Its angular components vanish, so \[ \nabla\cdot\mathbf{F} = \frac{1}{r^2}\frac{\partial}{\partial r}(r^2r) = \frac{1}{r^2}\frac{\partial}{\partial r}(r^3) = \frac{3r^2}{r^2} = 3. \] A mistaken calculation using only \(\partial_rF_r\) would return \(1\). In Cartesian coordinates the field is \((x,y,z)\), whose divergence is \(1+1+1=3\). Both the spherical scale factor and the Cartesian check confirm the correct value.

A Reliable Error-Checking Routine

1
Name the components and coordinates.
Write the field as components in the coordinate system being used. Do not silently treat cylindrical or spherical components as Cartesian ones.
2
Choose the matching formula.
For Cartesian coordinates, use the component formulas. For orthogonal curvilinear coordinates, include the corresponding scale factors.
3
Compute derivatives before combining them.
List the derivative values for each component of divergence or curl. This makes swapped derivatives and sign changes visible.
4
Check the type and components of the answer.
Divergence and planar scalar curl are scalars; three-dimensional curl is a vector. Check individual components against the Jacobian or a Cartesian expression when possible.

Common Pitfall: Treating the Determinant as a Sign-Free Pattern

A common wrong calculation expands the determinant mnemonic for the middle curl component as \(R_x-P_z\), giving the sign-free list \((R_y-Q_z,\ R_x-P_z,\ Q_x-P_y)\). For the field \((y,z,x)\), this would give \((-1,1,-1)\), because \(R_x=1\) and \(P_z=0\).

The correction is to apply the negative cofactor sign in the middle position: \(-(R_x-P_z)=P_z-R_x=0-1=-1\). Thus the correct curl is \((-1,-1,-1)\). The error is not fixed by memorizing a different determinant pattern; it is fixed by preserving the cofactor sign or directly using the established component formula.

Why These Checks Are Useful

Curl and divergence calculations often serve as inputs to later arguments about vector fields, flux, and circulation. A component error can therefore affect a conclusion well beyond the original derivative calculation. Dimensional or coordinate checks also help: if a cylindrical expression lacks the factors required by the coordinate scale, comparing it with a Cartesian form can expose the problem immediately.

A practical habit is to keep the field components labeled until the final line, then verify the result by a second route where possible. That route might be a Jacobian trace, the determinant expansion with its cofactor signs, or conversion to Cartesian coordinates. These are not merely extra calculations; they test different parts of the reasoning.

Check Your Understanding

Use the component formulas and coordinate conventions to answer the following.

  1. For \(\mathbf{v}=(P,Q,R)\), which derivatives make up the \(y\)-component of \(\nabla\times\mathbf{v}\), and why is its order important?
  2. What is the difference between the planar scalar curl of \((P,Q)\) and the three-dimensional curl of \((P,Q,0)\)?
  3. Why does the cylindrical \(z\)-component of curl include a factor of \(1/r\) and a derivative of \(rF_\theta\)?
  4. For a Cartesian vector field, how can the Jacobian matrix help check divergence and curl?
  5. What is the middle cofactor sign in the determinant mnemonic for curl, and what error results if it is omitted?