Differential Calculus and Optimization Basics › Derivatives and Rates of Change

Michael BrenndoerferOctober 24, 202514 min read
Quantitative FinanceAll chapters
Part 1 of 15Mathematical Foundations
Chapter 6Differential Calculus and Optimization Basics › Derivatives and Rates of Change
Reading section 2 of 11 · Derivatives and Rates of Change · 14 minSection 2 of 11 · 14 min

Book contents

Section 2 of 11 · 14 min read

Differential Calculus and Optimization Basics › Derivatives and Rates of ChangeOne section · Sections in this chapter2 / 11 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

The derivative of a function measures its instantaneous rate of change. If f(x)f(x) represents a quantity that depends on xx, then the derivative f′(x)f'(x) tells us how rapidly ff changes as xx changes. In model-based pricing and risk management, sensitivity analysis helps us understand how outputs respond to changes in inputs.

To understand derivatives, consider what it means to measure change. If you know the value of your portfolio today and knew its value yesterday, you can compute how much it changed over that day. But that average change over a day may obscure important dynamics that occurred during trading hours. The derivative captures the limit of the average rate of change as the time interval tends to zero, when that limit exists.

The formal definition of the derivative captures this limiting process precisely. We start by computing the average rate of change over an interval of size hh, then we ask what happens to this average as hh becomes vanishingly small. When this limit exists and is well-defined, we have successfully captured the instantaneous rate of change.

Derivative

The derivative of a function ff at a point xx is defined as the limit of the difference quotient:

f′(x)=lim⁡h→0f(x+h)−f(x)hf'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h}

where:

  • f(x)f(x): the function value at point xx
  • hh: a nonzero signed increment approaching zero
  • f(x+h)−f(x)f(x + h) - f(x): the change in function value over the interval

Here xx is an interior point of the domain, hh approaches zero from both sides, and the limit must be finite. When this limit exists, we say ff is differentiable at xx. At a domain endpoint, a one-sided derivative requires a separate convention. The derivative represents the slope of the tangent line to the function at that point, with units of output per input unit.

The geometric interpretation of the derivative illuminates its meaning. If you graph the function and zoom in on any differentiable point, the curve begins to look more and more like a straight line. The derivative gives the slope of this line, the tangent line that best approximates the function at that point. A positive derivative gives a positive first-order response to an increase in the input; a negative derivative gives a negative response. To infer increasing or decreasing behavior over an interval, the corresponding derivative-sign condition must hold throughout that interval. A zero derivative means the tangent is horizontal, so there is no first-order change at that point. It may signal a maximum or minimum, but by itself it does not determine whether the function is increasing or decreasing nearby.

Out[3]:
Visualization
Plot of f(x) = x^2 with the tangent line at x = 1 and the point (1, 1) highlighted.
Tangent line at x = 1 with slope f'(1) = 2.
Plot of f(x) = x^2 with secant lines for decreasing h approaching the tangent line at x = 1.
Secant lines approaching the tangent as h approaches 0.

Financial Interpretation of Derivatives

In finance, calculus derivatives provide local sensitivity measures. Consider a simple example: the profit function of a market maker.

Financial derivatives such as options and futures depend on an underlying asset, rate, index, or other reference. Calculus derivatives are one way to measure how a differentiable pricing model responds to a small change in that reference or another model input. For example, the sensitivity of an option pricing function to the underlying stock price is its partial derivative with respect to that price. Discrete scenarios, finite differences, and lattice methods can measure related changes without requiring an analytic derivative.

Suppose a market maker's daily profit Π\Pi depends on trading volume VV:

Π(V)=0.001V−500−0.00000001V2\Pi(V) = 0.001V - 500 - 0.00000001V^2

where:

  • Π\Pi: daily profit in dollars
  • VV: trading volume in units
  • 0.001V0.001V: revenue from bid-ask spread ($0.001 per unit)
  • 500500: fixed daily operating costs
  • 0.00000001V20.00000001V^2: market impact costs that grow quadratically with volume

