Analysis

One point's worth of information

A Taylor series claims that everything a function does, everywhere, is encoded in its behaviour at a single point. That claim is extraordinary, it is often true, and the cases where it fails are the interesting ones.

Stand at one point on a curve and measure everything measurable there: the height, the slope, how fast the slope is changing, how fast that is changing, and onward. Every one of those is a local quantity — each is determined by an arbitrarily small neighbourhood of the point, and none of them looks anywhere else.

The claim of Taylor’s theorem is that this list is enough to reconstruct the whole curve.

Partial sums of sin xsin x with its Taylor partial sums of degree 1, 3, 5, 9 about zero. Each extra term buys agreement over a wider interval and none of them is right everywhere.-8-6-4-22468-2-112xsin xdegree 9 is out by 4.7e+0 at x = 5.76
Fig. 1 sinx\sin x with its Taylor partial sums of degree 1, 3, 5 and 9 about zero. Each is a polynomial built from derivatives at a single point, and each tracks the curve further out than the last.

The construction

The recipe writes itself once the goal is stated. Build a polynomial that matches the function at a point, then matches its slope, then its second derivative, and so on:

f(x)f(0)+f(0)x+f(0)2!x2+f(0)3!x3+f(x) \approx f(0) + f'(0)\,x + \frac{f''(0)}{2!}x^2 + \frac{f'''(0)}{3!}x^3 + \cdots

The factorials are not decoration. Differentiating xkx^k three times gives k(k1)(k2)xk3k(k-1)(k-2)x^{k-3}, and by the time it has been differentiated kk times the accumulated factor is exactly k!k!. Dividing by k!k! cancels it, so each coefficient is precisely the derivative it is supposed to reproduce and nothing else — the terms do not interfere with each other’s jobs.

That independence is the whole design. The degree-5 term contributes nothing to the first four derivatives at the origin, because it and its first four derivatives all vanish there. So a partial sum of degree nn matches the function’s first nn derivatives at the point exactly, and adding another term never disturbs what the earlier ones settled.

For sinx\sin x the derivatives at zero cycle 0,1,0,10, 1, 0, -1 forever, which kills every even power and alternates the signs of the odd ones:

sinx=xx33!+x55!x77!+\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots

Partial sums of sin xsin x with its Taylor partial sums of degree 1 about zero. Each extra term buys agreement over a wider interval and none of them is right everywhere.-8-6-4-22468-2-112xsin xdegree 1 is out by 6.3e+0 at x = 5.76
Fig. 2 The degree-1 sum alone: the line y=xy = x. It is a good approximation to sinx\sin x over a startlingly wide interval near the origin and a catastrophic one past it, and it is the entire content of the small-angle approximation.

The first term alone says sinxx\sin x \approx x, which is the small-angle approximation every physics course uses without justification. It is the degree-1 Taylor polynomial, and its error is the next term — about x3/6x^3/6, which at 5° is one part in three thousand and at 30°30° is four percent. That is where the pendulum’s honest period goes wrong, and now it has a number attached.

Each term buys an interval

The figure’s real content is the way the curves peel away.

Degree 1 is right near the origin and hopeless by the first bend. Degree 3 survives past the first hump. Degree 9 tracks sinx\sin x through several. The pattern is not that higher degree is more accurate everywhere — it is that higher degree is accurate over a wider interval, and outside that interval it is usually worse than the low-degree version, because a high-degree polynomial that has run out of agreement diverges violently.

Partial sums of eˣeˣ with its Taylor partial sums of degree 1, 3, 5, 9 about zero. Each extra term buys agreement over a wider interval and none of them is right everywhere.-3-2-1122468xdegree 9 is out by 7.7e-5 at x = 1.73
Fig. 3 exe^x with its partial sums. Here the derivatives are all 11, so the series is xk/k!\sum x^k/k! — every coefficient positive, no cancellation, and the approximations approach from below on the right.

exe^x shows the mechanism cleanly because nothing cancels. All its derivatives at zero are 11, so the series is 1+x+x2/2+x3/6+1 + x + x^2/2 + x^3/6 + \cdots, every term positive. A partial sum is therefore always an underestimate to the right of zero, and the deficit is the tail — which is the same series scaled, and shrinks factorially. This is the series that computes ee to seven places in ten terms, and the reason is visible here: the factorial in the denominator eventually overwhelms any fixed xx.

The series for e, 9 termsEach term of 1 + 1/1! + 1/2! + … added in turn. The factorials in the denominators make the tail vanish very fast.e11.0000001/12.0000001/22.5000001/62.6666671/242.7083331/1202.7166671/7202.7180561/50402.7182541/403202.718279nine terms already give six correct decimal places
Fig. 4 The exponential series added one term at a time, at x=1x = 1. The solid bar is the new term, the pale bar everything before it; the factorial denominators make the new contribution collapse almost immediately.

