Math Atom · M-B02

Partial derivatives

8 minMath AtomCalculus

By the end you will be able to

  1. 1Compute a partial derivative by holding the other inputs fixed, and estimate one by bump and revalue.
  2. 2Estimate the change in a function when several inputs move at once, from its partial derivatives.
  3. 3Take second and cross partial derivatives and use them in a second-order estimate.
  4. 4Read an option's delta, vega and gamma as partial derivatives of its value.

Why you need it

A position's value depends on many market inputs at once. A risk report asks a sharper question: if this one input moves and nothing else does, what happens? That number is a partial derivative.

These Core Path lessons use it:

You need ordinary derivatives from M-B01: Derivatives. The second-order estimate extends M-B03: Taylor expansion, and M-B04: Optimisation and Lagrange multipliers sets partial derivatives to zero to find a minimum.

The idea

Walk east, then walk north

On a hillside the ground does not have one slope. Face east and it may rise; face north and it may fall. Each direction has its own slope, and to measure it you walk in that direction only. That is all a partial derivative is: the slope when one input moves and every other input stays put.

Two walks on a hillside

h = 4 − x² − 2y² + xy

Darker is higher; the top is near (0, 0). Dashed lines: the two walks through your spot.

Walk east: y stays at 0.5

-2-1012x
∂h/∂x = −2x + y2.5

Walk north: x stays at −1

-2-1012y
∂h/∂y = −4y + x−3

Height here: 2. Facing east the ground rises; facing north it falls. Move y and watch the east slope change too: that is the cross partial, ∂²h/∂x∂y = 1.

Each slice is an ordinary one-variable curve, so the ordinary derivative applies. Notice too that the east slope depends on where you stand north-south. How one slope changes as another input moves is a second, or cross, partial derivative, and it matters when two inputs move together.

The rules

Hold the others fixed. Treat every other input as a constant, then differentiate as usual. Without a formula, bump and revalue.

Several inputs move. For small moves, the effects add. The partial derivatives form the gradient.

Second partials. Second partial derivatives, collected in the Hessian, add the curvature.

Option Greeks. Each Greek is one of these derivatives of an option's value.

The rules, for reference

∂f∂x≈f(x+h,y)−f(x−h,y)2hΔf≈fxΔx+fyΔy+12(fxxΔx2+2fxyΔxΔy+fyyΔy2)\frac{\partial f}{\partial x} \approx \frac{f(x+h, y) - f(x-h, y)}{2h} \qquad \Delta f \approx f_x\Delta x + f_y\Delta y + \tfrac12\big(f_{xx}\Delta x^2 + 2f_{xy}\Delta x\Delta y + f_{yy}\Delta y^2\big)
fxy=fyxΔ=∂V∂S,    ν=∂V∂σ,    Θ=∂V∂t,    Γ=∂2V∂S2f_{xy} = f_{yx} \qquad \Delta = \frac{\partial V}{\partial S},\;\; \nu = \frac{\partial V}{\partial \sigma},\;\; \Theta = \frac{\partial V}{\partial t},\;\; \Gamma = \frac{\partial^2 V}{\partial S^2}

Try it

RiskAtoms Bank's trading desk holds 1,000 UK index put contracts (illustrative figures from the Module 3.2 book: strike 7,600, three months, £10 per point). Their value depends on the index level S and on implied volatility σ. Move both and see how far the partial derivatives get you. Try a 10% fall with no change in vol: second order closes most of the gap. Then add 8 points of vol: now even second order overshoots, which is why desks revalue in full for large moves.

Try itThe book's puts as a function of two inputs

Black-Scholes model →

Slice to draw

6,8007,6008,0008,4009,200Index level S (σ held at 16)

Blue curve: full revaluation along the slice. Solid line: the tangent, whose slope is the partial derivative (delta). Dashed: the second-order parabola (adds gamma). Today's value: £948,965.

Change in value, built term by term

Δ · ΔS (delta)+£578,040
ν · Δσ (vega)+£248,182
First order+£826,223
½ Γ ΔS² (gamma)+£139,603
∂²V/∂S∂σ · ΔS Δσ (cross)+£57,404
½ ∂²V/∂σ² · Δσ²+£6,667
Second order+£1,029,896
Full revaluation+£1,023,546
First-order error−19.3%
Second-order error0.6%

Worked examples

1. Two inputs move at once

Step 1 of 5
  1. 1

    The set-up

    f(x, y) = x²y + 3y at (x, y) = (2, 1), where f = 7. Estimate the change if x rises by 0.1 and y falls by 0.2.

2. The book's puts: delta, vega and gamma by bump and revalue

Step 1 of 6
  1. 1

    The set-up

    The 1,000 UK index puts are worth V(S, σ) = £948,965 today, at S = 8,000 and σ = 16 vol points (the illustrative Module 3.2 book). Each index point is worth £10,000 across the position. Find the partial derivatives the way a risk system does: bump one input, revalue, hold the other fixed.

3. Index down 3%, volatility up 2 points

Step 1 of 4
  1. 1

    The set-up

    Markets fall: the index drops 240 points (3%) and implied vol rises 2 points, both at once. Estimate the change in the puts' value from the partial derivatives.

Common mistakes

Each line below is a tempting slip. Spot what is wrong, then check.

Reaction

Check what stuck

Question 1 · objective 1

f(x, y) = 3x²y. What is ∂f/∂x at (x, y) = (1, 2)?

Question 2 · objective 1

What does ∂f/∂y mean?

Question 3 · objective 2

At a point, fₓ = 4 and fᵧ = −3. Estimate the change in f if x rises by 0.5 and y by 0.2.

Question 4 · objective 4

A put position has delta −£2,400 per index point and gamma +£5 per point per point. Roughly what is its delta after the index falls 100 points, in £ per point?

Question 5 · objective 3

For a smooth f(x, y), how do fₓᵧ and fᵧₓ compare?

Glossary

Partial derivative (∂f/∂x, fₓ)
The derivative of a function of several inputs with respect to one of them, with all the others held fixed: ∂f/∂x, also written fₓ.
Bump and revalue
Estimating a partial derivative numerically: move one input up and down by a small step, revalue each time, and divide the change by the total step.
Gradient (∇f)
The vector of all first partial derivatives of f, written ∇f. In risk, the list of sensitivities to each risk factor.
Second and cross partial derivatives
A partial derivative of a partial derivative. fₓₓ is the curvature in the x direction; fₓᵧ, a cross partial, says how the x-slope changes as y moves.
Hessian
The square, symmetric matrix of all second partial derivatives of f.
Greeks
A sensitivity of an option's value, named by a Greek letter: delta ∂V/∂S, vega ∂V/∂σ, theta ∂V/∂t, gamma ∂²V/∂S².