§ Gradients · Interactive Graduate Primer
Tensor by Tensor · expanded

Partial derivatives

Learn how changing several inputs changes one output. Begin with partial derivatives, then explore gradient descent, backpropagation, and optimizers. The later sections include proofs and deeper mathematical detail.
A first reading path

Start with sections 2–4, then section 7. Return to the directional-derivative proof after you understand a gradient-descent update. An optimizer is a rule for updating the model’s adjustable numbers.

For L(a, b) = a² + 2b², the gradient at (1, 2) is [2, 8]. The first entry measures change along a while b stays fixed. The second measures change along b while a stays fixed. With step size 0.1, subtract [0.2, 0.8] to reach (0.8, 1.2). The loss falls from 9 to 3.52.

Check: why subtract the gradient?

The gradient points toward the steepest local increase under the usual Euclidean length measure. Subtracting it moves toward a local decrease when the step is small enough. A large step can still overshoot and increase the loss.

3. Partial Derivatives

Introduction

For a function of three variables, changing one input while freezing the other two gives one partial derivative. At the point 1, 2, 0, the worked function produces sensitivities 4, 1, and 1.

Learning goal

Calculate all partial derivatives of a multivariable function and evaluate them accurately at a chosen point.

Before you start

Single-variable derivative rules, algebraic substitution, powers, sine, and points in three-dimensional coordinates.

Lesson plan

  1. Freeze all but one variable and differentiate with respect to that input.
  2. Repeat for every variable while keeping the expression and notation organized.
  3. Substitute the chosen point and interpret each resulting directional sensitivity.

Predict one partial. For f(x,y)=x²+3y, hold y fixed and increase x. At x=2, the partial derivative with respect to x is 4. Holding one variable fixed is the key action.

Definition
$$\frac{\partial f}{\partial x_i}(x) = \lim_{h\to 0}\frac{f(x_1,\dots,x_i+h,\dots,x_n)-f(x)}{h}.$$
Example

$f(x,y,z) = x^2 y + 3yz^2 + \sin z$. Then $\partial_x f=2xy$, $\partial_y f=x^2+3z^2$, $\partial_z f=6yz+\cos z$. At $(1,2,0)$: $\nabla f = (4,\,1,\,1)$.

Warning

Existence of partials does not imply differentiability. A sufficient condition is that all partials are continuous near $x$ — such functions are $C^1$.