This profit function captures three fundamental aspects of market making. The first term represents the revenue the market maker earns from the bid-ask spread: every time a unit is traded, the market maker captures a small spread of $0.001. If this were the only factor, profit would grow linearly forever. The constant term of 500 represents the fixed costs that must be paid regardless of volume: technology, salaries, rent, and regulatory fees. These costs must be covered before any profit is realized.

The quadratic term is an illustrative market-impact model rather than a universal empirical scaling law. Within this example, total impact cost grows with V2V^2, so marginal impact cost grows linearly with volume and eventually offsets the fixed per-unit spread revenue. Actual impact depends on liquidity, execution horizon, order type, and market conditions; the negative quadratic coefficient is a modeling assumption chosen to create this trade-off.

The first term represents revenue (a small spread earned per unit volume), the constant represents fixed costs, and the quadratic term captures market impact costs that grow with volume. The derivative:

Π′(V)=0.001−0.00000002V\Pi'(V) = 0.001 - 0.00000002V

where:

  • Π′(V)\Pi'(V): the marginal profit at volume level VV
  • 0.0010.001: the marginal revenue per unit (the bid-ask spread)
  • 0.00000002V0.00000002V: the marginal market impact cost, which increases linearly with volume

This is the marginal profit: the local rate of profit change per unit of trading volume. A small increment ΔV\Delta V changes profit by approximately Π′(V)ΔV\Pi'(V)\Delta V. For this quadratic, the exact increment is Π′(V)ΔV−10−8(ΔV)2\Pi'(V)\Delta V-10^{-8}(\Delta V)^2, so a one-unit increment is not exactly the derivative. When Π′(V)>0\Pi'(V) > 0, a sufficiently small volume increase improves profit. When Π′(V)<0\Pi'(V) < 0, marginal market-impact cost exceeds marginal spread revenue.

The original function tells us total profit at any volume level, while the derivative tells us whether a feasible small increase or decrease in volume improves the modeled result. Both questions matter: "Is this activity profitable?" and "Would trading more or less improve it?" The profit level answers the first; the derivative helps answer the second.

In[4]:
Code
# Define profit function and its derivative
def profit(V):
    return 0.001 * V - 500 - 0.00000001 * V**2


def marginal_profit(V):
    return 0.001 - 0.00000002 * V


# Find optimal volume where marginal profit = 0
optimal_volume = 0.001 / 0.00000002
Out[5]:
Console
Optimal trading volume: 50,000 units
Maximum profit at optimal volume: $-475.00
Marginal profit at optimal volume: 0.000000

At 50,000 units, the marginal profit is zero, indicating we have found the profit-maximizing volume. The maximum is still a $475 daily loss: the best volume does not make this particular spread-and-cost model profitable. Beyond this point, each additional unit of volume reduces total profit due to market impact.

For this differentiable, strictly concave quadratic and its interior optimum, zero marginal profit means marginal revenue from one more trade (the bid-ask spread of $0.001) equals marginal market-impact cost. Below 50,000 units the derivative is positive; above it the derivative is negative, so this stationary point is the unique maximum. Marginal benefit equals marginal cost is a first-order condition for an interior differentiable choice, not a universal definition of an optimum: boundary, constrained, or nonsmooth problems require the corresponding optimality conditions.

Out[6]:
Visualization
Line plot of market maker profit versus trading volume with a vertical line marking the optimal volume.
Profit function showing maximum at optimal volume.
Line plot of marginal profit versus trading volume crossing zero at the optimal volume.
Marginal profit crossing zero at the optimal volume.

Option Sensitivities: The Greeks

A major application of derivatives in finance is the calculation of option sensitivities, known as "the Greeks." These measure how an option's model price responds locally to changes in specified inputs while the other inputs are held fixed.

