Sign in

Libre University uses your GitHub account. Signing in is only needed to sit a final test, so the score is kept on your profile.

Taylor series

A tangent line approximates a curve near a point by matching its value and its slope, and there is no reason to stop at the slope.

Matching the second derivative as well gives a parabola that also bends the right way; matching the third gives a cubic; and the sequence of approximations improves in a way that can be made precise, bounded, and used. This last lesson builds those polynomials, states how wrong they are, and applies them to the approximations that appear on nearly every page of a physics text. It needs the derivative rules, the Mean Value Theorem, and the geometric series from the previous course.

Matching more than the slope

The linearisation at a was L(x)=f(a)+f(a)(x-a), chosen so that L(a)=f(a) and L(a)=f(a). Ask for a quadratic P2 that also has P2′′(a)=f′′(a), and the coefficients are forced.

Write the polynomial in powers of (x-a), which is the form that makes the algebra trivial:

Pn(x)=c0+c1(x-a)+c2(x-a)2++cn(x-a)n

Setting x=a kills every term but the first, so c0=f(a). Differentiating once and setting x=a kills everything but the second, giving c1=f(a). Differentiating twice brings a factor of 2 down from the square, so c2=f′′(a)/2. In general the k-th derivative of (x-a)k is k!, so

ck=f(k)(a)k!

and the resulting Pn is the Taylor polynomial of degree n at a, named for Brook Taylor, who published the construction in 1715. When a=0 it is often called a Maclaurin polynomial, after Colin Maclaurin, who popularised that case.

The three most useful ones come from functions whose derivatives repeat. For ex every derivative is ex, worth 1 at the origin, so

ex1+x+x22!+x33!+

For sinx the derivatives cycle through cos,-sin,-cos,sin, which at zero are 1,0,-1,0, leaving only the odd powers with alternating signs:

sinxx-x33!+x55!-

and the same argument for the cosine leaves the even powers, 1-x2/2!+x4/4!-

Example. Estimate e0.5 with the first four terms, and compare.

The terms are 1+0.5+0.125+0.0208333=1.6458333. The true value is 1.6487213, so the estimate is low by 0.0028879, an error of 0.18 per cent. Adding the next term, x4/24=0.0026042, gives 1.6484375, low now by only 0.00028: one more term cut the error by a factor of ten.

Now you. Estimate cos(0.3) with the first three non-zero terms.

Answer

The terms are 1-0.32/2+0.34/24=1-0.045+0.0003375=0.9553375. The true value is 0.9553365, so the error is about 10-6.

How wrong the polynomial is

An approximation with no error bound is a guess, and Taylor's theorem supplies the bound. If f has n+1 derivatives on an interval containing a and x, then

f(x)=Pn(x)+f(n+1)(c)(n+1)!(x-a)n+1

for some c between a and x. The last term is the remainder in Lagrange's form, and it is exactly one more term of the same pattern, with the derivative evaluated at an unknown interior point rather than at a.

The case n=0 is worth reading twice: it says f(x)=f(a)+f(c)(x-a), which is the Mean Value Theorem. So Taylor's theorem is that theorem generalised to higher derivatives, and the proof is the same argument applied to a cleverer auxiliary function.

In practice c is unknown, so the remainder is bounded rather than computed: replace f(n+1)(c) by the largest value the derivative can take on the interval, and the result is a guaranteed limit on the error.

Example. Estimate sin(0.5) with two terms and bound the error.

Two non-zero terms give 0.5-0.53/6=0.4791667. The next derivative in the pattern is a sine or a cosine, so |f(5)(c)|1 whatever c is, and the remainder is at most 0.55/5!=0.00026. The true value is 0.4794255, so the actual error is 0.00025879, just inside the bound and very close to it. That closeness is typical of alternating series, where the first omitted term is nearly the whole error.

Now you. Bound the error in the four-term estimate of e0.5 above, and compare it with the actual error.

Answer

The remainder is ec(0.5)4/4! with 0<c<0.5, so ec<e0.5=1.6487 and the bound is 1.6487×0.0625/24=0.004294. The actual error was 0.002888, comfortably inside it. A bound is meant to be safe rather than sharp.

Small angles, and the pendulum

Almost every formula quoted as an approximation in a physics course is a truncated Taylor series, and the truncation is where its range of validity comes from.

The pendulum is the standard case. The equation of motion for a simple pendulum is θ¨=-(g/L)sinθ, which has no solution in elementary functions. Replacing sinθ by its first Taylor term, θ, turns it into θ¨=-(g/L)θ, which is the simple harmonic motion equation met in the transcendental lesson, with solution a sinusoid of period 2πL/g. That period, famously independent of amplitude, is a property of the approximation and not of the pendulum.

