Basic Prerequisites: Linear Algebra & Matrices (vectors, matrices, quadratic forms, eigenvalues). Note: this folder builds the multivariable/optimization machinery the linear-algebra page assumes is available. (these are the folder-level prerequisites for pages 02–06; page 01 states its own, smaller, entry requirements)


1. Intuition & Practical Objective

Quantitative finance is an optimization discipline dressed up as a probability discipline. Portfolio construction minimises variance subject to a return floor; a market maker’s quote minimises inventory risk subject to a spread the client will pay; a model is fit by minimising a loss; a parameter is calibrated by solving . Every one of those sentences is calculus plus constraints.

This folder is the calculus-and-optimization toolbox for the Atlas: the single-variable foundation, the multivariate apparatus (gradients, Jacobians, Hessians), the theory of constrained optima (Lagrange and KKT), the notion of convexity that decides whether a stationary point is the answer, and the iterative algorithms (gradient descent, Newton) that actually find the answer when no closed form exists.

Everything reduces to five primitive ideas:

  1. A derivative is a local linear map → the best linear approximation of a function at a point. → Single-Variable Calculus.
  2. The gradient stacks the partials; the Hessian stacks the second-order curvature → the multivariable Taylor model. → Multivariable Calculus.
  3. Constraint borders bend the first-order condition → the Lagrangian multiplier is the shadow price. → Constrained Optimization.
  4. Convexity turns “stationary” into “globally optimal” → why the practitioner’s life is easy (or not). → Convexity & Applications.
  5. When no closed form exists, iterate → gradient descent’s linear rate, Newton’s quadratic rate. → Gradient & Newton Methods.

This page is the hub: it gives the fast formula and condition lookup below, then routes you to six sub-pages that build each primitive from first principles, with working code and failure modes.

The one-sentence essence. “Differentiate to get a local linear model, set the (constrained) derivative to zero to characterise an optimum, and use convexity to know whether that optimum is the global one - every finance optimisation is this sentence in a different costume.”


2. Mathematical Ground Truth & Derivations

Lookup 1 - the calculus dictionary, single-variable → several variables → finance. Notation: is unless stated; the gradient (column of partials), the Hessian, the Jacobian of a vector map.

ObjectDefinitionFinance reading
Derivative (1-D) - the delta
Fermat (1-D FOC)interior extremum the single-variable seed of ""
Mean value theorem for some basis of finite-difference error bounds (Greeks by bumping)
Taylor (order )delta–gamma–theta P&L expansion
FTCevery expectation/payoff integral
L’Hôpitalif , 0/0 limits in asymptotics, compounding
Gradientdirection of steepest ascent;
Directional derivative, sensitivity to a portfolio “trade direction”
Jacobian (vector map)sensitivity of a vector of outputs to inputs
Hessian, curvature; gamma matrix of a basket
Multivariable Taylor, full delta–gamma expansion
Chain rule (multivariable)diffusion/BSM derivation via Itô

Lookup 2 - optimality conditions (unconstrained and constrained). The whole of static optimisation is this table (Simon & Blume Ch 17–19; Boyd §5.5.3).

ProblemNecessary (interior, CQ holds)Sufficient
(strict)
s.t. bordered Hessian sign condition (§19.3)
s.t. KKT (below)KKT convexity of , affine

The KKT conditions (Boyd eq. 5.49; Simon & Blume §18.6). For s.t. :

The four blocks are primal feasibility · dual feasibility · complementary slackness · stationarity. Dropping the inequalities leaves exactly the Lagrange system. Under convexity (and Slater), KKT is necessary and sufficient (Boyd §5.5.3).

The multiplier is a shadow price (Simon & Blume §19.1–19.2, envelope theorem). Perturb the constraint to ; then at the optimum. In portfolio terms, on "" is the marginal variance bought per unit of extra required return.

Lookup 3 - convexity decides everything. A set is convex if . is convex if ; for functions this is equivalent to everywhere. Convex objective convex feasible set every stationary point is a global minimum - the reason Markowitz, regression and LP are solvable while “pick 10 stocks” is not. Strong convexity sharpens the geometry: (Boyd eq. 9.7).

Lookup 4 - the two workhorse algorithms.

MethodIterateRateNeeds
Gradient descentlinear, factor (Boyd eq. 9.18); step
Newton (damped) (Boyd §9.5.1)quadratic near ; one linear solve/step

The condition number is the whole story: gradient descent needs iterations (Boyd eq. 9.19), Newton is affine-invariant and independent of (Newton decrement measures suboptimality as ).


3. Computational Implementation - one screen, all five primitives

Stdlib only. It differentiates, expands, and optimises - the three things this folder actually does.

(The KKT solve reproduces the full worked system of 04 · Constrained Optimization: equals the numeric .)


4. Failure Modes & First-Principles Breakdowns

Hub signposts - the full first-principles analysis lives on the sub-pages. In one line each:

  1. "" is only necessary, not sufficient. A saddle point satisfies the first-order condition; without a sign check on you can report a maximum as a minimum (page 03).
  2. Constrained optima need a constraint qualification. If the constraint gradients are linearly dependent at , the Lagrange/KKT multipliers may fail to exist and the first-order system is misleading (Simon & Blume §19.5).
  3. Non-convexity makes the solver’s answer a local one. Adding a cardinality cap (“hold at most 10 names”) or fixed costs destroys convexity; gradient methods then report a stationary point that depends on where they started (page 06).
  4. Ill-conditioning kills first-order methods and amplifies second-order ones. Gradient descent needs iterations; Newton’s step solves a system with and loses digits to round-off (pages 05, 06).
  5. Finite differences have a round-off floor. The centred derivative of at reaches accuracy at then degrades back to at - you cannot out-shrink floating point (page 02).

5. References

  • Simon, Carl P. & Blume, Lawrence: Mathematics for Economists (W. W. Norton, 1994)
  • Boyd, Stephen & Vandenberghe, Lieven: Convex Optimization (Cambridge University Press, 2004)
  • Spivak, Michael: Calculus (4th ed.)
  • Stewart, James, Clegg, Daniel & Watson, Saleem: Calculus: Early Transcendentals (9th ed., 2020)
  • Hastie, Tibshirani & Friedman: The Elements of Statistical Learning (2nd ed., 2009)
  • Tsay, Ruey S.: Analysis of Financial Time Series (3rd ed.)
  • Bernstein, D. J.: Calculus for Mathematicians (1997 draft) - internal foundation note. Scope caveat: this is a compact, proof-based single-variable only text (continuity, Carathéodory derivatives, completeness, MVT, Kurzweil–Henstock integration, limits/L’Hôpital). It contains no multivariable calculus, no Taylor/power series, and no optimisation beyond Fermat’s interior-extremum principle. It underwrites page 02 only; pages 03–06 are built from Simon & Blume, Boyd and Stewart.

6. Connected Graph Bridges

Beginner: start at 01 · Practitioner: start at 05