Maclaurin Series Calculator

Expand a function as a Maclaurin series: see each term, the partial sum at x, a graph of the approximation and its interval of convergence, with steps.

Maclaurin Series Calculator

Calculate the Maclaurin series expansion of common functions. A Maclaurin series is a Taylor series expansion of a function about 0. It represents a function as an infinite sum of terms calculated from the derivatives at a single point (x = 0).

Function Selection

Series Parameters

Visualization Range

Display Options

Maclaurin Series: What Most Explanations Get Wrong

The most common mistake on this subject is believing that a Maclaurin series equals the function for every value of x. That is false. A Maclaurin series equals the function only inside its interval of convergence. Outside that interval, the series either diverges or converges to a different number entirely. This Maclaurin series calculator shows you the polynomial, the error, and a convergence warning when you try to use the series outside its valid range. Use it to see, term by term, whether adding more terms helps or makes things worse.

  • Purpose: Compute the Maclaurin series or Maclaurin polynomial of a function with a step-by-step breakdown of each term.
  • Form: f(x) = Σ(n=0 to ∞) [f⁽ⁿ⁾(0)/n!] xⁿ
  • Convergence: The series converges for |x| < R (radius of convergence). Some series converge for all x (e^x, sin x, cos x, sinh x, cosh x).
  • Error Control: Taylor's inequality: |Rₙ(x)| ≤ (M/(n+1)!) |x|ⁿ⁺¹, where M bounds the (n+1)th derivative on [0, x].
  • Inputs: Select a function from the list (e^x, sin x, cos x, ln(1+x), 1/(1-x), √(1+x), arctan x, sinh x, cosh x) or enter a custom function. Set the number of nonzero terms (1-20), the x-value for evaluation, and the display precision.
  • Results: The calculator returns the Maclaurin polynomial, a term-by-term table with cumulative sums, the actual function value, absolute and relative errors, and a convergence warning if x is outside the interval of convergence.

How To Use This Maclaurin Series Calculator

Open the calculator and select a function from the dropdown: e^x, sin(x), cos(x), ln(1+x), 1/(1-x), √(1+x), arctan(x), sinh(x), or cosh(x). Alternatively, enter a custom function using standard notation: ^ for power, * for multiplication, / for division, sin(), cos(), exp(), ln(), sqrt(). The custom function option uses numerical derivatives to construct the series, so it works for any differentiable function.

Set the number of nonzero terms. Choose a value between 1 and 20. The calculator will display that many nonzero terms in the expansion. For sin(x) and cos(x), nonzero terms are only the odd or even powers, respectively, so the polynomial degree will be higher than the number of terms.

Enter the x-value where you want to evaluate the approximation. The calculator computes the partial sum, the actual function value, the absolute error, and the relative error. If the x-value lies outside the interval of convergence, the calculator warns you that the partial sums do not approach the function.

Adjust the decimal places (2-8) and decide whether to show the term-by-term breakdown and the visualization chart. The chart plots the original function and the series approximation over the x-range you specify, so you can see where they match and where they diverge.

Click Calculate. The results appear in three sections: primary approximation, term table, and convergence information. Use Reset to clear all inputs and start over.

The Maclaurin Series Formula

A Maclaurin series is a special case of the Taylor series centered at x = 0. The general formula is:

f(x) = f(0) + f'(0)x + f''(0)x²/2! + f'''(0)x³/3! + ... = Σ(n=0 to ∞) [f⁽ⁿ⁾(0)/n!] xⁿ

Where f⁽ⁿ⁾(0) is the nth derivative of f evaluated at x = 0, and n! is the factorial of n. The series represents the function as an infinite polynomial. The coefficients are determined entirely by the derivatives at the single point x = 0.

What the Formula Means

The term for n = 0 is f(0), which is just the function value at zero. The term for n = 1 is f'(0) x, which captures the slope at zero. Each higher term adds information from higher derivatives, weighted by 1/n! so that the series can converge. The factorial in the denominator grows faster than any power of x, which is why series for functions like e^x, sin x, and cos x converge for all real values of x.

