Phase 2 - Lesson 2.4

Taylor Series and Local Approximation

Approximating a function near a point by a polynomial built from its derivatives - the workhorse behind linearization, duration, convexity, and Itô’s lemma.

⏱ 60 min● Intermediate🔗 Prereqs: 2.3
↖ Phase 2 hub
Builds on: 2.2-2.3 gave derivatives of all orders; Taylor assembles them into a local model.
Leads to: First- and second-order Taylor terms become delta/gamma hedging and the drift/diffusion split of Itô’s lemma.

Learning Objectives

Click a status chip to cycle: Not started → In progress → Studied → Practiced → Needs review → Mastered.

Key Vocabulary

Taylor polynomial
P_n(x)=∑_{k=0}^n f^{(k)}(a)(x−a)^k/k!, the best degree-n polynomial matching f and its derivatives at a.
Linearization
The degree-1 Taylor polynomial f(a)+f′(a)(x−a); the tangent-line approximation.
Lagrange remainder
R_n=f^{(n+1)}(ξ)(x−a)^{n+1}/(n+1)! for some ξ between a and x; the exact error.
Maclaurin series
A Taylor series centered at a=0.
Duration
−(1/P) dP/dy, the first-order sensitivity of a bond price to its yield.
Convexity
(1/P) d²P/dy², the second-order curvature correction to duration.

Building a local model from derivatives

Near a point \(a\), a smooth function looks like a polynomial whose coefficients are its derivatives at \(a\). The degree-\(n\) Taylor polynomial is

