Taylor Polynomials of sin x

Category: Calculus   Level: 301

sin x = x - x3/3! + x5/5! - x7/7! + …

A Taylor polynomial copies a function's value and derivatives at one point. Each extra term makes the copy hug the curve over a wider stretch.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: Start at one point

At x = 0, sin x has value 0 and slope 1, and its later derivatives repeat 0, −1, 0, 1. A Taylor polynomial copies those numbers.

sin 0 = 0, slopes at 0: 1, 0, -1, 0, 1, ...

Step 1: Start at one point

Step 2: Degree 1: the tangent line

The first copy is the tangent line y = x. It matches the value and the slope, and stays within 0.05 of sin x out to |x| ≈ 0.67.

P1(x) = x

Step 2: Degree 1: the tangent line

Step 3: Degree 3: add a bend

Subtract x³/6. The cubic bends down with the sine curve and stays close twice as far out.

P3(x) = x - x3/6

Step 3: Degree 3: add a bend

Step 4: Degree 5: bend back

Add x⁵/120. The copy now follows the first hill and the first valley past their tops.

P5(x) = x - x3/6 + x5/120

Step 4: Degree 5: bend back

Step 5: Degree 7: reach further

Subtract x⁷/5040. Every new term pushes the good stretch further out, here to |x| ≈ 3. Infinitely many terms give sin x everywhere, which is a lot of homework.

P7(x) = x - x3/6 + x5/120 - x7/5040

Step 5: Degree 7: reach further

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render taylor-polynomials --out /tmp/taylor-polynomials

Source: svgmath/diagrams/approximation.py