The common Maclaurin series are fixed and appear in Stewart's 'Calculus' §11.10 Table 1 (9th edition, 2021, Cengage). They include e^x, sin x, cos x, ln(1+x), 1/(1-x), arctan x, (1+x)^k, sinh x, and cosh x. Knowing these by heart saves time because many other series can be derived from them through substitution, differentiation, or integration.

Maclaurin Series for Common Functions
FunctionMaclaurin SeriesInterval of Convergence
e^xΣ xⁿ/n! (n=0 to ∞)(-∞, ∞)
sin xΣ (-1)ⁿ x²ⁿ⁺¹/(2n+1)! (n=0 to ∞)(-∞, ∞)
cos xΣ (-1)ⁿ x²ⁿ/(2n)! (n=0 to ∞)(-∞, ∞)
ln(1+x)Σ (-1)ⁿ⁺¹ xⁿ/n (n=1 to ∞)(-1, 1]
1/(1-x)Σ xⁿ (n=0 to ∞)(-1, 1)
arctan xΣ (-1)ⁿ x²ⁿ⁺¹/(2n+1) (n=0 to ∞)[-1, 1]
(1+x)ᵏΣ C(k, n) xⁿ (n=0 to ∞)(-1, 1)
sinh xΣ x²ⁿ⁺¹/(2n+1)! (n=0 to ∞)(-∞, ∞)
cosh xΣ x²ⁿ/(2n)! (n=0 to ∞)(-∞, ∞)

Worked Example: e^x To 5 Nonzero Terms

Take the function f(x) = e^x. Its Maclaurin series is Σ xⁿ/n! from n=0 to ∞. Every derivative of e^x is e^x, and at x=0 each derivative equals 1, so all coefficients are 1/n!.

Using the calculator, select e^x, set the number of nonzero terms to 5, and evaluate at x = 1. The terms are:

  • n = 0: 1/0! = 1
  • n = 1: 1/1! = 1
  • n = 2: 1/2! = 0.5
  • n = 3: 1/3! = 0.166667
  • n = 4: 1/4! = 0.041667

The partial sum is 1 + 1 + 0.5 + 0.166667 + 0.041667 = 2.708333. The actual value of e¹ is 2.718282. The absolute error is 0.009949, and the relative error is 0.37%. Five terms give a good approximation at x = 1 because e^x converges for all x and the factorial denominator keeps the higher terms small.

Now evaluate at x = 3 using the same 5 terms. The terms become:

  • n = 0: 1
  • n = 1: 3
  • n = 2: 9/2 = 4.5
  • n = 3: 27/6 = 4.5
  • n = 4: 81/24 = 3.375

Partial sum = 16.375. Actual e³ = 20.0855. Error = 3.7105, relative error = 18.5%. The approximation is poor because x is far from 0. The series still converges, but it needs many more terms to become accurate. The ratio test gives the radius of convergence as ∞, so the series will eventually converge, but the number of terms required grows with |x|.

Why The Approximation Fails Far From 0

A Maclaurin series is built from derivatives evaluated at x = 0. The higher the derivative order, the more information the series has about the function near zero. Far from zero, that information becomes less relevant. For functions with finite radius of convergence, such as ln(1+x) or 1/(1-x), the series simply does not converge outside that radius. For functions with infinite radius, like e^x or sin x, the series converges everywhere, but the number of terms needed for a given accuracy grows with |x|.

The calculator warns when the evaluation point lies outside the interval of convergence. For example, ln(1+x) converges only for -1 < x ≤ 1. At x = 2, the series for ln(1+x) diverges, and the partial sums do not approach ln(3). Adding more terms makes the error worse. The calculator flags this with a warning and reports the partial sum as 'Partial sum (series diverges here)'.

For functions with radius of convergence = 1, such as 1/(1-x), the series diverges for |x| ≥ 1. At x = 1, the function is undefined. At x = -1, the series 1 - 1 + 1 - 1 + ... oscillates and does not converge. The ratio test gives the radius, but endpoints must be checked separately. For 1/(1-x), both endpoints diverge. For ln(1+x), x = 1 gives the alternating harmonic series, which converges conditionally to ln(2). The calculator applies these endpoint checks.

Where Maclaurin Series Are Used

