Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Calculus

Taylor Series: Approximating Functions with Polynomials

By MathSolver Pro Editorial Team · Published

A Taylor series rewrites a function as an infinite polynomial built from its derivatives at a single point. Cutting the series off after a few terms gives a Taylor polynomial, an approximation that is easy to compute and whose error can be bounded.

The idea: match the derivatives

Polynomials are the easiest functions to work with. You can evaluate them using only addition and multiplication, and differentiating or integrating them is routine. Functions such as exe^x, sin⁡x\sin x and ln⁡x\ln x are much harder to compute by hand. The idea of a Taylor series is to find a polynomial that behaves like the function near a chosen point aa.

The best line through a point is the tangent line, which matches the function's value and its first derivative there. A parabola can also match the second derivative, so it follows the curve's bending. A cubic can match the third derivative as well, and so on. Each extra matched derivative makes the polynomial hug the function over a wider stretch around the point. Continuing forever gives the Taylor series.

The Taylor series formula

Requiring the polynomial's nnth derivative at aa to equal f(n)(a)f^{(n)}(a) forces the coefficient of (x−a)n(x - a)^n to be f(n)(a)n!\frac{f^{(n)}(a)}{n!}. The factorial appears because differentiating (x−a)n(x - a)^n nn times produces n!n!. The full series is:

f(x)=∑n=0∞f(n)(a)n!(x−a)n=f(a)+f′(a)(x−a)+f′′(a)2!(x−a)2+⋯f(x) = \sum_{n=0}^{\infty}\frac{f^{(n)}(a)}{n!}(x - a)^n = f(a) + f'(a)(x - a) + \frac{f''(a)}{2!}(x - a)^2 + \cdots

When a=0a = 0, the series is called a Maclaurin series, and the powers are simply xnx^n. The polynomial formed by the terms up to (x−a)n(x - a)^n is the Taylor polynomial of degree nn, written Pn(x)P_n(x). The first two terms alone are the tangent line approximation, also called linearisation.

Building the series for e to the x

Example 1: the Maclaurin series of exe^x

  1. Every derivative of exe^x is exe^x, and e0=1e^0 = 1, so f(n)(0)=1f^{(n)}(0) = 1 for all nn.
  2. The coefficients are 1n!\frac{1}{n!}, giving ex=1+x+x22!+x33!+⋯e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots.
  3. Approximate e0.5e^{0.5} with four terms: 1+0.5+0.125+0.02083‾=1.645831 + 0.5 + 0.125 + 0.0208\overline{3} = 1.64583.
  4. The true value is 1.648721.64872, so the error is about 0.00290.0029 after only four terms.

Setting x=1x = 1 gives a famous formula for the constant itself: e=1+1+12+16+124+⋯e = 1 + 1 + \frac{1}{2} + \frac{1}{6} + \frac{1}{24} + \cdots, which reaches 2.71828 after a dozen terms because the factorials grow so quickly.

Series worth knowing

These Maclaurin series appear constantly, and most others can be built from them by substitution, multiplication, differentiation or integration:

ex=∑n=0∞xnn!,sin⁡x=x−x33!+x55!−⋯ ,cos⁡x=1−x22!+x44!−⋯e^x = \sum_{n=0}^{\infty}\frac{x^n}{n!}, \qquad \sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots, \qquad \cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots
11−x=1+x+x2+x3+⋯ (∣x∣<1),ln⁡(1+x)=x−x22+x33−⋯ (−1<x≤1)\frac{1}{1 - x} = 1 + x + x^2 + x^3 + \cdots \ (|x| < 1), \qquad \ln(1 + x) = x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots \ (-1 < x \le 1)

Sine contains only odd powers, matching the fact that it is an odd function, and cosine only even powers, matching its symmetry. Differentiating the sine series term by term gives the cosine series, exactly as the derivative of sin⁡x\sin x should be cos⁡x\cos x.

As a check, sin⁡0.1≈0.1−0.0016=0.0998333\sin 0.1 \approx 0.1 - \frac{0.001}{6} = 0.0998333, while the true value is 0.09983340.0998334. Two terms already give six correct decimal places, which is why calculators can evaluate trigonometric functions so quickly with short polynomials.

Expanding around a point other than zero

Choosing aa near the input you care about makes the approximation converge much faster. To estimate 4.1\sqrt{4.1}, expand x\sqrt{x} around a=4a = 4, where the square root is easy.

Example 2: a quadratic approximation of 4.1\sqrt{4.1}

  1. f(x)=x1/2f(x) = x^{1/2}, so f(4)=2f(4) = 2.
  2. f′(x)=12x−1/2f'(x) = \frac{1}{2}x^{-1/2}, so f′(4)=14f'(4) = \frac{1}{4}.
  3. f′′(x)=−14x−3/2f''(x) = -\frac{1}{4}x^{-3/2}, so f′′(4)=−132f''(4) = -\frac{1}{32}, and the coefficient is −1/322!=−164\frac{-1/32}{2!} = -\frac{1}{64}.
  4. P2(x)=2+x−44−(x−4)264P_2(x) = 2 + \frac{x - 4}{4} - \frac{(x - 4)^2}{64}.
  5. P2(4.1)=2+0.025−0.00015625=2.02484375P_2(4.1) = 2 + 0.025 - 0.00015625 = 2.02484375. The true value is 2.02484572.0248457, correct to six decimal places.

How large is the error?

Taylor's theorem gives the error of a Taylor polynomial. If ∣f(n+1)∣≤M|f^{(n+1)}| \le M between aa and xx, then the remainder after the degree nn term satisfies:

∣Rn(x)∣≤M ∣x−a∣n+1(n+1)!|R_n(x)| \le \frac{M\,|x - a|^{n+1}}{(n + 1)!}

