Taylor and Maclaurin expansions

Every smooth function, however curved, looks almost like a straight line if you zoom in close enough at a point — that is what the derivative already tells you. Taylor's theorem pushes this idea further: near a point aa, a well-behaved function is not just approximately linear but approximately a polynomial built entirely from its own derivatives at aa, and the theorem hands you an exact formula for the leftover error. Maclaurin's theorem is nothing new on top of this — it is simply Taylor's theorem centred at a=0a=0, the case used to write down the famous series for exe^x, sin⁡x\sin x, cos⁡x\cos x and ln⁡(1+x)\ln(1+x). This single idea — replace a hard function by an easy polynomial, with a controlled error — underlies limit evaluation, numerical approximation, and error analysis throughout the rest of this calculus unit.

The core insight

A function's value near a point aa can be reconstructed, to any order and with a precisely bounded error, from nothing but its derivatives at aa: that is Taylor's theorem, and setting a=0a=0 gives Maclaurin's theorem.

The core idea

Taylor's theorem. If ff has n+1n+1 continuous derivatives on an interval containing aa and xx, then f(x)f(x) equals the degree-nn Taylor polynomial at aa plus a remainder:

f(x)=f(a)+f′(a)(x−a)+f′′(a)2!(x−a)2+⋯+f(n)(a)n!(x−a)n+Rn,f(x) = f(a) + f'(a)(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \cdots + \frac{f^{(n)}(a)}{n!}(x-a)^n + R_n,

where: f(k)(a)f^{(k)}(a) is the kk-th derivative evaluated at aa, (x−a)(x-a) is the displacement from the expansion point, and RnR_n is the remainder after nn terms — the exact gap between the polynomial and the true value of f(x)f(x).

Two forms of the remainder. Both are proved using a Cauchy-mean-value-theorem-style auxiliary function, and both say the same qualitative thing — the remainder involves the (n+1)(n+1)-th derivative evaluated at some unknown point cc strictly between aa and xx:

Rn=f(n+1)(c)(n+1)!(x−a)n+1(Lagrange),Rn=f(n+1)(c)n!(x−c)n(x−a)(Cauchy).R_n = \frac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1} \quad \text{(Lagrange)}, \qquad R_n = \frac{f^{(n+1)}(c)}{n!}(x-c)^n(x-a) \quad \text{(Cauchy)}.

where: cc is some point strictly between aa and xx, not one you can pin down exactly — its role is only to bound the size of RnR_n. Setting n=0n=0 collapses either form to f(x)=f(a)+f′(c)(x−a)f(x) = f(a) + f'(c)(x-a), which is exactly the Lagrange mean value theorem (LMVT): Taylor's theorem is nothing but a higher-order generalization of the MVT you already proved.

Maclaurin's theorem is the special case a=0a=0:

f(x)=f(0)+f′(0)x+f′′(0)2!x2+⋯+f(n)(0)n!xn+Rn.f(x) = f(0) + f'(0)x + \frac{f''(0)}{2!}x^2 + \cdots + \frac{f^{(n)}(0)}{n!}x^n + R_n.

It is not a separate theorem with different hypotheses — it is simply Taylor's theorem read at the origin, which is why exe^x, sin⁡x\sin x, cos⁡x\cos x and ln⁡(1+x)\ln(1+x) are always expanded "about 00."

The four expansions worth memorizing (each valid for all real xx unless noted):

ex=1+x+x22!+x33!+⋯ ,sin⁡x=x−x33!+x55!−⋯ ,e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots, \qquad \sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots,
cos⁡x=1−x22!+x44!−⋯ ,ln⁡(1+x)=x−x22+x33−⋯(−1<x≤1).\cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots, \qquad \ln(1+x) = x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots \quad (-1 < x \le 1).
Figure
Successive Taylor polynomials of increasing degree hugging the curve of e to the x more closely near the origin
Taylor polynomials of e to the x, expanded about zero x y f(x) = e^x degree 1: 1 + x degree 2: 1 + x + x squared over 2 a = 0, all curves meet here Higher degree polynomials hug the true curve over a wider range near a
Derivation ABuilding the Maclaurin series for e to the x from Taylor's theorem

The goal is to turn the general Taylor formula f(x)=f(0)+f′(0)x+f′′(0)2!x2+⋯+f(n)(0)n!xn+Rnf(x) = f(0) + f'(0)x + \frac{f''(0)}{2!}x^2 + \cdots + \frac{f^{(n)}(0)}{n!}x^n + R_n into the concrete numerical series for f(x)=exf(x) = e^x, by computing every derivative of exe^x at x=0x=0 explicitly and substituting, so that the abstract theorem becomes the memorizable formula used throughout this unit.

Step 1. Differentiate repeatedly. Since f(x)=exf(x) = e^x, every derivative is again exe^x: f′(x)=exf'(x) = e^x, f′′(x)=exf''(x) = e^x, and in general f(k)(x)=exf^{(k)}(x) = e^x for every kk. This is the one function whose derivative pattern never changes, which is exactly why its Maclaurin series has such a clean form.

Step 2. Evaluate at a=0a=0. Since e0=1e^0 = 1, every derivative at the origin equals 11: f(0)=f′(0)=f′′(0)=⋯=f(k)(0)=1f(0) = f'(0) = f''(0) = \cdots = f^{(k)}(0) = 1 for all kk.

