Trading Dev AcademyFree quant education

Free lesson · Differential calculus

Stationary points, optimisation and Newton’s method

Open interactive lessonPractice calculationsExplore labs

Start with the idea

  • Optimisation asks where a function is largest or smallest within the allowed domain.
  • A zero derivative gives a candidate interior point, not an automatic optimum.
  • Roots are a different problem: finding where a function itself is zero.
Symbols, units & horizon
  • f: objective being optimised
  • x*: candidate interior optimum
  • g: function whose zero is sought in Newton’s method
  • x_k: current iterate at step k
  • g′: derivative of the root function
  • k+1: next numerical iterate
  • J(w): utility example as a function of weight w
  • μ,λ,σ²: expected return, positive risk aversion and positive return variance
  • μ and σ² refer to the same return horizon
  • w: dimensionless portfolio weight, with λ scaled to the chosen utility units

When and why to use this

Use derivative signs and boundaries for hand optimisation, then use numerical root methods for equations without convenient inverses. Keep a bracketed method available when Newton is unreliable.

  • For a differentiable function at an unconstrained interior optimum, the slope must be zero.
  • Inspect curvature, endpoints, constraints and any nondifferentiable points.
  • A positive second derivative establishes a strict local minimum at a stationary point; a zero second derivative is inconclusive.
  • Newton’s method solves a root problem by replacing the function with its tangent and finding the tangent’s zero.
  • It is fast near some well-behaved roots but may diverge or leave the valid domain.
  • To optimise with Newton, apply it to the gradient, which uses curvature in the denominator.
f′(x∗)=0,xk+1=xk−g(xk)g′(xk)
Calculus: derivation and arithmetic

Stationary points, optimisation and Newton’s method

  1. For J(w)=μw−λσ²w²/2, differentiate: J′=μ−λσ²w. Set J′=0 and solve w*=μ/(λσ²). Since J″=−λσ²<0, this is the global maximum of this unconstrained quadratic.
  2. The tangent to g at x_k is g(x_k)+g′(x_k)(x−x_k). Set it to zero and isolate x to obtain the Newton update.
  3. To compute √2, let g(x)=x²−2 and g′=2x. Starting at 1 gives 1.5; the next step is 1.5−.25/3=1.416667.
Work it by hand

For J(w)=.02w−.1w², J′=.02−.2w gives w*=.1 and J″=−.2. On a constrained interval [0,.05], the best weight is .05 instead; the unconstrained stationary point is not feasible.

An analogy to remember

A flat slope can be a hilltop, a valley, or a flat point on a continuing climb. Look around it before deciding which it is.

How this becomes a building block

First-order conditions are building blocks of portfolio optimisation. Newton-style root finding appears in yield and implied-volatility calculations, where a price error is driven toward zero. The algorithm solves the assumed equation; it does not validate the market model.

For current applications and implementation limits, see the research checkpoint in Differential Equations.

Research sources, review dates and limitations

Extend the research question

Translate a local derivative into an option hedge and compare a small move with a large move. Explain why the local approximation changes when other risk factors move.

Continue with the connected research module →

Connect the ideas: Sensitivity and approximation

Retrieve: A local sensitivity describes how a model responds near a specified input.

Check the change: The input, its units and what is held fixed differ across slope, duration and option sensitivities.

Partial derivatives → Rates, credit & macro → Stochastic calc → Options → Volatility

Explain it yourself: What must you check before using a small-move approximation for a large scenario?

Self-assessed. Write your explanation before opening this comparison.

Check the expansion point, units, held-fixed inputs, curvature and model domain; compare with a full repricing under the same scenario.

Python implementation

Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.

def quadratic_optimum(mu,risk_aversion,variance):
    if risk_aversion<=0 or variance<=0: raise ValueError("Positive inputs required")
    return mu/(risk_aversion*variance)

def newton_step(function,derivative,x):
    slope=derivative(x)
    if abs(slope)<1e-12: raise ValueError("Derivative too small")
    return x-function(x)/slope

x=1.0
for _ in range(4): x=newton_step(lambda x:x*x-2,lambda x:2*x,x)
print(x,quadratic_optimum(.02,2,.1))

Continue learning

Differential Calculus: Limits & Derivatives — all lessons
  1. Start with a straight line: input, output and slope
  2. Functions, limits and continuity
  3. The derivative: from an average slope to an instantaneous rate
  4. Core derivative rules: constants, powers and sums
  5. Derivative rules: powers, products, quotients and compositions
  6. Second derivatives, Taylor expansions and numerical error
  7. Stationary points, optimisation and Newton’s method

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations