Explore calculusLesson 30 of 48 · 8 min

Keep the remainder in a series

Interpret a Taylor polynomial as a local approximation with an order term.

Maths refresher: Local approximation and big O

A Taylor polynomial matches a function’s derivatives at a chosen point. O(x⁷) describes remainder scaling near zero, not an exact equality everywhere.

sin⁡x=x−x36+x5120+O(x7)\sin x=x-\frac{x^3}{6}+\frac{x^5}{120}+O(x^7)
Worked example

At small ∣x∣|x|, the first omitted powers can be small. Farther from zero, the same polynomial may be much less accurate.

Maths prerequisite map ↗

A Taylor expansion approximates a sufficiently smooth function near a chosen point using powers of the displacement from that point. The expansion point and retained order are part of the statement, not optional annotations.

See the mathematics
-4-2024-2.5-1.2501.252.5xy
-4-2024-2.5-1.2501.252.5xy
sin⁡x≈x−x36+x5120\sin x\approx x-\frac{x^3}{6}+\frac{x^5}{120}
  • sin⁡(x)\sin{\left(x \right)}
  • x5120−x36+x\frac{x^{5}}{120} - \frac{x^{3}}{6} + x
Starter reference. Green: sine. Amber: the degree-five polynomial about zero. Accuracy is local and deteriorates away from the expansion point.

SymPy series includes an Order term describing asymptotic remainder behaviour. removeO extracts a polynomial when you need to evaluate or plot it, but removing the notation does not eliminate the mathematical approximation error.

The sine example expands around zero through powers below seven. Compare its errors at a nearby and a farther input. A small error at one point is a useful check, not a global error bound. Keep the original function available when using a truncated approximation in a model.

Does removeO make a Taylor polynomial exact for every x?

Write a prediction (optional)

Exact symbolic investigation

Select Run Python with the code unchanged.

Tools
About Python

Python and the course packages can load while you read. Each run starts with fresh user variables; imported modules stay loaded. Stop replaces the worker. Runtime details ↗

Ctrl+Enter or ⌘+Enter runs Python.

Compare with the worked example

Executed from the published Python during the site build. Your own run appears above. Build environment ↗

Series
x−x36+x5120+O(x7)x - \frac{x^{3}}{6} + \frac{x^{5}}{120} + O\left(x^{7}\right)
Polynomial only
x5120−x36+x\frac{x^{5}}{120} - \frac{x^{3}}{6} + x
Error at center + 1/10
−1.983851436⋅10−11-1.983851436 \cdot 10^{-11}
Error at center + 2
−0.02403590651-0.02403590651
Worked text output
Series: x - x**3/6 + x**5/120 + O(x**7)
Polynomial only: x**5/120 - x**3/6 + x
Error at center + 1/10: -1.983851436E-11
Error at center + 2: -0.02403590651

Read the starter result

For the starter, the absolute error is larger at the point two units from the centre. This comparison illustrates locality rather than proving a universal monotonic error law.

Edit and compare

Replace function = sp.sin(x) with function = sp.exp(x) and center = 0 with center = 1. Select Run Python. Find the powers of x−1 and the order term in Series. Compare that result with Polynomial only before using it as an approximation.

Return to the editor

Scope. An asymptotic order term is not by itself a numerical error bound throughout an arbitrary interval.

Try a fresh case

Which details belong beside a truncated series used in a calculation?

Choose an answer
Need a hint?
Hint 1

Ask where the polynomial was constructed.

Hint 2

Track what was omitted and where its error is acceptable.

Your notesNotes save in this browser when storage is available.