Advanced Mathematics

Partial Derivatives and the Gradient

Derivatives of a function of several variables, taken one variable at a time, and the gradient vector that collects them.

Needs a step first: 9

For f(x,y)f(x, y), the partial derivative ∂f∂x\frac{\partial f}{\partial x} is the ordinary derivative in xx with yy held fixed. The gradient ∇f=(∂f∂x,∂f∂y)\nabla f = \left(\frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}\right) points in the direction of steepest increase, its length is that steepest rate, and it is perpendicular to the level curves. The rate of change in any direction u\mathbf{u} is ∇f⋅u\nabla f \cdot \mathbf{u}. This is the basis of Optimisation in Many Variables, Gradient Descent and the wave and heat equations.

Where it shows up: Gradient descent trains a model by stepping against the gradient of the loss with respect to all its weights at once.

How to hold it: By hand, until automatic

Take partial derivatives and assemble the gradient as easily as ordinary derivatives, and read ∇f\nabla f as the uphill direction, perpendicular to the contours.

What knowing it looks like

  • Compute first and second partial derivatives, and check that fxy=fyxf_{xy} = f_{yx} for a smooth example.
  • Find the gradient at a point and explain what its direction and length mean on a contour map.
  • Find a directional derivative and the equation of a tangent plane.

Test yourself

Let f(x,y)=x2y+3y2f(x, y) = x^2 y + 3y^2. Find ∇f\nabla f at (1,2)(1, 2), the rate of change of ff there in the direction of (3,4)(3, 4), and the greatest possible rate of change there.
Show the worked answer
fx=2xyf_x = 2xy and fy=x2+6yf_y = x^2 + 6y, so ∇f(1,2)=(4,13)\nabla f(1, 2) = (4, 13). The direction must be a unit vector: u=(35,45)\mathbf{u} = \left(\frac{3}{5}, \frac{4}{5}\right), giving ∇f⋅u=12+525=645=12.8\nabla f \cdot \mathbf{u} = \frac{12 + 52}{5} = \frac{64}{5} = 12.8. The greatest rate is ∣∇f∣=16+169=185≈13.6|\nabla f| = \sqrt{16 + 169} = \sqrt{185} \approx 13.6, in the direction of (4,13)(4, 13). The trap is dotting with (3,4)(3, 4) itself, which gives 64, five times too big.

Needs a step first: 9

Learn it with an AI

Copy this prompt into any AI assistant. It will take you through step by step at your level and finish with the test above.

Be my maths tutor. I'm learning "Partial Derivatives and the Gradient" (Undergraduate I tier): Derivatives of a function of several variables, taken one variable at a time, and the gradient vector that collects them.
I already know: Rules of Differentiation, Vectors.
Teach it Socratically: first ask what I already know; then explain the core idea with one concrete example and why it's true; then give me three problems, one at a time, easy to hard. Wait for my answer, check every step, and point out mistakes without giving the answer away.
Finish by testing me with this: Let $f(x, y) = x^2 y + 3y^2$. Find $\nabla f$ at $(1, 2)$, the rate of change of $f$ there in the direction of $(3, 4)$, and the greatest possible rate of change there.
Use LaTeX for formulas. When you say where it's used later (machine learning, quantum mechanics), be specific.

On the way to

Recommended