Explainers
Collect the first partial derivatives
For f(x, y, z) = x² + 3xy + z²,
∇f = ⟨2x + 3y, 3x, 2z⟩.
Differentiate with respect to x, then y, then z, holding the other variables fixed each time. The gradient is the vector ⟨∂f/∂x, ∂f/∂y, ∂f/∂z⟩. These partial derivatives must exist.
Add the matching component derivatives
For F = ⟨x², 3y, −z⟩,
∇ · F = 2x + 3 − 1 = 2x + 2.
For F = ⟨P, Q, R⟩ in Cartesian coordinates, divergence is ∂P/∂x + ∂Q/∂y + ∂R/∂z. Differentiate each component in its matching direction and add. The result is one number, not a vector.
Keep curl’s cyclic coordinate order
For F = ⟨−y, x, 0⟩, the curl is ⟨0, 0, 1 − (−1)⟩ = ⟨0, 0, 2⟩.
In right-handed Cartesian coordinates, for F = ⟨P, Q, R⟩, use
∇ × F = ⟨∂R/∂y − ∂Q/∂z, ∂P/∂z − ∂R/∂x, ∂Q/∂x − ∂P/∂y⟩.
The derivative pairs cycle through y,z then z,x then x,y. Keep each subtraction in that order.
Give each output its own row
For f(x, y) = x² + y and g(x, y) = xy,
J = [[2x, 1], [y, x]].
The first row differentiates f and the second differentiates g. The first column uses x and the second uses y:
J = [[∂f/∂x, ∂f/∂y], [∂g/∂x, ∂g/∂y]].
All four partial derivatives must exist.
Differentiate twice for the Hessian
For f(x, y) = x²y + 3y², the first partials are 2xy and x² + 6y. Differentiating again gives
Hf = [[2y, 2x], [2x, 6]].
The rows and columns follow x, y. The diagonal entries are ∂²f/∂x² and ∂²f/∂y². The other entries differentiate once in each variable. They agree when the second partial derivatives are continuous, as in this example.