Step 3. Substitute into Maclaurin's theorem. Plugging f(k)(0)=1f^{(k)}(0)=1 into f(x)=∑k=0nf(k)(0)k!xk+Rnf(x) = \sum_{k=0}^{n} \frac{f^{(k)}(0)}{k!}x^k + R_n gives ex=1+x+x22!+x33!+⋯+xnn!+Rne^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots + \frac{x^n}{n!} + R_n, with the Lagrange remainder Rn=ec(n+1)!xn+1R_n = \frac{e^c}{(n+1)!}x^{n+1} for some cc between 00 and xx.

Step 4. Confirm the remainder shrinks. For any fixed xx, the factorial (n+1)!(n+1)! in the denominator grows far faster than ecxn+1e^c x^{n+1} grows in the numerator as nn increases, so Rn→0R_n \to 0 and the polynomial approximation improves at every extra term — the reason using "a few terms" of the series is a legitimate approximation strategy rather than a guess.

Worked example

Expand f(x)=ln⁡xf(x) = \ln x about a=1a=1 up to the term in (x−1)3(x-1)^3, with the Lagrange remainder, then use it to estimate ln⁡(1.1)\ln(1.1).

Step 1. Differentiate. f(x)=ln⁡xf(x) = \ln x gives f′(x)=1/xf'(x) = 1/x, f′′(x)=−1/x2f''(x) = -1/x^2, f′′′(x)=2/x3f'''(x) = 2/x^3, and f(4)(x)=−6/x4f^{(4)}(x) = -6/x^4.

Step 2. Evaluate at a=1a=1. f(1)=0f(1) = 0, f′(1)=1f'(1) = 1, f′′(1)=−1f''(1) = -1, f′′′(1)=2f'''(1) = 2.

Step 3. Substitute into Taylor's theorem to third order:

ln⁡x=(x−1)−(x−1)22+(x−1)33+R3,R3=−(x−1)44c4 for some c between 1 and x.\ln x = (x-1) - \frac{(x-1)^2}{2} + \frac{(x-1)^3}{3} + R_3, \qquad R_3 = -\frac{(x-1)^4}{4c^4} \ \text{for some } c \text{ between } 1 \text{ and } x.

Step 4. Plug in x=1.1x = 1.1. The polynomial part gives 0.1−0.005+0.00033‾=0.09533‾0.1 - 0.005 + 0.0003\overline{3} = 0.0953\overline{3}, extremely close to the true value ln⁡(1.1)≈0.095310\ln(1.1) \approx 0.095310, with the tiny gap accounted for entirely by R3R_3. The third-order Taylor estimate is ln⁡(1.1)≈0.09533\ln(1.1) \approx 0.09533.

Competitive stretch

The same series-substitution trick evaluates limits that would otherwise need repeated L'Hôpital differentiation. For lim⁡x→0ex−1−xx2\displaystyle\lim_{x\to 0} \frac{e^x - 1 - x}{x^2}, substitute ex=1+x+x22!+x33!+⋯e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots, so ex−1−x=x22+x36+⋯e^x - 1 - x = \frac{x^2}{2} + \frac{x^3}{6} + \cdots, and dividing by x2x^2 gives 12+x6+⋯\frac{1}{2} + \frac{x}{6} + \cdots. As x→0x \to 0 every term beyond 12\frac12 vanishes, so the limit is 12\boxed{\dfrac{1}{2}} — read straight off the series with no differentiation at all.

Common traps

  • Treating the truncated polynomial as exactly equal to f(x)f(x): Taylor's theorem is an equality only when RnR_n is kept in; the polynomial alone is an approximation, and dropping RnR_n silently is a scoring error.
  • Confusing Maclaurin's theorem with a separate result: it is Taylor's theorem at a=0a=0, nothing more, so its hypotheses are identical.
  • Sign errors while differentiating ln⁡x\ln x, 1/x1/x, or trig functions repeatedly — one flipped sign cascades through every later coefficient.
  • Using an infinite series outside its interval of validity, e.g. plugging x=2x=2 into the ln⁡(1+x)\ln(1+x) series (valid only for −1<x≤1-1 < x \le 1); even the finite polynomial with remainder can become inaccurate once xx strays far from aa.

Ask the tutor: if you want the full Cauchy-MVT-style proof of the Lagrange remainder, or practice choosing how many terms to keep for a target accuracy, ask the AI tutor to walk through it step by step.

Why do we need a remainder term at all if we already have derivatives at every order?

Because a Taylor polynomial only uses finitely many derivatives, and the true function generally differs from that polynomial by a nonzero amount at any point other than aa itself. The remainder RnR_n captures exactly that gap, expressed using an unknown intermediate point cc. Without it, "f(x)=f(x) = polynomial" would be false for almost every xx; with it, the equation is an exact identity, and RnR_n also tells you how good the approximation is.

Do I need to memorize both the Lagrange and Cauchy remainder formulas?

Yes for this unit — you should be able to write down either on demand and recognize that both reduce to LMVT when n=0n=0. In practice the Lagrange form is used far more often because it is easier to bound (it involves only powers of x−ax-a), while the Cauchy form appears mainly when proving certain series converge or in a handful of textbook derivations. Know both formulas, but expect to actually apply the Lagrange one.

How many terms of a Maclaurin series should I keep when evaluating a limit?

Keep just enough terms that, after simplification, at least one term survives as x→0x \to 0 and the rest visibly vanish — usually one or two terms beyond whatever cancels in the numerator. In the worked ex−1−xx2\frac{e^x-1-x}{x^2} example, the 11 and xx cancel exactly, so keeping the x2x^2 and x3x^3 terms of exe^x is enough: dividing by x2x^2 leaves a constant plus vanishing terms. If you are unsure, keep one extra term beyond what you think you need — it costs little and confirms nothing important was dropped.

Before this

Where this leads