\[P_n(x)=\sum_{k=0}^{n}\frac{f^{(k)}(a)}{k!}(x-a)^k=f(a)+f'(a)(x-a)+\frac{f''(a)}{2}(x-a)^2+\cdots\] (2.5)

The degree-1 piece is the tangent line (linearization); the degree-2 piece adds curvature. Taylor’s theorem makes the error exact via the Lagrange remainder \(R_n=\frac{f^{(n+1)}(\xi)}{(n+1)!}(x-a)^{n+1}\) for some \(\xi\) between \(a\) and \(x\).

Worked Example - Maclaurin series of e^x and a numerical estimate
1
All derivatives of \(e^x\) are \(e^x\), worth 1 at \(a=0\). So \(e^x=1+x+\tfrac{x^2}{2}+\tfrac{x^3}{6}+\cdots\).
2
Estimate \(e^{0.1}\) with three terms: \(1+0.1+0.005=1.105\).
3
True value \(\approx1.10517\); the error is about \(1.7\times10^{-4}\), consistent with the next term \(x^3/6\approx1.67\times10^{-4}\).

Finance link: duration and convexity

A bond’s price \(P(y)\) as a function of yield \(y\) is smooth and convex. Expanding to second order about the current yield \(y_0\):

\[P(y_0+\Delta y)\approx P(y_0)+P'(y_0)\,\Delta y+\tfrac12 P''(y_0)\,\Delta y^2\] (2.6)

Dividing by \(P\), the first-order term defines (modified) duration \(D=-P'/P\) and the second the convexity \(C=P''/P\), giving the practitioner formula \(\Delta P/P\approx -D\,\Delta y+\tfrac12 C\,\Delta y^2\). Duration is the linear risk; convexity is the Taylor curvature correction that makes the estimate accurate for larger yield moves.

Interactive: Taylor polynomial explorer

Common Mistakes to Avoid
  • Treating a Taylor approximation as exact far from the center; accuracy is local and the remainder grows with |x−a|.
  • Dropping the 1/k! factorial weights in the coefficients.
  • Using only duration (linear term) for large yield moves and ignoring the convexity correction.
  • Confusing a Taylor polynomial (finite, with remainder) with a convergent Taylor series (infinite, needs a convergence check).
Quant Practitioner Tips
  • For quick mental estimates, e^x≈1+x, ln(1+x)≈x, and (1+x)^p≈1+px near 0.
  • The remainder’s size is governed by the next derivative and the distance to the center - bound both.
  • Second-order Taylor is exactly the delta-plus-gamma picture of option risk; the quadratic term is gamma/convexity.
  • When a function equals its Taylor series (analytic), you may differentiate and integrate term by term.

Practice this in the Euler Lab

Computational problems that exercise exactly this technique. Each opens in the Euler Lab with a Python workbench, a progressive hint ladder, and answer checking. Tier A/B run at full scale in the browser.

Warm-up:
#24 Lexicographic Permutations (6%, tier A) #65 Convergents of $e$ (6%, tier A) #205 Dice Game (10%, tier A) #68 Magic 5-gon Ring (9%, tier B)

Applied:
#816 Shortest Distance Among Points (17%, tier B) #323 Bitwise-OR Operations on Random In (18%, tier B) #479 Roots on the Rise (19%, tier B)

Challenge:
#666 Polymorphic Bacteria (41%, tier C) #869 Prime Guessing (41%, tier C)

162 Project Euler problems in total are mapped to this lesson. Open the Euler Lab to filter them all.

Knowledge Check

Q1 Easy
The linear (first-order Taylor) approximation of f about a is:
f(a)
f(a)+f′(a)(x−a)
f′(a)(x−a)
f(a)+f″(a)(x−a)²/2
Q2 Medium
In the Maclaurin series e^x=∑ x^k/k!, the coefficient of x³ is:
1
1/3
1/6
3
Q3 Medium
For a bond, ΔP/P ≈ −DΔy + ½CΔy². The convexity term CΔy² is:
the linear risk
the second-order Taylor curvature correction
always negligible
the same as duration

Practical Exercise

(a) Find the third-order Taylor polynomial of \(\ln(1+x)\) about \(a=0\). (b) Use it to approximate \(\ln(1.2)\) and comment on the error using the next term.

▶ Show full solution

(a) Derivatives at 0: \(f=\ln(1+x),\ f'=\tfrac{1}{1+x},\ f''=-\tfrac{1}{(1+x)^2},\ f'''=\tfrac{2}{(1+x)^3}\) give values \(0,1,-1,2\). So

\[P_3(x)=x-\tfrac{x^2}{2}+\tfrac{x^3}{3}.\]

(b) At \(x=0.2\): \(0.2-0.02+0.00267=0.18267\). True \(\ln1.2\approx0.18232\). The next term is \(-x^4/4=-4\times10^{-4}\), so the estimate should overshoot by roughly that much - and indeed the error is about \(3.5\times10^{-4}\). The alternating series has terms \((-1)^{k+1}x^k/k\).

After the reveal, answer for yourself: The next omitted term predicted both the size AND the sign of the error. For alternating Taylor series, the first dropped term bounds the error.

Lesson Summary

Taylor’s theorem approximates a smooth function near a point by a polynomial in its derivatives, with the Lagrange remainder giving the exact error. The linear term is the tangent line; the quadratic term adds curvature. In fixed income these two terms are duration and convexity, and in stochastic calculus they become the drift and diffusion pieces of Itô’s lemma.

Formula Sheet Additions

Taylor polynomial
\[P_n(x)=\sum_{k=0}^n \frac{f^{(k)}(a)}{k!}(x-a)^k\]
The local polynomial model underlying linearization, duration/convexity, and Itô.
Duration-convexity
\[\frac{\Delta P}{P}\approx -D\,\Delta y+\tfrac12 C\,\Delta y^2\]
A second-order Taylor expansion of bond price in yield.

Retrieval Practice

Close the lesson and answer from memory before checking. This is deliberate, effortful recall - the single highest-yield study action.

▶ Show retrieval prompts & answers
Q: Write the degree-2 Taylor approximation and name its two correction terms’ roles.
A: f(x)≈f(a)+f′(a)(x−a)+½f″(a)(x−a)²: the linear term is the tangent-line slope (rate), the quadratic term is the curvature correction.
Q: How do duration and convexity arise from a Taylor expansion of bond price in yield?
A: Expanding P(y) to second order about y0 gives ΔP/P≈−DΔy+½CΔy², where D=−P′/P (first order, duration) and C=P″/P (second order, convexity).

Completion Checklist

Confidence / mastery rating
Personal notes

Source References

This lesson synthesizes and paraphrases concepts from the sources below. No copyrighted text, problem sets, or solutions are reproduced. Return to the originals for full depth.