Motivation
A temperature at a point in a room depends on three coordinates. Moving east while keeping the other coordinates fixed is one experiment; moving upwards is another. A partial derivative records the rate observed in one such experiment. It lets us reuse one-variable differentiation without pretending that a function with several inputs has only one possible rate of change.
The phrase “keep the other variables fixed” carries mathematical content. It specifies a line through the point, a one-variable function on that line, and a limit of difference quotients. Once this restriction is understood, familiar product, quotient and composition rules become available. Their answers describe coordinate directions. A separate argument is needed before those coordinate measurements can be combined into a prediction for an arbitrary displacement.
This section develops the coordinate measurements first. We collect them in the gradient, examine repeated differentiation, and establish a useful condition under which mixed derivatives agree. The distinction between the existence of partial derivatives and stronger local regularity is essential: a finite list of coordinate tests cannot by itself control every possible way of approaching a point.
Before you start
You should be comfortable with one-variable difference quotients and the rules for differentiating products and compositions. A point in an open subset of Euclidean space has a small ball around it inside the domain. This guarantees that short movements in either coordinate direction remain available. We use the standard basis vector , whose th entry is one and whose other entries are zero.
Definitions
Definition
Partial derivative at a point
Let be open, let , and let . The th partial derivative is the limit
when that finite limit exists. We also write . For two variables, and .
For a function of two variables, define near . Then . The second coordinate is fixed at the number throughout the limiting process. It is not replaced by a function of the first coordinate. If instead we study , both inputs move and the derivative belongs to a different question.
When the formula is defined on an open set, calculate a partial derivative as a function before evaluating at the desired point. For example, differentiation with respect to treats a factor depending only on as a constant. A factor such as still depends on , so its derivative includes the factor from the one-variable chain rule.
Definition
Gradient and repeated partial derivatives
When all first partial derivatives exist at , the gradient is
We use the convention : first differentiate with respect to , then with respect to . A function is of class on an open set if all partial derivatives of orders at most exist and are continuous there.
The gradient is a vector of coordinate rates. Each entry retains its own input unit: a derivative with respect to metres and a derivative with respect to seconds measure different changes. When Euclidean geometry is used to interpret its direction, the coordinate scaling must be part of the model. Merely writing two measurements next to each other does not remove their physical dimensions.
The adjective continuous in the definition of is important. Existence of a derivative at every point does not automatically make that derivative continuous. The notation means that derivatives of every finite order exist and are continuous. Polynomial functions provide basic examples. Rational functions are smooth on the open set where their denominators do not vanish.
Theorem and proposition
Theorem
Algebra of partial derivatives
If and have an th partial derivative at , then so do and , with
If also , the quotient is defined along the coordinate line sufficiently near and
These statements follow by restricting both functions to the same coordinate line. The quotient hypothesis is local to that restriction: differentiability of the restricted function makes it continuous there, so a nonzero denominator remains nonzero for sufficiently small coordinate increments. This proof uses no claim of full multivariable continuity.
Theorem
Equality of continuous mixed partial derivatives
Suppose is of class on an open neighbourhood of . Then
More generally, for a function, a repeated partial derivative of order at most is unchanged by permuting the order of differentiation.
The mixed derivative theorem is a permission to change an order under stated regularity. It is not a definition of mixed derivatives and does not say that two formal strings of symbols must always agree. In many routine calculations, smoothness is immediate from the elementary functions involved and the fact that the point lies inside their domain. For a piecewise definition at a special point, that regularity must be checked rather than inferred from the expression away from the point.
Proof idea
Proof
A rectangular increment compares the two orders
For small nonzero , consider
Apply the one-variable mean value theorem first in the direction and then in the direction. There are intermediate points tending to as for which
Applying the same argument in the reverse order gives, at possibly different intermediate points,
Continuity of the two mixed derivatives makes the right sides tend to their values at . Since the left side is the same rectangular increment, those two values are equal. The argument works for positive or negative increments by using the interval between the relevant endpoints.
The rectangle is useful because it removes the changes attributable to just one coordinate. Its four terms compare the additional change caused by moving in the second coordinate after moving in the first. The proof does not require the intermediate points from the two calculations to be identical. Continuity brings both of them to the same target point.
For the higher-order assertion, adjacent differentiation orders can be exchanged by applying the second-order result to the appropriate lower derivative. Repeating adjacent exchanges produces any desired permutation. The hypothesis ensures that the derivatives needed at every exchange exist with the relevant continuity.
Worked examples
Worked example
Three inputs and one coordinate at a time
Let
All inputs are real. Its coordinate derivatives are
At these give
To check the middle entry directly, restrict to . The derivative at zero is two. To check the first entry, restrict to , so its derivative is zero.
Repeated differentiation gives
The equality also follows before calculation because is smooth. Computing it explicitly checks that the factor from differentiating the exponent has been retained. The gradient here describes the three separate coordinate experiments; interpretation for a general direction will follow from differentiability.
Worked example
Coordinate derivatives without continuity
Define
On either coordinate axis the function is zero. Consequently,
Along the line , however, for every nonzero . The value does not approach . Thus is not continuous at the origin even though both coordinate derivatives exist there.
The calculations do not conflict. A partial derivative uses one prescribed line. Continuity concerns all nearby points in the domain. The axes simply miss the behaviour along the diagonal. This example also prevents us from using the gradient as evidence that the function is locally constant or has a good linear approximation.
Worked example
Mixed derivatives can disagree at a special point
Define
First because the restrictions to both axes vanish. For fixed , the defining quotient for the first derivative gives
Therefore . For fixed , the other coordinate calculation gives , and hence .
The function itself is continuous at the origin: the estimate proves this. Continuity of the original function is therefore insufficient to force equality of its mixed derivatives. The hypotheses concern derivatives of the function, not just the function's values.
A dependable calculation routine
Start by writing the open domain, including every logarithm and denominator restriction. State which variable is being differentiated. Keep every other independent input fixed, and apply one-variable rules to the resulting expression. Only then substitute the coordinates of the point. This order avoids losing terms that become zero only after substitution.
For a piecewise function, decide whether the point lies on the exceptional part. Away from that part, ordinary formulas may apply. At the exceptional point, return to the defining difference quotient. A formula derived where a denominator is nonzero need not remain valid after substituting a point where that denominator vanishes.
When computing higher derivatives, write an intermediate derivative if there is any ambiguity about order. Verify a mixed derivative by changing the order only after you have established the theorem's regularity conditions. If the calculation is smooth and both orders are easy, obtaining the same answer is a useful arithmetic check. If the answers differ, first inspect both the calculation and the hypotheses; neither should be discarded automatically.
From one rate to a derivative function
There are two different objects in the notation . At a fixed point, is a single number obtained from one difference quotient. On a region where these pointwise limits exist, the assignment is a new function. A second partial derivative studies this new function. Understanding that change of object prevents a frequent error: knowing only the value of the first derivative at one point is not enough to calculate its derivative there.
For example, the statement gives the value of the derivative function at one point. It does not say that this derivative function vanishes at nearby points, and it does not imply . To calculate the latter from the definition, one needs the values for small nonzero . The mixed-derivative counterexample computes precisely those nearby values before taking the next quotient.
The order of these operations also explains why checking the domain remains necessary after the first differentiation. A derivative function may be defined on a smaller region than the original function, or may require a separate value at an exceptional point. Write that region beside the derivative when it changes. A correct expression without its region of validity can be misleading when the next step is a limit at a boundary or a special point.
Common mistakes
Common mistake
Substituting too early changes the function being differentiated
If , then , but differentiating this single number cannot produce the derivative function. Compute first. To compute a derivative at a special point from the definition, use nearby values with the other coordinate fixed, rather than replacing all nearby inputs by the point itself.
Another frequent mistake is to differentiate a dependent input as though it were independent. For , the symbol holds fixed. For the composite , the derivative follows both changing inputs. The same written formula can participate in both questions, but the requested derivative is determined by how its inputs are allowed to move.
The gradient is also not the value of the function. A zero gradient says that the first coordinate rates vanish at that point. It says nothing by itself about the sign of the function, its value at other points, or the classification of a critical point. Even for smooth functions, second and higher information can distinguish very different local shapes.
Summary
The partial derivative is a one-variable derivative of a coordinate restriction. The gradient collects all first coordinate rates, while repeated partial derivatives measure how those rates change. Algebra rules follow from one-variable calculus. Continuous mixed derivatives can be exchanged; existence alone does not justify an exchange. Keep the point, the domain and the order of differentiation visible throughout a calculation.
Exercises
Checkpoint
For , find and .
Differentiate the denominator when differentiating the first derivative a second time.
Solution · Solution 1: differentiating a smooth logarithm
Since everywhere,
Thus . Also
Checkpoint
For , calculate and directly from coordinate restrictions.
Use one restriction through the given point for each coordinate.
Solution · Solution 2: two different restrictions
For the first coordinate, , so the quotient is one. For the second,
The derivatives are respectively and .
Checkpoint
For , calculate both mixed second derivatives. Explain why they must agree at every point.
Use the convention that differentiates with respect to .
Solution · Solution 3: the order and its justification
We have and . Therefore . A polynomial is on , so the mixed derivative theorem applies everywhere.
Clairaut at one point: which assumptions do the work?
Theorem
Clairaut with continuity only at the target point
Let be defined on an open set containing . Suppose and exist throughout an open ball about , and both mixed derivative functions are continuous at . Then
Here . Existence throughout the ball includes the first partial derivatives needed to define these mixed derivatives. Continuity is required at the target point, not at every point of the ball.
There are two different locations in the assumptions. Existence nearby lets us differentiate along the small rectangle used in the proof. Continuity at the target lets the derivative values at intermediate points converge to the derivative value we want. Merely knowing that both mixed derivatives exist at does not supply the first condition. Continuity of itself does not supply the second condition.
The earlier version is a convenient sufficient condition: it requires every second partial to be continuous throughout a neighbourhood. This pointwise version requires less. In particular, it does not ask for continuity of or . Conversely, equality of the two mixed derivatives at one point does not prove any of these regularity assumptions; a sufficient condition is not a necessary condition.
Proof
Why the rectangular proof needs only pointwise continuity
Use the same increment as above and choose so that the entire rectangle lies in the ball. Set . The existence of makes differentiable on a slightly larger interval, hence continuous on the closed interval between and . The one-variable mean value theorem gives
Next apply it to , whose derivative exists throughout the required interval:
Reversing the roles of the coordinates gives . Each intermediate point lies inside the shrinking rectangle and therefore tends to . Continuity of the mixed derivatives at gives the two limits of the same quotient . They must be equal. No continuity of mixed derivatives away from was used.
Worked example
Use the theorem to choose an easier differentiation order
Let and calculate . Products and compositions of polynomials and the exponential are smooth on all of , so the theorem applies. Differentiating in the stated order gives
The other order starts with and gives the same expression after differentiating in . The theorem justifies choosing either order; the agreement is also an arithmetic check. Substituting into before taking both derivatives would erase the transverse information and incorrectly suggest zero.
Common mistake
The theorem being unavailable is not a proof of inequality
If continuity has not been established, say “Clairaut is not yet justified”, not “the mixed derivatives are unequal”. To prove inequality, compute both derivatives, as in the earlier piecewise example. To use the contrapositive correctly: if both mixed derivatives exist in a ball and their values at its centre differ, then they cannot both be continuous at that centre.
Checkpoint
4. Separate a theorem's hypotheses from its conclusion.
Suppose and exist in a ball about , are continuous at , and no information about or is supplied. Can you conclude equality at ? Can you conclude equality everywhere in the ball? What changes if only existence at is known?
Solution · 4. Local information gives a local conclusion
Equality at follows from pointwise Clairaut; pure second derivatives are not needed. Equality everywhere in the ball does not follow from these stated assumptions: continuity at its other points has not been supplied, so apply the theorem separately where its hypotheses hold. If only existence at is known, equality is not guaranteed. The earlier function has and , which is an explicit counterexample to that weaker claim.