The remainder can be written down. Taylor’s theorem with Lagrange’s form of the remainder says that after nn terms the error is

f(n+1)(ξ)(n+1)!xn+1\frac{f^{(n+1)}(\xi)}{(n+1)!}\,x^{n+1}

for some ξ\xi between 00 and xx. The location ξ\xi is unknown, which is the catch — but a bound on the derivative is usually available, and that is enough. There is also an exact form, in which the remainder is an integral of the next derivative against a weight, and it is the version to reach for when a bound is not good enough and the derivative can actually be integrated. For sinx\sin x every derivative is bounded by 11, so the error after nn terms is at most xn+1/(n+1)!|x|^{n+1}/(n+1)!, which goes to zero for every xx whatever. That is the proof that the sine series works everywhere, and it takes one line once the remainder is in hand.

The function that ends the optimism

So far the story is that the local data determines the global function, and the sine and the exponential both cooperate. Now the case that does not, and it is not a pathology — it is a rational function that a school student could write down.

f(x)=11+x2f(x) = \frac{1}{1 + x^2}

This function is perfectly well behaved on the entire real line. It is smooth everywhere. It has derivatives of every order at every point. It never blows up, never has a corner, never does anything at all except drop gently from 11 toward zero in both directions.

Its Taylor series about zero is

1x2+x4x6+1 - x^2 + x^4 - x^6 + \cdots

which is a geometric series in x2-x^2, and geometric series converge only when the ratio is less than one in size. So the series converges for x<1|x| < 1 and diverges for x>1|x| > 1.

A smooth function whose series stops working1/(1 + x²) with partial sums of degree 4, 12, 28. Inside |x| < 1 more terms improve the fit; outside it they make it worse, and the function is smooth throughout.-2-1.5-1-0.50.511.52-1-0.50.511.5x|x| = 1at x = 1.4: degree 4 is out by 2.54, degree 28 by 8176
Fig. 5 1/(1+x2)1/(1+x^2) with partial sums of degree 4, 12 and 28. Inside the shaded band the higher degrees are better; outside it they are dramatically worse, and the function is smooth throughout.

At x=1.4x = 1.4 the degree-4 sum is out by about 22; the degree-28 sum is out by roughly 500500. Adding terms makes it worse, without limit, at a point where the function is entirely unremarkable. Nothing at x=1.4x = 1.4 is wrong. Nothing at x=±1x = \pm 1 is wrong either — the function sails through both.

The generator checks exactly this, because it is the essay’s central claim and easy to get backwards: it computes the error at a point inside the radius and at a point outside, and requires the first to shrink with degree and the second to grow.

Why one, and why nobody can see it

The radius is 11, and there is nothing at distance 11 along the real line to explain it. The explanation is not on the real line at all.

Extend the function to complex inputs. Then 1+x21 + x^2 vanishes at x=ix = i and x=ix = -i, and ff blows up there. Those points are at distance exactly 11 from the origin.

A Taylor series about a point converges inside the largest disc — in the complex plane — that contains no singularity, and it diverges outside it. The radius of convergence is the distance to the nearest place the function misbehaves, measured in the plane whether or not the function was ever meant to leave the line.

That is a genuinely startling explanation. The behaviour of a real function of a real variable, on the real axis, is governed by two points that are nowhere on the real axis. The real line is a slice through a two-dimensional situation, and the slice cuts through a disc whose radius was set by something off the slice entirely — a situation multiplying as turning is the right language for and which no real picture can carry.

So the failure has nothing to do with smoothness, which is why examining ff on the real line will never turn it up. A function can be infinitely differentiable everywhere and still have a radius of convergence of 11, or 0.0010.001, or — as the next section shows — nothing at all.

Smooth is not enough, in the worst way

There is a sharper counterexample, and it kills the hope entirely.

