Tutorials › Calculus III › Curl of a Gradient

Curl and Divergence · Tutorial 907 of 999

Curl of a Gradient

See why the mixed partial derivatives in the curl of a gradient cancel, and verify the identity on explicit functions.

Advanced 9 min read

What You'll Learn

  • State the smoothness condition required for the curl of a gradient to vanish.
  • Expand the curl of a gradient using Cartesian components.
  • Explain why equality of continuous mixed partial derivatives makes the components cancel.
  • Verify the identity for polynomial and exponential-trigonometric scalar functions.
  • Apply the identity on a domain that excludes a singular point.
  • Identify a common sign error when computing curl.

From a Scalar Function to a Vector Field

A scalar function assigns a number to each point in its domain. Its gradient turns that scalar function into a vector field: the components of the gradient record the function’s rates of change in the three coordinate directions. The curl, in turn, measures a particular pattern of variation in a vector field.

This tutorial studies what happens when we apply curl to a gradient. The result is an exact cancellation, provided the scalar function is sufficiently smooth. The reason is that the components of the curl compare mixed second partial derivatives, and continuous mixed partial derivatives agree when their order is reversed.

Definition: Let \(U\) be an open subset of \(\mathbb{R}^3\), and let \(\phi:U\to\mathbb{R}\) have continuous first partial derivatives. Its gradient is the vector field $$ \nabla \phi = \left\langle \frac{\partial \phi}{\partial x}, \frac{\partial \phi}{\partial y}, \frac{\partial \phi}{\partial z} \right\rangle. $$ For a vector field \(\mathbf{F}=\langle P,Q,R\rangle\) with continuous first partial derivatives, its curl in Cartesian coordinates is $$ \nabla\times\mathbf{F} = \left\langle \frac{\partial R}{\partial y}-\frac{\partial Q}{\partial z}, \frac{\partial P}{\partial z}-\frac{\partial R}{\partial x}, \frac{\partial Q}{\partial x}-\frac{\partial P}{\partial y} \right\rangle. $$

The symbol \(\nabla\) is used in both expressions, but the operations are different: \(\nabla\phi\) is a vector field, while \(\nabla\times\mathbf{F}\) is the curl of a vector field. To find the curl of a gradient, substitute the three partial derivatives of \(\phi\) into the Cartesian curl formula.

The Smoothness Condition and the Identity

Assume that \(\phi\) has continuous second partial derivatives on the open domain \(U\). This condition is commonly written \(\phi\in C^2(U)\). In particular, the second partial derivatives that appear below exist and are continuous. Clairaut’s theorem then says that the order of differentiation in a mixed partial may be reversed:

$$ \frac{\partial}{\partial y} \left(\frac{\partial \phi}{\partial z}\right) = \frac{\partial}{\partial z} \left(\frac{\partial \phi}{\partial y}\right), \qquad \frac{\partial}{\partial z} \left(\frac{\partial \phi}{\partial x}\right) = \frac{\partial}{\partial x} \left(\frac{\partial \phi}{\partial z}\right), \qquad \frac{\partial}{\partial x} \left(\frac{\partial \phi}{\partial y}\right) = \frac{\partial}{\partial y} \left(\frac{\partial \phi}{\partial x}\right). $$

Each pair is a pair of mixed second partial derivatives of the same scalar function. Now apply the curl formula to \(\nabla\phi\).

Theorem: If \(U\subseteq\mathbb{R}^3\) is open and \(\phi\in C^2(U)\), then $$ \nabla\times(\nabla\phi)=\mathbf{0} $$ at every point of \(U\).

Why the Components Cancel

The result follows directly from the definitions and equality of mixed partial derivatives. Writing each component explicitly shows which derivatives cancel. No assumptions about the shape of \(U\) are needed beyond openness and the stated smoothness of \(\phi\).

1
Write the gradient.
Set \(P=\phi_x\), \(Q=\phi_y\), and \(R=\phi_z\), so \(\nabla\phi=\langle P,Q,R\rangle\).
2
Apply the curl formula.
The three components are \(\phi_{zy}-\phi_{yz}\), \(\phi_{xz}-\phi_{zx}\), and \(\phi_{yx}-\phi_{xy}\).
3
Use the mixed-partial equalities.
Since \(\phi\in C^2(U)\), each difference is zero. Thus every component is zero, and the curl is \(\mathbf{0}\).

