Function To Power Series Calculator
Pick a function, choose how many Maclaurin terms to use, and enter x to see each term, the partial sum, and the error.
Some functions are easy to state and hard to compute by hand. What is e raised to 0.7, or the sine of 0.5, without a calculator button? A power series answers that puzzle by rebuilding a curved function out of simple powers of x, added term by term. This function to power series calculator does that rebuilding in front of you: choose one of five classic functions, say how many terms to use, enter a value of x, and see every term, their sum, the true value, and the error.
All five series here are Maclaurin series, meaning they are centred at 0. That keeps the patterns clean and famous: e to the x is a sum of x to the k over k factorial, 1 over (1 minus x) is a plain sum of powers, sine and cosine alternate in sign using odd and even powers, and ln(1 + x) alternates using plain denominators. Watching the partial sum approach the true value as terms are added is the fastest way to understand why series matter.
What This Calculator Does
Pick a function and the calculator writes out its Maclaurin series terms for your value of x, evaluated one by one. It lists the terms in order, adds them into a partial sum, and places that sum beside the function's actual value at the same x. The gap between them, the absolute error, is shown as its own line, so accuracy is measured rather than assumed.
The five functions cover the patterns students meet first. The exponential uses every power with factorial denominators. The reciprocal 1 / (1 - x) uses every power with coefficient 1. Sine uses odd powers only, cosine uses even powers only, and both alternate in sign. The logarithm ln(1 + x) uses every power from x upward, alternates in sign, and divides by the power itself. One tool, five patterns, and a clear error figure for each.
How to Use This Calculator
Choose the function from the list, then enter the number of terms, from 1 to 20. More terms generally means a better approximation, provided the series converges at your x. Then enter x, the point where you want the function evaluated. Remember that x is measured the standard mathematical way, so for sine and cosine it is in radians, not degrees.
Press Calculate and study the terms line first. Notice how quickly the terms shrink for the exponential at modest x, and how slowly they shrink for the logarithm near x = 1. Then compare the partial sum with the actual value and read the error. Try the same function and x with 3, 5, and 10 terms and watch the error fall; that experiment teaches more about convergence than a page of definitions.
The Maclaurin Patterns Behind Each Function
A Maclaurin series expresses a function as a sum of powers of x with fixed coefficients. For e^x, the series is 1 + x + x squared / 2! + x cubed / 3! and so on, where the exclamation mark means factorial, the product of all whole numbers up to that number. The factorials grow extremely fast, which is why this series converges for every x and why its terms collapse so quickly.
For 1 / (1 - x), the series is 1 + x + x squared + x cubed and so on, valid when the size of x is less than 1. For sin x, the series is x - x cubed / 3! + x to the 5 / 5! and so on. For cos x, it is 1 - x squared / 2! + x to the 4 / 4! and so on. For ln(1 + x), it is x - x squared / 2 + x cubed / 3 - x to the 4 / 4 and so on, valid for x greater than -1 and up to 1. The calculator applies exactly these patterns.
Worked Example: e to the x at x = 1 With 5 Terms
Choose e^x, 5 terms, and x = 1. The terms are: term 1 = 1 = 1.000000. Term 2 = 1 / 1! = 1.000000. Term 3 = 1 / 2! = 0.500000. Term 4 = 1 / 6 = 0.166667, rounded. Term 5 = 1 / 24 = 0.041667, rounded. Adding them: 1 + 1 + 0.5 + 0.166667 + 0.041667 = 2.708333 as the partial sum, shown to six places as 2.708333 with the small rounding of the printed terms.
The true value of e is 2.718282 to six places, and the calculator, which keeps full precision internally, prints the absolute error as 0.009948. Five simple fractions have landed within one hundredth of e. Add more terms and the error keeps falling fast, because the factorials in the denominators outgrow the powers in the numerators.
A Second Example: sin x at x = 0.5 With 3 Terms
Choose sin x, 3 terms, and x = 0.5, remembering that 0.5 is in radians. Term 1 = x = 0.500000. Term 2 = -(0.5 cubed) / 3! = -0.125 / 6 = -0.020833, rounded. Term 3 = +(0.5 to the 5) / 5! = 0.03125 / 120 = 0.000260, rounded. The partial sum is 0.500000 - 0.020833 + 0.000260 = 0.479427 to six places.
The true value of sin 0.5 is 0.479426 to six places, so the error is only about 0.000002. Three terms were enough here because x is small: the powers shrink quickly and the factorials help them. Try the same function at x = 3 and the story changes; early terms grow before they shrink, and many more terms are needed. That contrast is the real lesson of series: accuracy depends on both the number of terms and the size of x.
How to Read Your Results
The terms line is a story about convergence. If the terms are shrinking quickly toward zero, the partial sum is probably already close to the truth. If the terms are still large, or growing, the sum cannot be trusted yet, whatever it says. The error line settles the question whenever the true value is available for comparison, as it is for all five functions here.
Use the error to choose a sensible number of terms rather than a round guess. For rough work an error under 0.001 may be plenty; for careful work you might demand 0.000001. Increase the terms one or two at a time and stop when the error stops improving in the places you care about. If adding terms makes the sum wander instead of settle, your x is likely outside the range where that series converges, which is itself valuable information.
Where Series Converge, and Where They Do Not
The exponential, sine, and cosine series converge for every real x, though large x values need many terms because the powers grow before the factorials defeat them. The series for 1 / (1 - x) converges only when the absolute value of x is less than 1; at x = 2, for example, its terms grow and the sum runs away from the true value of -1, which the calculator will happily demonstrate.
The logarithm series converges for x greater than -1 and up to and including 1, but near the edges it converges very slowly, needing hundreds of terms for fine accuracy at x = 1. Knowing a series' valid range, called its interval of convergence, is as important as knowing its pattern. This calculator caps the terms at 20 so you can explore behaviour safely without waiting for huge computations, and its error line always tells you how the approximation is doing.
Common Mistakes With Power Series
The most common mistake is entering degrees for sine and cosine. Series are built for radians, so sin of 30 degrees must be entered as its radian value, about 0.5236, not as 30. A second mistake is trusting a partial sum outside the interval of convergence, especially for 1 / (1 - x) and ln(1 + x), where more terms can make the answer worse, not better.
Students also mix up the patterns: giving sine an even power, forgetting that cosine starts at 1, or dropping the alternating signs, which destroys the cancellations that make the sums accurate. Another slip is rounding each term early and then wondering why the sum disagrees with a precise calculation. Let the calculator carry full precision, round only at the end, and always glance at the error before quoting a series result.
Frequently Asked Questions
1. What is a power series?
It is a sum of powers of a variable with fixed coefficients, used to represent a function. A Maclaurin series is a power series centred at 0, which is the kind this calculator builds.
2. What is a partial sum?
It is the total after adding a chosen number of terms of the series. With 5 terms you add the first five terms only, and the partial sum approximates the function rather than equalling it exactly.
3. How accurate is the approximation?
The calculator shows the absolute error beside every result, the difference between the partial sum and the true value. In the examples, 5 terms for e gave an error near 0.0099, and 3 terms for sin 0.5 gave about 0.000002.
4. Why do factorials appear in so many series?
They come from repeated rates of change of the function at the centre. Factorials also grow very fast, which is what makes the exponential, sine, and cosine series converge for every x.
5. What does centred at 0 mean?
It means the powers are plain powers of x, built around the point x = 0. Series can be centred elsewhere using powers of (x - a), but the five classic patterns here use the cleaner centre 0.
6. Why does 1 / (1 - x) fail at larger x?
Its terms are plain powers of x. When the size of x is 1 or more, those powers do not shrink, so the sum cannot settle on a value. Its interval of convergence is x between -1 and 1, exclusive.
7. Should x be in degrees or radians for sine and cosine?
Radians, always. Power series for trigonometric functions are derived using radian measure. Convert degrees to radians first by multiplying by pi and dividing by 180.
8. How many terms should I use?
Enough for the error you can accept. Increase the terms and watch the error line; stop when it is smaller than your tolerance. Small x values need few terms; large or edge values need many.
9. What is the series for ln(1 + x)?
It is x - x squared / 2 + x cubed / 3 - x to the 4 / 4 and so on, alternating in sign with the power itself as each denominator. It converges for x greater than -1 and up to 1.
10. Why do sine and cosine alternate in sign?
The alternating signs come from the pattern of their rates of change cycling through positive and negative values. The signs create cancellations that let the sum match a wave that rises and falls.
11. Can a series give an exact answer?
Only with infinitely many terms, which cannot be added in practice. A partial sum is an approximation, which is why the error line matters. In return, a few terms often give accuracy far beyond hand methods.
12. What is the interval of convergence?
It is the set of x values for which the series settles to the function's value. Outside it, partial sums drift or explode. Each function entry in this article states its interval.
13. Why does e^x converge for all x?
Because factorials eventually outgrow any fixed power growth. For large x the early terms can be big, but later terms shrink relentlessly, so the total always settles, sometimes after many terms.
14. What happens with a negative x?
The patterns still apply. Powers of a negative x alternate in sign themselves, which combines with the series signs. Try e to the -1 with several terms and watch the sum approach about 0.367879.
15. Is 20 terms always enough?
No. For small x it is far more than enough, but near the edge of an interval, such as ln(1 + x) at x = 1, even 20 terms leave a visible error. The error line tells you honestly either way.
Final Thoughts
A power series turns a hard function into patient addition. Choose the function, add terms, and watch the partial sum close in on the truth, with the error shrinking in plain sight. Use this calculator to build that intuition: test small and large x, few and many terms, and the ideas of convergence and intervals will stop being definitions and start being behaviour you have seen.