g(x)={e1/x2x00x=0g(x) = \begin{cases} e^{-1/x^2} & x \ne 0 \\ 0 & x = 0\end{cases}

This function is smooth everywhere, including at zero. Every derivative exists there, and every single one of them is zero — the exponential decays faster than any polynomial grows, so every derivative is dragged to nothing at the origin.

Its Taylor series about zero is therefore

0+0x+0x2+=0.0 + 0 \cdot x + 0 \cdot x^2 + \cdots = 0.

The series converges beautifully, everywhere, with infinite radius. It converges to the zero function. And gg is not the zero function — it is positive at every x0x \ne 0.

So here the series converges and converges to the wrong thing. The local data at the origin — every derivative, all infinitely many of them — is completely blind to what gg does anywhere else. The claim this essay opened with is simply false for gg.

Functions for which the claim is true have a name: analytic. Analytic implies smooth; smooth does not imply analytic, and gg is the standing witness. On the real line the two classes are enormously different. In the complex plane they collapse — a complex function differentiable once is automatically analytic, which is one of the more surprising facts in mathematics and is the reason complex analysis is a tidier subject than real analysis.

Nobody computes with these, and everybody uses them

There is an apparent contradiction worth resolving. Taylor series are the standard way of introducing infinite sums, and essentially no working numerical routine evaluates a function by summing one.

Library implementations of sin\sin, exp\exp and the rest use minimax polynomials instead — polynomials of the same degree chosen to make the worst error over the interval as small as possible, rather than to be perfect at one point and progressively worse away from it. The difference is substantial. A degree-7 Taylor polynomial for sin\sin on [π/4,π/4][-\pi/4, \pi/4] is exact at the origin and worst at the ends; a degree-7 minimax polynomial is slightly wrong everywhere and its worst case is smaller by a factor of tens. Since a library cares only about the worst case, it uses the second, and the Taylor coefficients appear nowhere in the shipped code.

A smooth function whose series stops working1/(1 + x²) with partial sums of degree 2, 8, 20. Inside |x| < 1 more terms improve the fit; outside it they make it worse, and the function is smooth throughout.-2-1.5-1-0.50.511.52-1-0.50.511.5x|x| = 1at x = 1.4: degree 2 is out by 1.30, degree 20 by 554
Fig. 6 The same failure at three degrees rather than the earlier three. Inside the band the sums converge; outside it the degree-20 curve leaves the frame almost immediately, which is what “diverges” looks like when it is drawn.

So what is the series for? Almost always, for its first two or three terms, used as a licence rather than as a computation.

To first order is the most-used phrase in applied mathematics, and it means: replace the function by its degree-1 Taylor polynomial and accept an error of order x2x^2. That single move is linearisation, and it is what makes a pendulum a harmonic oscillator, a small perturbation solvable, an error bar propagate, and a nonlinear system tractable near an equilibrium. Newton’s method is the degree-1 sum solved for its root and iterated. Error propagation in an experiment is the degree-1 sum with the derivative playing the role of a sensitivity.

It is worth seeing what linearisation is in the language of the rest of this collection: the degree-1 term is a number times xx, which is to say a linear map — and in several variables it is literally a matrix, the Jacobian. “To first order” means “replace the function by the linear map that best matches it here”, and everything known about linear maps then becomes available. The reason the move is so productive is not that polynomials are simple; it is that linear algebra is finished and nothing else is.

None of that needs convergence, or a radius, or the infinite tail. It needs the remainder bound — the guarantee that the error is O(x2)O(x^2) — which Taylor’s theorem supplies with finitely many terms and no infinite series anywhere. The series is the famous object; the theorem with a remainder is the useful one, and they are routinely confused.

What the picture cannot show

The figures draw partial sums, and a partial sum is a polynomial. Every one of them is smooth, unbounded, and eventually enormous — none of them is the function, and the function is not among them.

More acutely, the pictures cannot show the boundary. The vertical lines at ±1\pm 1 in the radius figure are drawn there because the mathematics puts them there, not because anything visible happens at that spot. A reader shown the curve alone could look at x=1x = 1 for a very long time without finding a reason for it, because the reason is at x=±ix = \pm i and the page has no axis for it.

Nor can any drawing separate smooth from analytic. g(x)=e1/x2g(x) = e^{-1/x^2} plotted next to any other gently rising curve looks unremarkable — it is flat near zero and then climbs, which describes a great many functions. That its every derivative vanishes at the origin, and that this makes its Taylor series useless, has no visual signature at all. The failure is a statement about a limit of ratios and it is invisible at every scale.

The ladder from here

Rungs above: the remainder in Lagrange and integral forms, with the bound drawn. Expanding about a point other than zero, and why the choice matters for accuracy. The radius of convergence proved from the ratio test. Analytic continuation, where a function is extended by re-expanding at a new centre and walking. Complex differentiability and why once implies always. Padé approximants, which beat Taylor by allowing a denominator and reach past the radius. Runge’s phenomenon, where interpolating at evenly spaced points fails on the same 1/(1+x2)1/(1+x^2) for a related reason. Numerical evaluation of elementary functions, where the series is never used raw and the argument reduction is the hard part. And Fourier series, the other way of writing a function as an infinite sum — which uses global information rather than local, and succeeds on functions Taylor cannot touch.

Local against global

The comparison with Fourier is the most useful thing to leave with, because the two constructions answer the same question from opposite ends.

A Taylor series is built from data at one point and is exact near it. A Fourier series is built from integrals over the whole period and is accurate on average across all of it. Taylor knows everything about the origin and may know nothing at x=2x = 2. Fourier knows the general shape everywhere and is worst precisely at the sharp features, where its overshoot never goes away.

Which is better depends entirely on the question, and the pairing is the point: a function has a local description and a global one, they contain different information, and neither is more fundamental. The habit worth carrying is to ask which of the two a problem is really posing — because the answer determines which of them will be tractable, and choosing the wrong one is how a routine calculation becomes impossible.