Basic Prerequisites: none. This page assumes only arithmetic and the idea of a function.


1. Intuition & Practical Objective

This page builds the why of calculus with no prior knowledge needed, and it builds it around the one idea everything else extends: a derivative is the best straight-line approximation of a curve at a point. Not a formula, not a slope symbol - an approximation device. Once you see that, the rest of this folder (gradients, Taylor expansions, optimisation) is just the same idea applied to more variables and more terms.

The dumbest question first: what is calculus for? Three things, and finance needs all three.

  1. Sensitivity (“if I nudge the input, how much does the output move?”). If the stock moves $1, how much does the option move? That ratio is a derivative, and it has a name on a trading desk: delta. Every Greek is a derivative.
  2. Optimisation (“where is the output best?”). At the top of a smooth hill the ground is flat: the derivative is zero. That statement - interior optimum ⇒ derivative zero (Fermat’s principle) - is the seed of every portfolio optimisation, every model fit, every calibration.
  3. Accumulation (“what do the nudges add up to?”). Summing infinitely many tiny contributions is integration, and that is how a payoff times a probability density becomes an expected value.

Three “aha”s before the formal section:

  • The derivative is a local linear model, not a global one. Saying "" means: near , . Far away the line is useless. This locality is exactly why hedging is a small-move activity and why a delta hedge breaks on a gap.
  • “Only the first derivative” is a choice, not a law. A straight line (first derivative) is the simplest model; adding curvature (the second derivative, the Hessian) gives the delta–gamma expansion. Higher derivatives are more accurate over a wider neighbourhood.
  • Fermat’s principle is the whole of static optimisation. At an interior maximum or minimum a differentiable function has zero slope. Everything from “set the gradient to zero” to the KKT conditions is this one fact, constrained and generalised.

2. Mathematical Ground Truth & Derivations

The derivative as a limit.

The fraction on the right is the slope of a secant line through and . As the secant pivots toward the tangent; its limit is the tangent slope. Rearranged, this gives the local linear approximation

Bernstein’s Calculus for Mathematicians makes the local-linearity definition primary (the Carathéodory form): is differentiable at iff there is a function , continuous at , with

This is equivalent to the limit definition and is the cleanest parent of the multivariable total derivative on 03 · Multivariable Calculus.

The derivative is linear (the rules). From the definition follow the sum, product, quotient and chain rules:

The chain rule is the mathematical engine of finance: if the option value is and the stock follows , then - sensitivities compose. It is what makes “the derivative of the payoff with respect to spot” computable at all.

Why a flat point is an optimum (Fermat). If then a small step left decreases ; if a small step right decreases it. Hence at an interior minimum (or maximum) of a differentiable :

This is necessary, not sufficient: has at a point that is neither max nor min. Sufficiency needs the second derivative - for a min, for a max - which is the one-variable case of the Hessian test on page 03.

The mean value theorem (the workhorse). For continuous on and differentiable on , there is an with

It converts a statement about a change in values into a statement about a derivative, and it is the reason finite-difference approximations of derivatives have a controlled error: the secant slope equals the tangent slope at some intermediate point.

Integration and the FTC. The definite integral is the limit of Riemann sums over finer and finer tagged divisions. Its centrepiece is the Fundamental Theorem of Calculus: for differentiable ,

Differentiation and integration are inverse operations. In finance this identity is why a density integrates to a probability and why discounted expected payoffs are well-defined integrals.


3. Computational Implementation - the derivative is the limit, and floating point has a floor

Two experiments, stdlib only. First, watch the difference quotient converge to the true derivative as shrinks - and then watch it fall apart as becomes too small.

Read the table. The forward difference’s error falls linearly in (halving halves the error) until round-off takes over at ; at the subtraction cancels to nothing and the estimate is pure noise. The centred difference is second-order (error ), reaching at - then rising again as round-off, , dominates. There is an optimal where truncation meets round-off; shrinking past it makes the answer worse. That is a first-principles fact about floating point, not a coding bug, and it is why every practical Greek is computed with a sensibly-sized bump, not an infinitesimal one.

Second, the local linear model in action:

The straight line misses by over a step of - the miss is the curvature, the piece a second-order (Hessian/Taylor) model would capture (page 03).


4. Failure Modes & First-Principles Breakdowns

  1. “The derivative is the slope everywhere” - no, it is local. A delta of is exact only for infinitesimal moves. Over a finite move the correct change includes the second-order term ; ignoring it is the delta–gamma hedging error (see BSM · Failure Modes).
  2. Setting the derivative to zero finds all stationary points, including saddles. Fermat’s condition is necessary; without the sign of you can hand back a point that is neither a max nor a min.
  3. The round-off floor is real. As the first experiment shows, “just make tiny” is exactly backwards: below the centred difference gets worse. Numerically, accuracy is a trade-off, never a limit you can take.
  4. Differentiability is an assumption, not a guarantee. Payoff functions like have a kink at ; the derivative does not exist there (it jumps from to ). That single kink is why the gamma of an option spikes at the strike and why the second derivative is where the analytic trouble lives.
  5. The chain rule only composes reasonable functions. requires differentiability of both; a pathology in the inner path (a jump, a non-differentiable curve) breaks the composition - the seed of the Itô correction when the path is Brownian.

5. References

  • Bernstein, D. J.: Calculus for Mathematicians (1997 draft)
  • Spivak, Michael: Calculus (4th ed.)
  • Stewart, Clegg & Watson: Calculus: Early Transcendentals (9th ed.)
  • Simon & Blume: Mathematics for Economists

6. Connected Graph Bridges