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.
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:
Each pair is a pair of mixed second partial derivatives of the same scalar function. Now apply the curl formula to \(\nabla\phi\).
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\).
Set \(P=\phi_x\), \(Q=\phi_y\), and \(R=\phi_z\), so \(\nabla\phi=\langle P,Q,R\rangle\).
The three components are \(\phi_{zy}-\phi_{yz}\), \(\phi_{xz}-\phi_{zx}\), and \(\phi_{yx}-\phi_{xy}\).
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:
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
The second component is
The third component is
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
Thus \(P=ye^{xy}\sin z\), \(Q=xe^{xy}\sin z\), and \(R=e^{xy}\cos z\). Differentiate the components needed for the curl:
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
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
Let \(P=2x/s\), \(Q=2y/s\), and \(R=2z/s\). Differentiating and using \(s_y=2y\), \(s_z=2z\), \(s_x=2x\) gives
For instance, \(R_y=\frac{\partial}{\partial y}(2z/s)=-(2z)(2y)/s^2=-4yz/s^2\). The curl is therefore
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.
Check Your Understanding
Use the definitions and smoothness condition above to answer these questions.
- Write the three components of \(\nabla\times(\nabla\phi)\) in terms of mixed partial derivatives of \(\phi\).
- Which smoothness condition allows the mixed partial derivatives in those components to be interchanged?
- For \(\phi(x,y,z)=x^2z+yz^2\), find \(\nabla\phi\), then compute and check each component of its curl.
- Where does the identity apply for \(\phi(x,y,z)=\ln(x^2+y^2+z^2)\), and why is the origin excluded?
- Why does the fact that \(\nabla\times(\nabla\phi)=\mathbf{0}\) not, by itself, prove that every zero-curl vector field is a gradient?