In the subscripts, for example, \(\phi_{zy}\) means differentiate \(\phi\) first with respect to \(z\), then with respect to \(y\). The theorem’s smoothness condition is what licenses replacing \(\phi_{zy}\) with \(\phi_{yz}\), and likewise for the other pairs. The cancellation is component by component; it does not depend on evaluating the derivatives at a special point.

Worked Example: A Polynomial Potential

Worked Example: A Polynomial Potential

Let \(\phi(x,y,z)=x^2y+y^2z+z^2x\). Find \(\nabla\times(\nabla\phi)\) by computing the gradient and then its curl.

First differentiate with respect to each variable:

$$ \phi_x=2xy+z^2,\qquad \phi_y=x^2+2yz,\qquad \phi_z=y^2+2zx. $$

Therefore \(\nabla\phi=\langle 2xy+z^2,\;x^2+2yz,\;y^2+2zx\rangle\). Using \(P=2xy+z^2\), \(Q=x^2+2yz\), and \(R=y^2+2zx\), the first curl component is

$$ R_y-Q_z=2y-2y=0. $$

The second component is

$$ P_z-R_x=2z-2z=0. $$

The third component is

$$ Q_x-P_y=2x-2x=0. $$

Hence \(\nabla\times(\nabla\phi)=\langle 0,0,0\rangle\). As a check, the pairs of mixed derivatives used here are \(\phi_{zy}=\phi_{yz}=2y\), \(\phi_{xz}=\phi_{zx}=2z\), and \(\phi_{yx}=\phi_{xy}=2x\), so each component vanishes as computed.

Worked Example: Exponential and Trigonometric Factors

Worked Example: Exponential and Trigonometric Factors

Let \(\phi(x,y,z)=e^{xy}\sin z\). Compute the curl of its gradient, keeping track of the product and chain rules in the derivatives.

The first partial derivatives are

$$ \phi_x=ye^{xy}\sin z,\qquad \phi_y=xe^{xy}\sin z,\qquad \phi_z=e^{xy}\cos z. $$

Thus \(P=ye^{xy}\sin z\), \(Q=xe^{xy}\sin z\), and \(R=e^{xy}\cos z\). Differentiate the components needed for the curl:

$$ R_y=xe^{xy}\cos z,\qquad Q_z=xe^{xy}\cos z, $$ $$ P_z=ye^{xy}\cos z,\qquad R_x=ye^{xy}\cos z, $$ $$ Q_x=(1+xy)e^{xy}\sin z,\qquad P_y=(1+xy)e^{xy}\sin z. $$

For example, differentiating \(Q=xe^{xy}\sin z\) with respect to \(x\) gives \(e^{xy}\sin z+x(ye^{xy})\sin z=(1+xy)e^{xy}\sin z\). Substitution gives

$$ \nabla\times(\nabla\phi) = \left\langle xe^{xy}\cos z-xe^{xy}\cos z,\; ye^{xy}\cos z-ye^{xy}\cos z,\; (1+xy)e^{xy}\sin z-(1+xy)e^{xy}\sin z \right\rangle = \langle 0,0,0\rangle. $$

The result is checked directly: each component subtracts two identical expressions. The function is \(C^2\) throughout \(\mathbb{R}^3\), so the identity applies everywhere.

Worked Example: A Domain with a Missing Point

Worked Example: A Domain with a Missing Point

Consider \(\phi(x,y,z)=\ln(x^2+y^2+z^2)\), defined on \(U=\mathbb{R}^3\setminus\{(0,0,0)\}\). The function is not defined at the origin, so the calculation is performed only on \(U\). Set \(s=x^2+y^2+z^2\), which is positive on this domain.

By the chain rule, the gradient is

$$ \nabla\phi= \left\langle\frac{2x}{s},\frac{2y}{s},\frac{2z}{s}\right\rangle. $$

Let \(P=2x/s\), \(Q=2y/s\), and \(R=2z/s\). Differentiating and using \(s_y=2y\), \(s_z=2z\), \(s_x=2x\) gives

