Basic Prerequisites: 02 · Single-Variable Calculus and Linear Algebra & Matrices (vectors, matrices, quadratic forms, eigenvalues).
1. Intuition & Practical Objective
Finance is multivariable the moment you hold more than one asset. A portfolio value depends on every price; a risk number depends on every factor loading; a model depends on every parameter. This page builds the three objects that turn “a function of many variables” into something you can reason about:
- the gradient - the vector of first partials; the direction of steepest ascent, and the multi-asset generalisation of delta;
- the Jacobian - the matrix of first partials of a vector-valued map; how a whole vector of outputs (e.g. a set of option prices) responds to a whole vector of inputs;
- the Hessian - the symmetric matrix of second partials; the curvature, the multi-asset gamma, and the object that decides whether a stationary point is a minimum, maximum or saddle.
The objective is one sentence: second-order Taylor with a gradient and a Hessian is the universal local model of a multivariable quantity, and its quadratic term is where all the interesting risk lives - covariance, convexity, curvature-driven hedging error.
The one-sentence essence. “In several variables the derivative is not a number but a linear map (the gradient or Jacobian), and the second derivative is not a number but a symmetric matrix (the Hessian); sign-definiteness of that matrix is the multivariable second-derivative test.”
2. Mathematical Ground Truth & Derivations
Partial derivatives. Hold all variables but one fixed and differentiate:
The total derivative (the local linear map). is differentiable at iff there is a vector with ; then , the gradient, whose components are the partials. This is Bernstein’s Carathéodory idea lifted to (Simon & Blume §14.4): the derivative is the best linear approximation.
Directional derivative and steepest ascent. For a unit vector ,
By Cauchy–Schwarz , with equality when : the gradient points in the direction of steepest increase, and its norm is the maximum rate. This is the entire geometric content of gradient descent (page 05).
Gradient rules. Linearity ; product ; and the chain rule along a curve :
For a composite with an inner linear map , - the reason covariance matrices enter through factors.
Jacobian (vector-valued maps). For , the derivative is the Jacobian matrix with , and
The chain rule in matrix form is - matrix multiplication of local sensitivity maps. When , is the local volume scale factor (the change-of-variables Jacobian in densities).
Hessian and the second-order Taylor model. For twice differentiable, the Hessian is the symmetric matrix (symmetry is Clairaut/Schwarz’s theorem: mixed partials commute for functions). Then
The multivariable second-derivative test (Simon & Blume Ch 16, §17.3): at a stationary point ,
- (positive definite, all eigenvalues ) strict local minimum;
- (negative definite) strict local maximum;
- indefinite (mixed-sign eigenvalues) saddle point;
- semidefinite (a zero eigenvalue) test inconclusive (need higher order).
For a Hessian this is the familiar test: and positive definite.
Finance reading - the Greeks as a gradient/Hessian. With :
The gamma matrix is exactly the Hessian’s asset block; its off-diagonals are cross-gammas. And the covariance matrix of a linear portfolio is itself a quadratic form - the same object appearing as curvature.
3. Computational Implementation - gradient, directional derivative, Hessian, Jacobian
Stdlib only. We take (a convex quadratic), compute the analytic gradient and Hessian, cross-check the gradient by central differences, verify the directional derivative, then build the Jacobian of a nonlinear map and check the first-order Taylor model.
Read the results. The analytic gradient matches the finite-difference gradient to six decimals; the directional derivative along equals because that direction is exactly the gradient direction () - so the directional derivative is maximal there, which is the steepest-ascent fact in numbers. The Hessian eigenvalues are both positive: is strictly convex and its single stationary point is the global minimum. The Jacobian’s determinant is - the map fails to be locally invertible at , a genuine degeneracy (its two rows are identical). Finally the first-order Taylor model reproduces to , and the error scales like - the quadratic remainder.
4. Failure Modes & First-Principles Breakdowns
- A zero gradient is not an answer; the Hessian decides its nature. The same condition holds at a min, a max and a saddle. Report the eigenvalues of (or at least its definiteness) or you have not characterised the point. In variables a saddle is the generic outcome, not the exception.
- A singular or nearly-singular Jacobian means the map is locally non-invertible. Here ; nearby, the implicit-function theorem fails and the inverse mapping (e.g. recovering implied vols from prices) is unstable or undefined. Near-singular (small but nonzero) is worse in practice: the inverse exists but amplifies noise by .
- The Hessian’s conditioning, not its definiteness, sets numerical robustness. Positive definiteness guarantees a minimiser exists; a huge condition number means the level sets are thin ellipsoids and any gradient-based solver crawls (page 05). Asset covariance matrices are routinely ill-conditioned.
- Discontinuous or non-differentiable objectives break everything. A cardinality constraint (“at most 10 names”) makes the feasible set non-convex and the objective non-smooth; and do not exist at the kinks, so gradient and Newton methods are invalid there (page 06).
- Partial derivatives are local, and cross-derivatives can be non-commuting if fails. Clairaut’s theorem ( symmetric) needs the mixed partials continuous; for pathological functions is asymmetric and the quadratic-form picture collapses. In practice, always symmetrise an empirical Hessian: .
- The gradient direction is not scale-invariant. With variables of wildly different units (a price in dollars, a vol in percent), the gradient’s largest component is chosen by units, not importance; this is why one standardises inputs before gradient-based fitting.
5. References
- Simon & Blume: Mathematics for Economists
- Stewart, Clegg & Watson: Calculus: Early Transcendentals (9th ed.)
- Hubbard, John H. & Hubbard, Barbara Burke: Vector Calculus, Linear Algebra, and Differential Forms (5th ed.)
- Spivak, Michael: Calculus
6. Connected Graph Bridges
- Back: 02 · Single-Variable Calculus · Index Hub
- Next: 04 · Constrained Optimization (add equality/inequality borders to ) → 05 · Gradient & Newton (follow , utilise )
- Base: Linear Algebra & Matrices (quadratic forms, eigenvalues, definiteness)
- Applied: Greeks & Hedging (delta vector, gamma matrix) · Mean–Variance Optimization ()