liveBook · Manning

Taylor series

As explained in Geometry for Programmers

A Taylor series is a power series whose coefficients are determined by the derivatives of a function at a specified center.

A Taylor series builds a polynomial approximation from a function’s derivatives at a chosen center. Centering at zero produces the special case called a Maclaurin series. The resulting polynomial is cheaper to store and compute, while remaining useful over a limited range. section 6.2.1 section 6.2.4

Changing the center makes the method practical when derivatives at zero are unavailable or inconvenient. For example, ln(x) can be expanded around x = 1, while sin(x) around zero produces only odd-degree terms. section 6.2.1 section 6.2.1

Use the polynomial degree to balance computational cost and approximation quality:

  • Lower degrees provide cheaper evaluation but may fit the original function poorly. section 6.2.1
  • Adding more terms generally brings the approximation closer to the original function in the useful range. section 6.2.1
  • Do not confuse Taylor approximation with data fitting: Taylor and Maclaurin use derivatives, whereas least squares approximates supplied data points. section 6.2.4 section 6.7

Generating finite series with SymPy

SymPy’s series function accepts the function, its variable, the center, and a degree limit. For example, series(E**x, x, x0 = 0, n = 6) returns 1 + x + x**2/2 + x**3/6 + x**4/24 + x**5/120 + O(x**6). Similar calls expand ln(x) around 1 or sin(x) around zero.

How Geometry for Programmers covers it

How deep it goes
Explains derivative-based centers, degree selection, and SymPy generation, but does not develop convergence theory.
Examples
Uses exponential, logarithmic, and trigonometric expansions, including SymPy listings and a visual comparison of added terms.
What it assumes
Assumes differentiable functions and derivatives while distinguishing derivative-based approximation from data fitting.
What you can do after
Apply it via SymPy’s series function to generate finite polynomial approximations at selected centers and degrees.
How it connects
Connects Taylor series to Maclaurin series, polynomial approximation, least squares, and SymPy.

Also explained in

Compare how 3 books explain Taylor series →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Geometry for Programmers. The section links point to the parts of the book it draws on.