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 , and 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 .
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 th derivative at to equal forces the coefficient of to be . The factorial appears because differentiating times produces . The full series is:
When , the series is called a Maclaurin series, and the powers are simply . The polynomial formed by the terms up to is the Taylor polynomial of degree , written . 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
- Every derivative of is , and , so for all .
- The coefficients are , giving .
- Approximate with four terms: .
- The true value is , so the error is about after only four terms.
Setting gives a famous formula for the constant itself: , 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:
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 should be .
As a check, , while the true value is . 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 near the input you care about makes the approximation converge much faster. To estimate , expand around , where the square root is easy.
Example 2: a quadratic approximation of
- , so .
- , so .
- , so , and the coefficient is .
- .
- . The true value is , correct to six decimal places.
How large is the error?
Taylor's theorem gives the error of a Taylor polynomial. If between and , then the remainder after the degree term satisfies:
For with , the fourth derivative is on the interval, so the error is at most . The actual error, , 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 works only for ; at the left side is while the terms of the series grow without bound. The set of values where a series converges is an interval centred at , and half its width is the radius of convergence. It is usually found with the ratio test.
The series for , and converge for every real . The series for converges for ; at it gives the striking result , 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 by shows that without L'Hopital's rule.
- Integrals with no elementary antiderivative: integrating the series for term by term gives , close to the true .
- Physics: the small angle approximation used for pendulums is the first term of the sine series.
- Euler's formula , 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
- Choose the centre : a point near where you need values, where the function and its derivatives are easy to evaluate.
- Differentiate the function as many times as the degree you want, and simplify each derivative.
- Evaluate each derivative at .
- Divide the th value by to get each coefficient.
- Write the polynomial with powers of , not powers of , unless .
- Check the first coefficient: must equal , and the slope of at must equal .
It is often faster to build a new series from a known one than to differentiate repeatedly. For instance, replacing by in the series for gives immediately, and multiplying the sine series by gives the series for .
Seeing the approximations on a graph
Plot 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 . 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 is from the centre. Use the remainder bound to choose , 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 exactly times gives . Dividing by makes the th derivative of the polynomial at equal to , 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.