$$ R_y=-\frac{4yz}{s^2},\qquad Q_z=-\frac{4yz}{s^2}, $$ $$ P_z=-\frac{4xz}{s^2},\qquad R_x=-\frac{4xz}{s^2}, $$ $$ Q_x=-\frac{4xy}{s^2},\qquad P_y=-\frac{4xy}{s^2}. $$

For instance, \(R_y=\frac{\partial}{\partial y}(2z/s)=-(2z)(2y)/s^2=-4yz/s^2\). The curl is therefore

$$ \nabla\times(\nabla\phi) = \left\langle -\frac{4yz}{s^2}+\frac{4yz}{s^2},\; -\frac{4xz}{s^2}+\frac{4xz}{s^2},\; -\frac{4xy}{s^2}+\frac{4xy}{s^2} \right\rangle = \langle 0,0,0\rangle. $$

This agrees with the theorem because \(\phi\) has continuous second partial derivatives at every point of \(U\). The conclusion is asserted on \(U\), not at the excluded origin.

A Common Sign Error

The order of subtraction in the curl formula matters. For the third component, the prescribed order is \(Q_x-P_y\), not \(P_y-Q_x\). Reversing it changes the sign of the component. A mistaken nonzero answer can result even for a very simple gradient.

Worked Example: Checking the Curl Sign

Take \(\phi(x,y,z)=xy\). Then \(\nabla\phi=\langle y,x,0\rangle\), so \(P=y\), \(Q=x\), and \(R=0\). A common wrong calculation reverses the third-component subtraction and gives \(P_y-Q_x=1-1=0\) in this example, which happens not to reveal the sign error. Instead, the sign error is visible if one compares the formula term by term: the correct third component is \(Q_x-P_y=1-1=0\); the reversed expression is \(P_y-Q_x=1-1=0\) here as well.

To see why the order still must be preserved, use a general vector field with \(P=0\), \(Q=x\), and \(R=0\). Its correct third curl component is \(Q_x-P_y=1-0=1\), whereas reversing the order gives \(P_y-Q_x=0-1=-1\). For a gradient, the mixed-partial cancellation makes the component zero either way, so this particular identity cannot diagnose a reversed subtraction by its final value alone. The correction is to use the defined Cartesian curl formula consistently, rather than infer its signs from a cancellation that happens to be zero.

What the Identity Does and Does Not Say

The identity is a statement about a scalar function with continuous second partial derivatives on an open domain. It says that if a vector field is obtained as the gradient of such a function, then its curl vanishes. It does not say that every vector field with zero curl must be a gradient; that is a different question and requires additional hypotheses.

The regularity assumption also matters. The proof uses equality of the mixed second partial derivatives. Without suitable hypotheses, one cannot simply interchange the order of mixed differentiation. In routine applications, checking that the scalar function is \(C^2\) on the domain of interest ensures the required equality and makes the cancellation valid.

When applying the result, keep the domain in view. If a formula for \(\phi\) is undefined or fails to have continuous second partial derivatives at some points, the theorem applies only on open regions where the condition does hold. Within such a region, the calculation provides a useful consistency check: a nonzero curl obtained from a gradient signals an arithmetic, differentiation, or sign error.

Key takeaway: For a \(C^2\) scalar function \(\phi\), the curl of \(\nabla\phi\) consists of differences of equal mixed second partial derivatives. Every component is therefore zero: $$ \nabla\times(\nabla\phi)=\mathbf{0}. $$

Check Your Understanding

Use the definitions and smoothness condition above to answer these questions.

  1. Write the three components of \(\nabla\times(\nabla\phi)\) in terms of mixed partial derivatives of \(\phi\).
  2. Which smoothness condition allows the mixed partial derivatives in those components to be interchanged?
  3. For \(\phi(x,y,z)=x^2z+yz^2\), find \(\nabla\phi\), then compute and check each component of its curl.
  4. Where does the identity apply for \(\phi(x,y,z)=\ln(x^2+y^2+z^2)\), and why is the origin excluded?
  5. Why does the fact that \(\nabla\times(\nabla\phi)=\mathbf{0}\) not, by itself, prove that every zero-curl vector field is a gradient?