The error is quantifiable. At 10 degrees, θ=0.174533 radians and sinθ=0.173648, a difference of 0.51 per cent. At 30 degrees the difference is 4.7 per cent, and the true period exceeds the small-angle formula by about 1.7 per cent. So the small-angle approximation is not a licence: it is a claim with a size, and knowing the size is what tells you whether a clock built on it will keep time.

The same expansion explains a habit that looks like laziness. Where a potential energy U(x) has a minimum, the Taylor expansion about that minimum has no constant term worth keeping and no linear term at all, since the derivative vanishes there, so the leading behaviour is 12U′′(x0)(x-x0)2. That is the potential of a spring with stiffness U′′(x0). Every system sufficiently close to a stable equilibrium is therefore a harmonic oscillator, whatever it is made of, which is why the same sinusoid describes a pendulum, a bond between two atoms and a mass on a spring. The universality is a fact about second-order Taylor polynomials rather than about physics.

Expansions in physics

Example. Show that relativistic kinetic energy reduces to 12mv2 at ordinary speeds, and check it at v=0.1c.

The relativistic expression is K=(γ-1)mc2 with γ=(1-v2/c2)-1/2. The binomial series gives (1-u)-1/21+12u+38u2 for small u, so with u=v2/c2,

Kmc2(v22c2+3v48c4)=12mv2+3mv48c2

The first term is the Newtonian kinetic energy, which was therefore never a separate law but the leading term of the correct one. At v=0.1c, γ=1.0050378, so the exact kinetic energy per kilogram is 4.5278×1014 J while 12v2 gives 4.4938×1014 J, low by 0.76 per cent. The second term of the series accounts for almost all of that gap.

Now you. A quantity is given by 1/(1-x) where x is small. Give a two-term approximation and test it at x=0.02.

Answer

The geometric series gives 1/(1-x)=1+x+x2+, so the two-term approximation is 1+x=1.02. The true value is 1/0.98=1.020408, so the error is 0.0004, roughly x2 as the next term predicts.

When the series is the function

Letting n grow without bound turns the polynomial into an infinite Taylor series. It represents the function at a point x exactly when the remainder tends to zero there, which is a condition to be checked rather than assumed.

For ex, sinx and cosx it holds for every real x, because the derivatives are bounded on any interval while (n+1)! in the denominator eventually outgrows any power. The series converge everywhere, and they are how these functions are actually evaluated inside a calculator, after the argument has been reduced to a small range.

Other series converge only on a limited range, and the geometric series is the model: 1+x+x2+ sums to 1/(1-x) for |x|<1 and diverges outside, exactly as established for geometric series in the previous course. The half-width of the interval on which a power series converges is its radius of convergence.

The example that makes the topic honest is f(x)=1/(1+x2). This function is perfectly smooth on the whole real line, with no singularity anywhere and derivatives of every order. Its Maclaurin series is 1-x2+x4-, obtained by substituting -x2 into the geometric series, and it converges only for |x|<1. At x=2 the function is a harmless 0.2 and its series has terms that grow without bound. Nothing visible on the real line explains the failure. The explanation is that the function has singularities at x=±i in the complex plane, at distance 1 from the origin, and a power series cannot converge past the nearest singularity in any direction. Real analysis poses the question and complex analysis answers it, which is one of the better arguments for continuing.

There is a worse case. The function equal to e-1/x2 for x0 and to 0 at the origin has derivatives of every order there, and every one of them is zero. Its Maclaurin series is therefore identically zero, converging everywhere and agreeing with the function at exactly one point. A function is not always the sum of its Taylor series, and no amount of smoothness guarantees it.

What the course has bought

The subject began with two problems, the slope of a curve at a point and the area beneath it, and both were beyond algebra because both required a value that a process approaches without reaching.

The limit made that idea precise. The derivative followed as the limit of a difference quotient, then a set of rules that made differentiation mechanical for every function that can be written down, then the theorems that say what a derivative means for the shape of a function and what it fixes about the function itself. The integral was defined independently as a limit of sums, and the Fundamental Theorem identified the two constructions as inverse, which is what makes areas, volumes, work and accumulated change computable. The last two lessons were about the limits of that computation: most integrands have no elementary antiderivative, most functions are handled by approximation, and the approximations carry error bounds that say when they may be trusted.

What that supports is reading. A physics text that writes x¨=-ω2x, integrates a force to get an energy, expands a potential to second order about its minimum, or drops a term in v2/c2 is doing things this course has now derived rather than asserted.

Three directions continue from here. Differential equations take the observation that physical laws relate a quantity to its own derivatives and ask how to solve such relations rather than merely verify them. Multivariable calculus extends every idea here to functions of several variables, where a derivative becomes a set of partial derivatives and an integral runs over a region rather than an interval. And real analysis goes back to the beginning and proves the results this course has quoted, starting from the completeness of the real numbers that the continuity lesson leaned on. Each of them starts where this one stops.