For e0.5e^{0.5} with n=3n = 3, the fourth derivative is et≤e0.5<2e^t \le e^{0.5} < 2 on the interval, so the error is at most 2(0.5)424≈0.0052\frac{2(0.5)^4}{24} \approx 0.0052. The actual error, 0.00290.0029, is within that bound. The bound is useful in reverse as well: it tells you how many terms you need to guarantee a given accuracy before you start computing.

For alternating series such as those for sine and cosine, there is an even simpler estimate: the error is no larger than the first omitted term. The ideas behind that rule are covered in series convergence tests.

Where the series converges

A Taylor series does not always equal its function everywhere. The geometric series for 11−x\frac{1}{1 - x} works only for ∣x∣<1|x| < 1; at x=2x = 2 the left side is −1-1 while the terms of the series grow without bound. The set of xx values where a series converges is an interval centred at aa, and half its width is the radius of convergence. It is usually found with the ratio test.

The series for exe^x, sin⁡x\sin x and cos⁡x\cos x converge for every real xx. The series for ln⁡(1+x)\ln(1 + x) converges for −1<x≤1-1 < x \le 1; at x=1x = 1 it gives the striking result ln⁡2=1−12+13−14+⋯\ln 2 = 1 - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} + \cdots, although it converges very slowly.

What Taylor series are used for

  • Evaluating functions: calculators and software use polynomial approximations closely related to Taylor polynomials.
  • Limits: replacing sin⁡x\sin x by x−x36+⋯x - \frac{x^3}{6} + \cdots shows that lim⁡x→0sin⁡x−xx3=−16\lim_{x \to 0}\frac{\sin x - x}{x^3} = -\frac{1}{6} without L'Hopital's rule.
  • Integrals with no elementary antiderivative: integrating the series for e−x2e^{-x^2} term by term gives ∫01e−x2 dx≈1−13+110−142+1216≈0.7475\int_0^1 e^{-x^2}\,dx \approx 1 - \frac{1}{3} + \frac{1}{10} - \frac{1}{42} + \frac{1}{216} \approx 0.7475, close to the true 0.74680.7468.
  • Physics: the small angle approximation sin⁡θ≈θ\sin\theta \approx \theta used for pendulums is the first term of the sine series.
  • Euler's formula eiθ=cos⁡θ+isin⁡θe^{i\theta} = \cos\theta + i\sin\theta, which follows by comparing the three series.

The Taylor series calculator expands any function to a chosen order around any point and shows each derivative. Derivative skills are essential here, so derivative rules explained is a useful companion.

A recipe for any Taylor polynomial

  1. Choose the centre aa: a point near where you need values, where the function and its derivatives are easy to evaluate.
  2. Differentiate the function as many times as the degree you want, and simplify each derivative.
  3. Evaluate each derivative at aa.
  4. Divide the nnth value by n!n! to get each coefficient.
  5. Write the polynomial with powers of (x−a)(x - a), not powers of xx, unless a=0a = 0.
  6. Check the first coefficient: Pn(a)P_n(a) must equal f(a)f(a), and the slope of PnP_n at aa must equal f′(a)f'(a).

It is often faster to build a new series from a known one than to differentiate repeatedly. For instance, replacing xx by −x2-x^2 in the series for exe^x gives e−x2=1−x2+x42−⋯e^{-x^2} = 1 - x^2 + \frac{x^4}{2} - \cdots immediately, and multiplying the sine series by xx gives the series for xsin⁡xx\sin x.

Seeing the approximations on a graph

Plot cos⁡x\cos x together with its Taylor polynomials of degree 2, 4 and 6 and a clear pattern appears. The degree 2 polynomial, a downward parabola, matches the cosine curve well near zero but drifts away beyond about one unit. The degree 4 polynomial stays close for longer, and the degree 6 polynomial follows the curve through most of its first hump. Every polynomial eventually shoots off to infinity, because no polynomial can oscillate forever, but adding terms pushes that departure further and further out, which is exactly what convergence of the series means in practice.

This picture is the best way to build intuition: the approximation is excellent near the centre and gets worse with distance. The graphing calculator can plot a function and several of its Taylor polynomials together so you can watch them converge.

Frequently asked questions

What is the difference between a Taylor series and a Maclaurin series?

A Maclaurin series is simply a Taylor series centred at a=0a = 0. Every Maclaurin series is a Taylor series, but Taylor series can be centred at any point.

How many terms of a Taylor series do I need?

It depends on the accuracy you need and how far xx is from the centre. Use the remainder bound M∣x−a∣n+1(n+1)!\frac{M|x - a|^{n+1}}{(n+1)!} to choose nn, or for alternating series stop when the next term is smaller than the error you can accept.

Why is there a factorial in the Taylor formula?

Differentiating (x−a)n(x - a)^n exactly nn times gives n!n!. Dividing by n!n! makes the nnth derivative of the polynomial at aa equal to f(n)(a)f^{(n)}(a), which is what matching the function requires.

Does a Taylor series always equal the function?

Not always. It may converge only on an interval, and in rare cases a series converges to a different function. For the standard functions in this article, the series equals the function wherever it converges.

Who invented Taylor series?

They are named after the English mathematician Brook Taylor, who published the general formula in 1715. Earlier mathematicians, including James Gregory and Isaac Newton, had already found particular series, and Colin Maclaurin later popularised the special case centred at zero.

MathSolver Pro Editorial Team

Math content and review

Our editorial team writes every guide to explain the reasoning behind each method, not just the answer. Each worked example is checked against the site's own solver engines and automated tests before it is published, and articles are revised whenever a method or an exam format changes.