The Greeks earned their collective name because most of them are denoted by Greek letters. The five introduced here summarize several important local sensitivities under a specified pricing model and held-fixed inputs. They are useful for model-based pricing and hedging, but they neither guarantee exact dollar changes nor capture every exposure, such as jumps, volatility-surface dynamics, cross-Greeks, higher-order terms, transaction costs, or model error.

Consider a European call option with model price C(S,T,σ,r;K)C(S,T,\sigma,r;K), holding strike KK and other contract terms fixed. Its varying inputs are stock price SS, time to expiration TT, volatility σ\sigma, and risk-free rate rr. These Greeks are first- or second-order derivatives, with a minus sign for Theta because TT measures time remaining:

  • Delta (Δ\Delta): ∂C∂S\frac{\partial C}{\partial S} measures sensitivity to stock price changes
  • Gamma (Γ\Gamma): ∂2C∂S2\frac{\partial^2 C}{\partial S^2} measures the rate of change of delta
  • Theta (Θ\Theta): −∂C∂T-\frac{\partial C}{\partial T} measures sensitivity to time decay
  • Vega (ν\nu): ∂C∂σ\frac{\partial C}{\partial \sigma} measures sensitivity to volatility changes
  • Rho (ρ\rho): ∂C∂r\frac{\partial C}{\partial r} measures sensitivity to interest rate changes

where:

  • CC: the call option price
  • SS: the current stock price
  • TT: time to expiration in years
  • σ\sigma: the model volatility input; when inferred from an option price, it is the implied volatility for that specified contract, strike, maturity, and model
  • rr: annualized risk-free interest rate, expressed as a decimal

The displayed model uses annualized decimal volatility and positive S,K,T,σS,K,T,\sigma. Expiry and zero-volatility limits need separate treatment. These raw derivatives are per unit of their specified inputs: Vega and Rho quoted per one-percentage-point change are multiplied by 0.010.01, while a per-day Theta quote requires a stated days-per-year convention. The Options Industry Council's Greek definitions describe the same local sensitivities; quotation units must still be kept consistent.

Delta is widely used in option risk management. If an option quoted per share has a delta of 0.5, then a small $1 increase in the stock price changes the model price by approximately $0.50 when other inputs are fixed. Traders can offset an option portfolio's delta with stock or other options. A delta-neutral portfolio has net first-order underlying-price sensitivity near zero, so small stock moves have little first-order effect under the model; the hedge must be rebalanced as delta and other inputs change.

Gamma adds depth to the delta picture by measuring how delta itself changes. An option with high gamma has a delta that changes rapidly as the stock price moves. This is particularly important near expiration for near-the-money options. For a dynamically delta-hedged long-gamma position, sufficiently large realized moves can produce rebalancing gains, but those gains are not automatic and must be weighed against theta, transaction costs, jumps, and other exposures. A short-gamma position faces the opposite convexity and can require frequent hedge adjustments.

These Greeks provide a useful but incomplete local sensitivity summary under the chosen model. Delta and Gamma describe first- and second-order underlying-price effects; Theta describes passage-of-time sensitivity; Vega describes model-volatility sensitivity; and Rho describes interest-rate sensitivity. Hedging them addresses those modeled local exposures, not jumps, cross-effects, volatility-surface changes, liquidity costs, or model risk.

A later Black-Scholes chapter presents their explicit formulas and interpretations. For now, the first-order Greeks approximate the price response to a small change in the corresponding input. Gamma measures how Delta changes and contributes the second-order term 12Γ(ΔS)2\frac{1}{2}\Gamma(\Delta S)^2 to a smooth stock-price response, with other inputs held fixed.

Out[7]:
Visualization
Delta curve for a European call option versus stock price with the strike price marked.
Call option Delta as a function of stock price.
Gamma curve for the displayed European call model peaking near stock price 97.29, slightly below the strike at 100.
For the displayed zero-dividend Black-Scholes inputs (K = 100, T = 0.25, r = 5%, and sigma = 20%), call Gamma peaks near S = 97.29, slightly below the strike.