JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Taylor Series: Functions as Infinite Polynomials

How does a calculator find sin(0.7) or e^0.3? It does not 'know' those values — it adds up a polynomial. A [[taylor-series|Taylor series]] rebuilds a smooth [[function-calculus|function]] near a point out of its own [[derivative-calculus|derivatives]], turning curves like e^x, sin, and cos into infinite sums of powers of x. It is [[linear-approximation|linear approximation]] taken all the way: keep more terms, get more accuracy.

From a tangent line to a tangent polynomial

On the last rung you saw linear approximation: near a point, a smooth curve is well matched by its tangent line L(x) = f(a) + f'(a)(x - a). That line agrees with f in two things at x = a — the same height and the same slope. But a line cannot bend, so it drifts away as you move off. The fix is natural: add a term that also matches the curve's bending, then a term for how the bending changes, and so on. Each new term forces agreement in one more derivative. The result is a polynomial that hugs the curve more and more tightly.

Written out, the Taylor series of f around the point a is f(x) = f(a) + f'(a)(x - a) + f''(a)/2! (x - a)^2 + f'''(a)/3! (x - a)^3 + ... . The n-th term uses the n-th derivative at a, divided by n! (n factorial: 2! = 2, 3! = 6, 4! = 24). Notice the first two terms are exactly the tangent line — linear approximation is just a Taylor series stopped early.

Building e^x, one derivative at a time

The cleanest example is e^x, because it is its own derivative: every derivative of e^x is again e^x, and at x = 0 each one equals 1. Drop those 1's into the recipe and the factorials are all that survive in the denominators. This is also a power series — an infinite polynomial in powers of x — and it happens to converge to e^x for every real number x.

e^x = 1 + x + x^2/2! + x^3/3! + x^4/4! + ...

Try x = 1 (this should approach e ~ 2.71828):
  1                      = 1
  + 1                    = 2
  + 1/2                  = 2.5
  + 1/6                  = 2.6667
  + 1/24                 = 2.7083
  + 1/120                = 2.7167
  + 1/720                = 2.71806
  ... partial sums climb toward 2.71828
Each row is a partial sum. As you keep adding terms the running total closes in on e — that is what 'the series converges to e' means.

Notice the engine here is the same one from earlier rungs: a infinite series converges exactly when its partial sums approach a finite limit. The polynomial never literally ends; what we mean by equality is that the running totals get and stay as close to e^x as we like. The factorials grow ferociously fast, so the later terms shrink to nothing and the sum settles down quickly.

Sine, cosine, and why calculators love this

Sin and cos give the next classic pair. Their derivatives cycle through sin -> cos -> -sin -> -cos -> sin, so at x = 0 the values march 0, 1, 0, -1, repeating. That pattern of zeros neatly deletes half the terms: sin keeps only the odd powers, cos only the even ones, with alternating signs.

sin(x) = x - x^3/3! + x^5/5! - x^7/7! + ...   (odd powers)
cos(x) = 1 - x^2/2! + x^4/4! - x^6/6! + ...   (even powers)

# Estimate sin(0.5) with just three terms:
x = 0.5
x - x^3/6 + x^5/120
  = 0.5 - 0.0208333 + 0.0002604
  = 0.4794271
(true sin(0.5) = 0.4794255...  -> off by ~0.0000016)
Three terms already nail sin(0.5) to six decimal places — only multiply, add, and divide, which is all a chip can do.

This is the secret behind your calculator and behind physics shortcuts. A chip cannot evaluate sin or e^x directly — it can only add, subtract, multiply, and divide. A truncated Taylor series is built from exactly those operations, so the machine adds up a handful of terms and stops once the next term is smaller than the precision it needs. Physicists use the same move in reverse: for small angles they replace sin(x) by just x, or cos(x) by 1 - x^2/2, turning a hard equation into an easy one.

How far can you trust it? The radius of convergence

Here is the honest caveat. For e^x, sin, and cos the series converges everywhere, but most series only work within a limited window around the center. There is a number R, the radius of convergence, such that the power series converges when |x - a| < R and diverges when |x - a| > R. Inside the window the infinite polynomial really equals the function; outside, the partial sums blow up and the formula is meaningless.

A small example shows why a window can exist at all. The function 1/(1 - x) has the geometric series 1 + x + x^2 + x^3 + ... . Try x = 0.5 and the terms halve each time, settling on 2 — and indeed 1/(1 - 0.5) = 2. But try x = 2: the terms 1, 2, 4, 8, ... explode, so the series diverges even though 1/(1 - 2) = -1 is a perfectly fine number. Here R = 1: the formula is only the function for |x| < 1.