Multivariable calculus
Gradient of sin(xy): Components and Geometry
For f(x, y) = sin(xy) the gradient is the vector (y cos(xy), x cos(xy)). Differentiate the sine to get cos(xy), then multiply by the derivative of the inside, xy, which is y when x is the live variable and x when y is. The gradient is cos(xy) times the vector (y, x).
Outer derivative first, then the inner one
Set , so . The chain rule for a partial derivative reads , and the only thing that changes between the two components is that inner derivative.
Stack the two into a vector and factor out what they share.
The function is symmetric in and , so the two components must be each other with the letters swapped. They are, which is a free correctness check.
Reading the vector: hyperbolic level curves and flat ridges
Every level set breaks into curves , each one a hyperbola. Since is times , and is the gradient of , the gradient of is always normal to those hyperbolas. The factor only decides how long the vector is and which way along the normal it points.
At the inside is , and .
The gradient vanishes in two situations, and it is worth knowing both:
- On the curves , where . These are the crests and troughs of the surface, where , and the gradient is zero along an entire hyperbola rather than at isolated points.
- At the origin, where even though .
The mistake: leaving the inner derivative behind
The common wrong answer is . It comes from differentiating the sine and stopping there, as if were a single letter.
A point test exposes it instantly. At the true component is , while the wrong version gives . That is a factor of , not a rounding difference.
The structural warning sign is that the wrong gradient has two identical components. If genuinely had matching partials, the surface would climb equally fast in both directions everywhere, which no surface built from the product does.
Frequently asked questions
Where is the gradient of the zero vector?
At the origin, and along every hyperbola . On those hyperbolas , so both components die at once and the surface has a flat ridge or trough running along the whole curve.
Is the gradient perpendicular to the level curves here?
Yes, as it is for any differentiable function. You can see it directly: the level curves are , whose normal direction is , and is a scalar multiple of exactly that.