Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.How steep, in which direction?
Stand on a hillside. If you step east, the ground might rise steeply. Step north and it might be almost flat. Step north-east and you get something in between. A slope on a surface depends on the direction you walk.
The slope going purely east (only changes) is the partial derivative with respect to . The slope in any chosen direction is the directional derivative.
A robot arm has several joints. Engineers ask: “if I turn only the shoulder a tiny bit, how far does the hand move?” and “what about only the elbow?”. Those are partial derivatives. They tell the controller which joint to use for each motion.
- 1. On a perfectly flat table, the slope in every direction is…
- 2. The ground rises at slope 2 going east. Going west, the slope is…
- 3. A partial derivative changes how many inputs at once?
Level 1: Beginner
★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.Partial derivatives
Recipe: treat every other variable as a constant and differentiate as usual (A3.1-2).
Example. :
- , since is a constant and vanishes.
- .
At , both equal 4.
Notation: . The partial derivatives with respect to each input are the slopes along the coordinate axes.
- 1. f = x²y + 3y: f_x at (1, 2)?
- 2. f = 3x + 5y: f_y = ?
- 3. f = x² + y²: f_x at (3, 4)?
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.Directional derivatives
For a unit vector :
The last equality holds for differentiable . You only need the partial derivatives to get the slope in every direction. For example, with at and : .
By Cauchy–Schwarz, , with equality when points along . That makes the gradient the direction of steepest ascent (A3.2-3).
Higher partials and Clairaut’s theorem
. For : , so . Computing in the other order, and . They agree, which is Clairaut’s (Schwarz’s) theorem: if the second partials are continuous, the order doesn’t matter. That’s why the Hessian (A3.2-6) is symmetric.
Partials on a computer
A central difference in coordinate costs 2 evaluations, so a full gradient costs (or with forward differences). For a network with parameters that’s hopeless, which is why we use automatic differentiation (A3.1-2, A3.3).
- 1. x²y + 3y at (1, 2), u = (0.6, 0.8): D_u f = ?
- 2. The largest directional derivative of x² + y² at (3, 4)?
- 3. f_xy for x³y² at (1, 1)?
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Partials existing is not enough
(with ) has , since is 0 on both axes. Yet , so isn’t even continuous at the origin. Partials only look along two lines.
Differentiability: the right definition
is differentiable at if there is a linear map, the gradient, with
This is the tangent-plane approximation (A3.2-7). Theorem: if the partials exist near and are continuous at , then is differentiable there. If is differentiable, then . Proof: set , divide by and let . ∎
When Clairaut fails
(with ) has but . Its second partials aren’t continuous at the origin. In practice (smooth losses, physical models), Clairaut holds.
Exercise 3.1: Compute D_u f for f = eˣ sin y at (0, π/2) in the direction (1, 1)
. With , .
- 1. If both partials exist at p, then f is…
- 2. D_u f when u ⊥ ∇f?
- 3. Clairaut's theorem needs…
Level 4: Expert
★★★★★ Expert⏱ 40 minResearchers: original papers and open problems.Derivatives without formulas: zeroth-order methods
When is a black box, such as a physics simulator, a real robot trial or a hardware-in-the-loop test, you can only evaluate it. SPSA (simultaneous perturbation stochastic approximation; Spall, 1992) estimates the gradient from a single directional derivative along a random direction :
It costs 2 evaluations whatever the dimension. Gaussian-smoothing variants (Nesterov and Spokoiny, 2017) and evolution strategies (Salimans et al., 2017) use the same idea to train policies in parallel. On a smooth, cheap function, coordinate finite differences are more accurate per evaluation (Exercise 2). Zeroth-order methods shine when evaluations are noisy or very high-dimensional.
Sensitivity everywhere
- Robot kinematics. The partials form the columns of the manipulator Jacobian (A3.2-5). They decide which joint to move, and they reveal singular poses where a direction becomes unreachable (A2.3-7).
- Forward-mode autodiff computes one directional derivative (a Jacobian–vector product) per pass, at about the cost of one function evaluation (A3.1-2, A3.3).
- Sensitivity analysis in engineering design. guides structural optimization of aircraft and spacecraft parts. Adjoint methods compute all of these at once (Jameson, 1988), the same trick as backprop.
- Feature attribution. “Saliency maps” are partial derivatives of a classifier’s output with respect to each input pixel (Simonyan, Vedaldi and Zisserman, 2014).
References
- A. Clairaut (1740); H. A. Schwarz (1873). On the symmetry of mixed partial derivatives.
- A. Jameson (1988). “Aerodynamic design via control theory.” Journal of Scientific Computing, 3.
- J. Spall (1992). “Multivariate stochastic approximation using a simultaneous perturbation gradient approximation.” IEEE Transactions on Automatic Control, 37(3).
- K. Simonyan, A. Vedaldi, A. Zisserman (2014). “Deep inside convolutional networks: visualising image classification models and saliency maps.” ICLR Workshop.
- Y. Nesterov, V. Spokoiny (2017). “Random gradient-free minimization of convex functions.” Foundations of Computational Mathematics, 17.
- T. Salimans, J. Ho, X. Chen, S. Sidor, I. Sutskever (2017). “Evolution strategies as a scalable alternative to reinforcement learning.” arXiv:1703.03864.
- W. Rudin (1976). Principles of Mathematical Analysis, 3rd ed. Chapter 9.