Taylor Series Approximating Any Function Near a Point
Turn any smooth function into an infinite polynomial. Learn the Taylor series formula from first principles, derive the standard series for ex, sin x, cos x and ln(1+x), bound the error, and use Taylor series to crack limits that stump L'Hôpital. 12 fully worked examples & interactive diagram included.
Series & SequencesPower SeriesInfinite PolynomialsError BoundsMaclaurin Special Case
The Core Idea — Polynomials Are Easier Than Everything Else
Polynomials are the simplest functions in calculus. You can add, subtract, multiply, differentiate, and integrate them with pure arithmetic. Functions like sin x, eˣ, and ln x are far more complicated, they do not have finite closed forms when you repeatedly differentiate them.
The big question Taylor answered in the 18th century was this: can every smooth function be written as an infinite polynomial? The answer, for an enormous class of functions, is yes. And that infinite polynomial is called the Taylor series.
The intuition is straightforward. Suppose you want to approximate a function f(x) near some point x = a. You start with the simplest possible approximation, a constant, and then keep adding correction terms, each one matching a higher derivative of f at x = a. After infinitely many terms, you have an exact representation of f(x) (within the radius of convergence).
Analogy. Think of zooming into a photograph. At first you see a rough picture. As you zoom in more (add more terms), finer and finer detail appears — the approximation improves — until the picture is perfect.
This is why Taylor series are used everywhere: physics uses them to linearise equations; engineers use them to design filters; computer chips use polynomial approximations of sin and cos because true trigonometric functions are expensive to compute.
§ 02
The Taylor Series Formula
Let f be a function that is infinitely differentiable at x = a. The Taylor series of f centred at a is:
Taylor Series — General Form
f(x) = Σ [n=0 to ∞] f⁽ⁿ⁾(a) / n! · (x − a)ⁿ
Here f⁽ⁿ⁾(a) means the n-th derivative of f evaluated at x = a, and n! = n × (n−1) × … × 2 × 1 is the factorial of n (with 0! = 1).
When the centre is a = 0, the series is called a Maclaurin series, it is simply a special case:
Maclaurin Series (Taylor at a = 0)
f(x) = f(0) + f′(0)x + f″(0)/2! · x² + f‴(0)/3! · x³ + …
Notation tip. The coefficient of (x − a)ⁿ is always f⁽ⁿ⁾(a) ÷ n!. If you remember nothing else, remember that: nth coefficient = nth derivative at the centre, divided by n factorial.
§ 03
Derivation — Where the Formula Comes From
Suppose we want a power series f(x) = c₀ + c₁(x−a) + c₂(x−a)² + c₃(x−a)³ + … that matches f at x = a.
Step 1: Plug in x = a. Every term with (x−a) vanishes, leaving f(a) = c₀. So c₀ = f(a).
Step 2, Differentiate once and plug in x = a. Differentiating term by term: f′(x) = c₁ + 2c₂(x−a) + 3c₃(x−a)² + … Setting x = a gives f′(a) = c₁, so c₁ = f′(a).
Step 4, General pattern. After n differentiations, only the term n!·cₙ survives at x = a, giving:
cₙ = f⁽ⁿ⁾(a) / n!
This is exactly the coefficient that appears in the Taylor series formula. The derivation shows that if a power series representation exists, it must take this form. Proving that it actually converges to f(x) (not just that it is the right form) requires the Remainder Theorem in §05.
§ 04
Interactive Diagram — Watch the Approximation Improve
Taylor Polynomial Visualiser
Select a function and drag the slider to add more terms. Watch the red polynomial curve converge to the true function (black).
§ 05
Standard Taylor Series You Must Know
These five series are the building blocks of almost everything else. Memorise them, you will derive new series by substituting, multiplying, differentiating, or integrating these.
Function
Taylor / Maclaurin Series
Radius of Convergence
eˣ
1 + x + x²/2! + x³/3! + x⁴/4! + …
R = ∞ (all x)
sin x
x − x³/3! + x⁵/5! − x⁷/7! + …
R = ∞ (all x)
cos x
1 − x²/2! + x⁴/4! − x⁶/6! + …
R = ∞ (all x)
ln(1+x)
x − x²/2 + x³/3 − x⁴/4 + …
R = 1 (−1 < x ≤ 1)
(1+x)ᵏ
1 + kx + k(k−1)/2! x² + k(k−1)(k−2)/3! x³ + …
R = 1 (|x| < 1)
1/(1−x)
1 + x + x² + x³ + x⁴ + …
R = 1 (|x| < 1)
arctan x
x − x³/3 + x⁵/5 − x⁷/7 + …
R = 1 (|x| ≤ 1)
Derivation shortcut. You never need to compute eˣ, sin x, or cos x from scratch — plug xⁿ for x or multiply two series together. For example, sin(x²) is obtained by replacing x with x² in the sin series: x² − x⁶/3! + x¹⁰/5! − …
§ 06
The Remainder Theorem and Error Bounds
When you truncate the Taylor series at degree n, the error is the Taylor remainder Rₙ(x):
Taylor Remainder (Lagrange Form)
f(x) = Tₙ(x) + Rₙ(x)
Rₙ(x) = f⁽ⁿ⁺¹⁾(c) / (n+1)! · (x−a)ⁿ⁺¹
for some c between a and x.
This is called Taylor's Theorem. Since you usually do not know exactly what c is, you get an error bound by finding the maximum value of |f⁽ⁿ⁺¹⁾| between a and x:
Error Bound
|Rₙ(x)| ≤ M / (n+1)! · |x−a|ⁿ⁺¹
where M = max |f⁽ⁿ⁺¹⁾(t)| for t between a and x.
Key insight. For eˣ, all derivatives are eˣ. For sin x and cos x, all derivatives have absolute value ≤ 1. These facts make bounding the error very clean.
§ 07
12 Fully Worked Examples
Example 1 — Derive the Maclaurin series for eˣEasy
Find the Maclaurin series for f(x) = eˣ by computing derivatives at a = 0.
1
Compute derivatives: f(x) = eˣ, so f⁽ⁿ⁾(x) = eˣ for all n.
2
Evaluate at a = 0: f⁽ⁿ⁾(0) = e⁰ = 1 for every n.
3
Coefficient of xⁿ is f⁽ⁿ⁾(0)/n! = 1/n!.
4
Write out the series: eˣ = Σ xⁿ/n! = 1 + x + x²/2! + x³/3! + …
eˣ = Σ [n=0 to ∞] xⁿ / n! (R = ∞)
Example 2 — Maclaurin series for sin xEasy
Derive the Maclaurin series for sin x.
1
Derivatives: sin x → cos x → −sin x → −cos x → sin x (cycle of 4).
2
At x = 0: sin 0 = 0, cos 0 = 1, −sin 0 = 0, −cos 0 = −1, then repeats.
3
Non-zero values occur only at odd n: f⁽¹⁾(0)=1, f⁽³⁾(0)=−1, f⁽⁵⁾(0)=1, …
4
Coefficient of x²ᵏ⁺¹ is (−1)ᵏ / (2k+1)!.
sin x = x − x³/3! + x⁵/5! − x⁷/7! + … (R = ∞)
Example 3 — Series for cos x from sin x (no differentiation)Easy
Find the Maclaurin series for cos x by differentiating the sin x series term by term.
Example 12 — How many terms for sin(0.2) accurate to 6 decimal places?Hard
How many terms of the Maclaurin series for sin x are needed to approximate sin(0.2) with error < 10⁻⁶?
1
sin x = x − x³/3! + x⁵/5! − … is an alternating series with decreasing terms (for |x| < 1).
2
By the Alternating Series Estimation Theorem, the error is bounded by the first omitted term.
3
Test n=3 term (x⁵/5!): (0.2)⁵/120 = 0.00032/120 ≈ 2.67×10⁻⁶. Not enough.
4
Test n=4 term (x⁷/7!): (0.2)⁷/5040 ≈ 1.27×10⁻⁸. ✓ Below 10⁻⁶.
5
So we need terms up to x⁵/5! (include it). Using 3 non-zero terms: x − x³/6 + x⁵/120.
3 non-zero terms (up to x⁵/5!) give error < 10⁻⁶ for sin(0.2).
§ 08
Using Taylor Series to Evaluate Limits
Taylor series provide an elegant alternative to L'Hôpital's rule, especially when repeated differentiation becomes messy. The strategy is: expand numerator and denominator as series near x = a, cancel the leading terms, and read off the limit.
Example: lim_{x→0} (1 − cos x) / x²
Substitute cos x = 1 − x²/2! + x⁴/4! − … so 1 − cos x = x²/2 − x⁴/24 + …
Dividing by x²: (1 − cos x)/x² = 1/2 − x²/24 + … → 1/2 as x → 0.
Example: lim_{x→0} (sin x − x) / x³
sin x − x = −x³/3! + x⁵/5! − … Dividing by x³ gives −1/6 + x²/120 − … → −1/6.
When to use series vs L'Hôpital. Prefer Taylor series when the limit involves sums or differences of standard functions, or when L'Hôpital would need to be applied 3+ times. Prefer L'Hôpital for simple single-function indeterminate forms like (ln x)/(x−1) as x→1.
§ 09
Common Mistakes
Mistake 1 — Forgetting the factorial. The coefficient of (x−a)ⁿ is f⁽ⁿ⁾(a)/n!, not just f⁽ⁿ⁾(a). Dropping n! makes every coefficient wrong.
Mistake 2 — Using a series outside its radius of convergence. ln(1+x) converges only for −1 < x ≤ 1. Using it at x = 2 gives nonsense.
Mistake 3 — Confusing Maclaurin and Taylor. A Maclaurin series is centred at a = 0. A Taylor series centred at a ≠ 0 uses powers of (x − a), not x.
Mistake 4 — Not checking convergence at endpoints. The ratio test gives the open interval. Always check the endpoints separately (often by the alternating series test or p-series test).
Mistake 5 — Differentiating or integrating without adjusting the radius. Differentiating a series does not change the radius, but may change endpoint behaviour. Check endpoints again after any manipulation.
§ 10
Related Pages in This Series
Taylor series connects deeply to everything in the Series & Sequences section. Make sure you are comfortable with these pages first:
What is the coefficient of x³ in the Maclaurin series for eˣ?
Question 2 of 10
The Taylor series for f(x) centred at a uses powers of:
Question 3 of 10
The Maclaurin series for sin x contains only:
Question 4 of 10
The radius of convergence of the Maclaurin series for ln(1+x) is R = ___. Enter a number.
Question 5 of 10
Which of the following is the correct Maclaurin series for cos x?
Question 6 of 10
Using the Maclaurin series, lim_{x→0} (1 − cos x) / x² equals:
Question 7 of 10
The Lagrange remainder for a Taylor polynomial of degree n is bounded by M · |x − a|ⁿ⁺¹ divided by:
Question 8 of 10
What is the Maclaurin series for e^(−x²)?
Question 9 of 10
The first non-zero coefficient of the Maclaurin series for sin x / x is (enter a number):
Question 10 of 10
Which of the following Maclaurin series has an infinite radius of convergence?
Continue learning:
The natural next step is Maclaurin Series, which explores the a = 0 case in depth and builds a complete reference table.
For the convergence machinery, see Power Series and Ratio & Root Tests.