Maclaurin series appear throughout physics, engineering, and numerical computation. In physics, perturbation theory replaces a nonlinear function with its Maclaurin series truncated to a few terms. The small-angle approximation sin θ ≈ θ is the first term of the Maclaurin series for sin x. For larger angles, including the θ³/6 term corrects for the nonlinearity. In classical mechanics, the series for (1+x)ᵏ approximates relativistic corrections.

In electrical engineering, the exponential current-voltage relationship of a diode is linearized using the Maclaurin series of exp(x) for small-signal analysis. The linear term gives the dynamic resistance, and higher terms model harmonic distortion in RF amplifiers. In digital signal processing, the series for sin x and cos x generate lookup tables for waveform synthesis on embedded systems with limited memory.

In numerical analysis, Maclaurin series provide polynomial approximations for functions that are expensive to compute directly. Calculators and computers use these series to evaluate sin, cos, exp, and ln. The number of terms is chosen so that the error falls below machine precision. The same idea underlies the CORDIC algorithm and other fast computation methods.

The series also appear in solving differential equations. When a closed-form solution is impossible, a power series solution can be found by assuming y(x) = Σ aₙ xⁿ and substituting into the equation. This is standard for equations with ordinary points, such as Bessel's equation or Legendre's equation.

A Caveat About Error Bounds

The Lagrange remainder gives an exact expression for the error in a Maclaurin polynomial: Rₙ(x) = f⁽ⁿ⁺¹⁾(c) xⁿ⁺¹/(n+1)! for some c between 0 and x. Taylor's inequality turns this into a bound by replacing f⁽ⁿ⁺¹⁾(c) with its maximum on the interval. That bound is often 10 times larger than the actual error or more. It is a guarantee, not a prediction. The calculator reports the actual error, which is smaller, but for a theoretical proof you need the bound.

The one thing that most often goes wrong is forgetting to check whether x is inside the interval of convergence before using the series. The calculator catches that and warns you. Trust the warning.

Common Questions

What is the difference between the number of terms and the degree of the Maclaurin polynomial?

The number of terms counts how many nonzero terms appear in the expansion. The degree is the highest power of x among those terms. For sin(x), the first nonzero term is x (degree 1), the second is x³/6 (degree 3), so 2 terms give a polynomial of degree 3. The calculator displays both values so you know exactly what polynomial you are using.

Does the Maclaurin series always converge to the function?

No. A Maclaurin series converges to the function only within its interval of convergence. The interval is found using the ratio test, which gives the radius of convergence R. The series converges for |x| < R and may converge or diverge at x = ±R. For functions like e^x, sin x, and cos x, the radius is infinite, so the series converges for all real x. For functions like ln(1+x) and 1/(1-x), the radius is 1, and the series diverges or converges only at specific endpoints.

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

A Maclaurin series is a Taylor series centered at a = 0. A Taylor series can be centered at any value a. The formula for a Taylor series is f(x) = Σ [f⁽ⁿ⁾(a)/n!] (x-a)ⁿ. Setting a = 0 gives the Maclaurin series. If you need an expansion around a nonzero point, use a general Taylor series calculator.

Can the calculator handle custom functions that are not in the predefined list?

Yes. Select 'Custom Function' and enter the function using standard notation: ^, *, /, sin(), cos(), exp(), ln(), sqrt(). The calculator uses numerical derivatives to compute the series coefficients. This works for any function that is differentiable at x = 0. However, the accuracy of the numerical derivatives decreases for high-order terms, so limit the number of terms to 10 or fewer for reliable results.

How accurate is the Maclaurin series approximation for a given number of terms?

Accuracy depends on the function, the x-value, and the number of terms. For functions that converge for all x, adding more terms always reduces the error at any fixed x. For functions with finite radius, accuracy is good only within the interval of convergence. The calculator reports both the absolute error and the relative error. Taylor's inequality gives a theoretical bound: |Rₙ(x)| ≤ (M/(n+1)!) |x|ⁿ⁺¹, where M is the maximum of the (n+1)th derivative on [0, x]. This bound is often a gross overestimate, but it guarantees the error is no larger than that value.

Guides on this site