MISSION · Calculus
Taylor and Maclaurin Series
How a calculator works out sin(1) when it can only add and multiply
LEVEL 1 · EXPLORE
Make the idea move
Change the controls and watch what happens. Follow your curiosity and see what you notice.
Loading the activity…
LEVEL 2 · LEARN
Unlock the explanation
Open the chapters in any order. Try the examples as you go.
The idea in one sentence
Match a polynomial’s value and all its derivatives to a function at a single point, and the polynomial will copy the function near that point — perfectly, if you take infinitely many terms.
The problem it solves
A computer can add and multiply. It cannot do \(\sin\) or \(e^x\) or \(\ln\) directly. So those functions have to be rewritten using only addition and multiplication, which means polynomials. Taylor series is how.
Building it
Suppose \(f(x) = a_0 + a_1x + a_2x^2 + a_3x^3 + \cdots\) and demand that the polynomial agrees with \(f\) at \(x = 0\) in value, slope, curvature, and every higher derivative.
Set \(x = 0\): everything vanishes except \(a_0\), so \(a_0 = f(0)\). Differentiate, then set \(x = 0\): \(a_1 = f'(0)\). Differentiate twice: the \(x^2\) term produces \(2a_2\), so \(a_2 = f''(0)/2\).
In general the \(n\)th differentiation produces a factor of \(n!\), which is where the factorials come from:
\[f(x) = \sum_{n=0}^{\infty}\frac{f^{(n)}(0)}{n!}x^n\]That’s the Maclaurin series. Expand about a point \(a\) instead of 0 and you get the Taylor series, with \((x-a)^n\) in place of \(x^n\).
The three worth knowing
\[e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots\] \[\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots\] \[\cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots\]\(e^x\) is its own derivative, so every coefficient is \(1/n!\). Sine is odd and has only odd powers; cosine is even and has only even ones. Differentiate the sine series term by term and the cosine series falls out, exactly as it should.
Put \(ix\) into the exponential series, and the real terms assemble into \(\cos x\) while the imaginary ones give \(i\sin x\). That is Euler’s formula, \(e^{ix} = \cos x + i\sin x\), and the series is where it comes from.
Using a few terms
\[e^{0.1} \approx 1 + 0.1 + \frac{0.01}{2} = 1.105\]The true value is 1.10517. Three terms, four correct digits — because the next term is \(0.001/6 \approx 0.00017\), and the terms are shrinking fast.
This is also the source of the small-angle approximations. Cut \(\sin x\) after one term and you get \(\sin x \approx x\); cut cosine after two and you get \(\cos x \approx 1 - x^2/2\). Both are Taylor series, truncated.
How far it works
A Taylor series need not converge everywhere. \(\frac{1}{1-x} = 1 + x + x^2 + \cdots\) holds only for \(|x| < 1\) — the geometric series — and says nothing at \(x = 2\), where the function is perfectly well defined.
The distance from the expansion point over which the series works is the radius of convergence, found with the ratio test. For \(e^x\), \(\sin x\) and \(\cos x\) it is infinite. And accuracy is always best near the centre: a series about 0 used at \(x = 10\) needs a great many terms.
Common mix-ups
- Dropping the factorials. \(x^3/3! = x^3/6\), not \(x^3/3\).
- Losing the alternating signs in sine and cosine.
- Expanding about 0 when the question centred it elsewhere, forgetting the \((x-a)^n\).
- Using a truncated series far from the centre and trusting the answer.
- Assuming convergence means equality everywhere. Check the radius.
Check yourself
What’s the coefficient of \(x^3\) in the series for \(e^x\)? Then estimate \(e^{0.1}\) using three terms.
Every coefficient of \(e^x\) is \(1/n!\), so the \(x^3\) one is \(1/6\). Three terms give 1 + 0.1 + 0.005 = 1.105, against a true value of 1.10517.
LEVEL 3 · REFLECT
Add this quest to your trail
When you feel ready, mark this idea as explored. You can always come back and try it again.
EXPLORER STRATEGIES