Taylor Polynomial Calculator

Compute the Taylor polynomial expansion of any function f(x) around a center a, up to degree n. Visualize the approximation, view each derivative term, and estimate the error at any evaluation point x.

Use standard math notation: sin(x), cos(x), exp(x), log(x), sqrt(x), x^2, etc.
0 – 12
around center
Examples:
sin(x) at 0
e^x at 0
ln(1+x) at 0
cos(x) at 0
1/(1-x) at 0
√(1+x) at 0
tan(x) at 0
x·sin(x) at 0
Privacy first: All computations and graph rendering are performed locally in your browser. No data is sent to any server.

What is a Taylor Polynomial?

In calculus, a Taylor polynomial is a polynomial approximation of a function f(x) near a specific point a (the center). For a function that is sufficiently smooth (differentiable) at a, the Taylor polynomial of degree n is given by:

Pn(x) = f(a) + f'(a)(x − a) + f''(a)/2! · (x − a)² + … + f(n)(a)/n! · (x − a)n

where f(k)(a) denotes the k‑th derivative of f evaluated at a, and k! is the factorial of k.

The Taylor polynomial is the best polynomial approximation of degree n near a, in the sense that its derivatives up to order n match those of f at a. As n increases, the polynomial typically converges to f over an interval known as the radius of convergence. When a = 0, the expansion is also called a Maclaurin series.

Key Properties & The Remainder Term

The difference between f(x) and its Taylor polynomial is called the remainder or truncation error:

Rn(x) = f(x) − Pn(x)

Lagrange form of the remainder: If f is (n+1)‑times differentiable, then for some ξ between a and x, Rn(x) = f(n+1)(ξ) / (n+1)! · (x − a)n+1

This remainder formula provides a way to bound the error of the Taylor approximation. For example, if |f(n+1)(t)| ≤ M for all t between a and x, then |Rn(x)| ≤ M · |x − a|n+1 / (n+1)!. This is the foundation of many numerical methods in scientific computing, physics, and engineering.

Why Use This Interactive Calculator?

  • Visual Learning: See how the Taylor polynomial approximates the function as the degree increases. Adjust the center and watch the approximation adapt.
  • Error Estimation: Instantly compute the error at any point. Understand how the degree and distance from the center affect accuracy.
  • Educational Aid: Verify hand‑computed expansions, explore Maclaurin series, and prepare for exams or coursework.
  • Engineering & Physics: Use polynomial approximations for linearization, sensitivity analysis, or numerical simulation where closed‑form solutions are intractable.
  • Research & Development: Quickly generate Taylor coefficients for further symbolic manipulation or to test convergence hypotheses.

How the Computation Works

The calculator uses symbolic differentiation via the math.js library to compute the exact derivatives of f(x) at the center a. For each degree k from 0 to n, it:

  1. Computes the k‑th derivative symbolically: f(k)(x).
  2. Evaluates it at x = a to obtain the coefficient ck = f(k)(a) / k!.
  3. Builds the Taylor polynomial as a sum of ck · (x − a)k.

For functions where symbolic differentiation fails (e.g., piecewise or highly nested functions), the tool falls back to numerical differentiation using a high‑precision central difference scheme with adaptive step size. This ensures robust operation for a wide variety of inputs.

The graph displays the original function f(x) (blue) and the Taylor polynomial Pn(x) (red) over a user‑adjustable interval around the center a. The center point is marked in green, and the evaluation point x is shown in gray. The error at x is computed as the absolute difference between f(x) and Pn(x), and also displayed as a percentage.

Common Taylor Expansions (Maclaurin Series)

Function Taylor expansion at a = 0 Radius of convergence
sin(x) x − x³/3! + x⁵/5! − x⁷/7! + …
cos(x) 1 − x²/2! + x⁴/4! − x⁶/6! + …
ex 1 + x + x²/2! + x³/3! + x⁴/4! + …
ln(1+x) x − x²/2 + x³/3 − x⁴/4 + … 1
1/(1−x) 1 + x + x² + x³ + x⁴ + … 1
√(1+x) 1 + x/2 − x²/8 + x³/16 − 5x⁴/128 + … 1
tan(x) x + x³/3 + 2x⁵/15 + 17x⁷/315 + … π/2
Case Study: Linearization in Physics

