Multivariable calculus
Gradient of xy: Why It Is (y, x) and Not (x, y)
For f(x, y) = xy the gradient is (y, x). The components come out swapped: differentiating in x leaves the y factor behind, and differentiating in y leaves the x factor behind. At the point (2, 3) the gradient is (3, 2), not (2, 3).
Freeze one variable and the other becomes a coefficient
Hold fixed. Then is a constant multiple of , and the derivative of a constant multiple of is that constant.
Hold fixed instead. Now is a constant multiple of , and the same reasoning applies.
So . It is worth saying out loud: the -component is .
The mistake: copying the point instead of swapping
Two errors show up on almost every set of papers. The first is pattern matching, writing because the components should surely go in variable order. They do go in variable order, but the entry in the slot is , and that partial happens to equal .
The second is reaching for the product rule and differentiating both factors at once, producing . The product rule applies only when both factors depend on the variable you are differentiating. Here does not depend on , so its derivative with respect to is zero and the second term never appears.
- , so the answer at a point uses the other coordinate.
- is the product-rule error, and you can spot it because the two components come out equal.
- A quick sanity check: on the line , has slope in the direction, matching .
Level curves, and a perpendicularity check
For each nonzero , setting gives a hyperbola with the coordinate axes as asymptotes, sitting in the first and third quadrants when and in the second and fourth when . The level set is the degenerate case, the two axes themselves. The graph is a hyperbolic paraboloid, the standard saddle used in every Calc 3 course.
Take the point , which sits on the level curve . Differentiating implicitly gives , so and a tangent direction is . Dot it with the gradient:
The gradient vanishes only at the origin, where . That is the saddle point at the centre of the surface, and it is not a maximum or a minimum: is positive in the first quadrant and negative in the second.
Frequently asked questions
Is the gradient of xy ever parallel to the position vector?
Yes, when is a multiple of , which needs , so . On the line the gradient equals the position vector; on it is the negative of it.
What is the directional derivative of xy at (2, 3) toward the origin?
The unit vector toward the origin is . Then , so decreases in that direction.