In classical mechanics, the small‑angle approximation for a pendulum replaces sin(θ) with θ (the first‑degree Taylor polynomial). For small angles (θ ≪ 1), this simplification yields the linear differential equation for harmonic motion. Using our calculator, set f(x) = sin(x), a = 0, n = 1, and evaluate at θ = 0.1 rad: the error is negligible (~0.0167%). At θ = 0.5 rad, the error grows to about 4.2%, showing the limits of the approximation. Increase n to 3 or 5 to see improved accuracy — a perfect demonstration of Taylor's theorem in action.

Step‑by‑Step Usage

  1. Enter a function f(x) in the input field using standard mathematical notation (e.g., sin(x), exp(x), log(1+x), x^2 + 2*x + 1).
  2. Set the center a (the point around which the expansion is made).
  3. Choose the degree n of the polynomial (0 to 12). Higher degrees give better approximations but may be slower.
  4. Specify the evaluation point x to compute the approximation value and error.
  5. Adjust the plot range to view the function and polynomial over the desired interval.
  6. Click Compute & Visualize to see the Taylor polynomial, coefficients, error, and graph.
  7. Use the preset examples to explore famous expansions instantly.

Common Misconceptions

  • "The Taylor polynomial equals the function everywhere." Only for polynomials themselves, or in the limit n → ∞ within the radius of convergence. For finite n, it is an approximation that improves near a.
  • "Higher degree always improves accuracy." Not necessarily — outside the radius of convergence, higher‑degree polynomials can diverge (Runge's phenomenon). Also, numerical issues may arise for very high n.
  • "The Maclaurin series is just a special case." Correct — it is the Taylor series centered at a = 0. Many well‑known series are Maclaurin expansions.
  • "Taylor polynomials are only for theoretical math." False — they are widely used in numerical analysis, physics, finance, and engineering for linearization, optimization, and simulation.

Applications Across Disciplines

  • Physics: Approximating potentials (e.g., harmonic oscillator), solving differential equations, and perturbative methods.
  • Engineering: Linearizing nonlinear systems for control theory, stress analysis, and signal processing.
  • Finance: Pricing derivatives using Taylor approximations for stochastic processes.
  • Computer Science: Implementing elementary functions (sin, cos, exp) in hardware via polynomial approximations.
  • Machine Learning: Taylor expansions are used in optimization (e.g., Newton's method) and in understanding neural network activations.

Rooted in classical analysis — This tool is built on the rigorous foundations of Taylor's theorem, first published by Brook Taylor in 1715 and later generalized by Colin Maclaurin, Joseph‑Louis Lagrange, and Augustin‑Louis Cauchy. The implementation uses symbolic differentiation (math.js) and validated numerical methods. Reviewed by the GetZenQuery tech team, last updated July 2026.

References: MathWorld Taylor Series; Apostol, T.M. "Calculus" (1967); Wikipedia: Taylor's theorem.

Frequently Asked Questions

A Maclaurin series is simply a Taylor series centered at a = 0. The formulas are identical; only the center differs. For example, the Maclaurin series for sin(x) is sin(x) = x − x³/3! + x⁵/5! − …, while the Taylor series centered at a = π/2 would involve powers of (x − π/2).

The accuracy depends on the degree n, the distance |x − a|, and the behavior of the derivatives of f. The Lagrange remainder gives a rigorous bound: |Rn(x)| ≤ M · |x − a|n+1 / (n+1)!, where M is the maximum of |f(n+1)| on the interval between a and x. In practice, the error decreases rapidly as n increases for well‑behaved functions near the center.

You can enter any function using standard mathematical notation: sin(x), cos(x), tan(x), exp(x), log(x) (natural log), sqrt(x), x^2, x^3, and combinations like sin(x^2), exp(-x^2), log(1+x), etc. The calculator uses math.js to parse and differentiate the expression symbolically.

Check that your function is correctly entered and that the plot range is appropriate. If the function has singularities (e.g., log(x) for x ≤ 0) or the Taylor polynomial diverges, the graph may appear empty or distorted. Try adjusting the range or using one of the preset examples to verify the tool is working.

This calculator currently supports single‑variable functions only. For multivariable Taylor expansions, please refer to our separate Multivariable Taylor Calculator (coming soon).

The radius of convergence is the distance from the center a within which the Taylor series converges to the function. For functions like sin(x) or ex, the radius is infinite. For functions like ln(1+x) or 1/(1−x), the radius is 1 (limited by singularities at x = −1 and x = 1, respectively). The calculator does not compute the radius explicitly, but the graph helps you visualize convergence behavior.