Power Series Representation Calculator
Pick a function, enter x and a number of terms, and watch the series build its answer term by term.
A power series turns a hard function into an endless sum of simple powers of x. This power series representation calculator makes that idea concrete. Choose one of six classic functions, 1/(1 - x), 1/(1 + x), e^x, sin x, cos x, or ln(1 + x), enter a value of x and a number of terms from 1 to 20, and the calculator lists each term, adds them into a partial sum, and compares that sum with the true function value so you can see the error shrink.
Seeing the terms listed, rather than just a final answer, is the whole point. You discover that the first term often does most of the work, that later terms fade fast when x is small, and that some series refuse to work at all when x steps outside their radius of convergence. Those three lessons carry most of a first course on series, and this page lets you test each one yourself.
What This Calculator Does
For your chosen function the calculator writes out the first n terms of its well known series, evaluates each term at your x, and adds them in order. For the geometric family the terms are powers of x, with alternating signs for 1/(1 + x). For e^x each power is divided by a factorial. Sine and cosine use only odd and even powers respectively, and ln(1 + x) divides each power by its index with alternating signs.
Alongside the partial sum you get the true value from the function itself and the size of the gap between them, labelled error. A radius note under the results reminds you where the series is allowed to work. If you ask for 1/(1 - x) at an x outside the allowed range, the calculator refuses with a clear message instead of printing a sum that means nothing.
How to Use This Calculator
Pick the function first, because it decides which values of x are sensible. Enter x next; small values such as 0.5 show fast, clean convergence, while values near the edge of the radius show the struggle. Then choose the number of terms. Start with 5, then rerun with 10 and 20 and watch the error line. That simple experiment teaches more about convergence speed than a page of definitions.
For sine and cosine, remember the terms count steps along the series pattern, so some listed terms are zero where the pattern skips a power. For ln(1 + x), the first term is x itself. Keep x inside the stated range: the geometric series and ln(1 + x) both have radius 1, while e^x, sin x, and cos x accept every real x.
The Six Series in Plain Language
The geometric series says 1/(1 - x) = 1 + x + x^2 + x^3 + ... for |x| less than 1. Change x to negative x and you get 1/(1 + x) = 1 - x + x^2 - x^3 + ... The exponential series says e^x = 1 + x + x^2/2! + x^3/3! + ..., where the factorials in the denominators crush the powers and make the series converge for every x.
Sine keeps only odd powers with alternating signs: x - x^3/3! + x^5/5! - ... Cosine keeps only even powers: 1 - x^2/2! + x^4/4! - ... The logarithm series says ln(1 + x) = x - x^2/2 + x^3/3 - x^4/4 + ..., valid for x greater than -1 and at most 1. This calculator uses exactly these patterns, with factorials built by a plain multiplication loop.
Worked Example: 1/(1 - x) at x = 0.5 With 5 Terms
Choose 1/(1 - x), set x = 0.5 and n = 5. The terms are powers of 0.5: Term 1: 1.000000. Term 2: 0.500000. Term 3: 0.250000. Term 4: 0.125000. Term 5: 0.062500. Adding them in order: 1 + 0.5 = 1.5; 1.5 + 0.25 = 1.75; 1.75 + 0.125 = 1.875; 1.875 + 0.0625 = 1.9375. So the partial sum is 1.937500.
The true value is 1/(1 - 0.5) = 1/0.5 = 2.000000. The error is 2.000000 - 1.937500 = 0.062500, exactly the size the next term would suggest, since each new term here is half the one before. Add a sixth term of 0.03125 and the sum rises to 1.96875, halving the error again. That steady halving is geometric convergence in action, and you can watch it happen one term at a time.
A Second Example: e^x at x = 1 With 5 Terms
Now choose e^x, set x = 1 and n = 5. The terms are 1, then 1/1! = 1, then 1/2! = 0.500000, then 1/3! = 0.166667, then 1/4! = 0.041667. Adding them: 1 + 1 = 2; 2 + 0.5 = 2.5; 2.5 + 0.166667 = 2.666667; 2.666667 + 0.041667 = 2.708333. The partial sum is 2.708333.
The true value of e^1 is 2.718282, so the error, worked from the unrounded values, is 0.009948. Five terms already land within one hundredth, and because factorials grow so quickly, a few more terms shrink the error dramatically. Try n = 10 at the same x and compare; the difference between the two runs is the clearest demonstration on this page of why the exponential series is trusted inside real calculators and computers.
How to Read Your Results
The terms list is your microscope. If terms shrink quickly, the partial sum settles quickly and few terms are needed. If terms shrink slowly, as they do for ln(1 + x) near x = 1, expect to need many terms and to see a stubborn error. If terms grow, the series is diverging at that x and no number of terms will save it, which is why the radius note matters.
Use the error line as your quality score. For homework, report the partial sum together with its error so a reader knows how far to trust it. For exploration, double the number of terms and note how the error responds: geometric-style series cut error by a steady ratio, while factorial series cut it far more aggressively with each added term.
Radius of Convergence, Without the Fear
Every power series has a territory where it works, called its interval of convergence, and the distance from the center to the edge is the radius. The geometric series and the logarithm series here have radius 1. Inside that territory the terms fade and the sum matches the function; outside it the terms refuse to die away and the sum is meaningless, so this calculator stops you with an error message rather than pretend otherwise.
The exponential, sine, and cosine series have an infinite radius. Their factorial denominators eventually beat any fixed power of x, no matter how large x is, though very large x values still need many terms before the factorials take control. Testing e^x at x = 5 with 5 terms, then 20 terms, shows that tug of war clearly.
Common Mistakes With Power Series
The classic mistake is using a series outside its radius, for example asking for 1/(1 - x) at x = 2 and trusting the growing sum. The second mistake is stopping too early near the edge of the interval, where convergence is slow; ln(1 + x) at x = 1 needs many terms for even modest accuracy. A third mistake is forgetting that sine and cosine here work in radians, like all series work, so an x meant as degrees gives a nonsense comparison.
Finally, do not confuse a partial sum with the function. A partial sum is a polynomial, a friendly approximation that happens to hug the function near the center. The error line exists precisely to keep that distinction honest, so always read it before quoting a result.
Frequently Asked Questions
1. What is a power series representation?
It is a way of writing a function as an endless sum of powers of x with set coefficients, such as e^x written as 1 + x + x^2/2! + x^3/3! and so on.
2. What is a partial sum?
A partial sum is what you get by adding only the first n terms of the series and stopping. This calculator shows it next to the true value so you can see the gap.
3. Which functions does this calculator support?
Six classics: 1/(1 - x), 1/(1 + x), e^x, sin x, cos x, and ln(1 + x). Each uses its standard textbook series, with the radius of convergence noted in the results.
4. Why does 1/(1 - x) fail at x = 2?
Because its radius of convergence is 1. At x = 2 the terms 1, 2, 4, 8 grow instead of shrinking, so the sum never settles and the calculator shows an error message.
5. How many terms should I use?
Start with 5 and increase. For x = 0.5 in the geometric example, 5 terms gave an error of 0.0625. More terms help most when terms are already shrinking steadily.
6. What does the error number mean?
It is the size of the difference between the true function value and your partial sum. In the e^x example at x = 1 with 5 terms, the error was 0.009948.
7. Why do some sine terms show zero?
The sine series contains only odd powers of x, so the even steps in the pattern contribute zero. Cosine is the mirror image, containing only even powers.
8. How are factorials calculated here?
By a simple loop that multiplies 1 by 2, then by 3, and so on up to the needed number. For example 4! = 1 x 2 x 3 x 4 = 24, which is why the fifth e^x term is 1/24.
9. Does x for sine and cosine use degrees or radians?
Radians, always. Power series for sine and cosine are built on radian measure, so enter an angle like 0.5, not 30, when you explore those two functions.
10. What is the radius of convergence for e^x?
Infinite. The factorial denominators eventually outgrow any power of a fixed x, so the series converges for every real x, though large x values need more terms.
11. Why is ln(1 + x) slow near x = 1?
Its terms shrink like 1 divided by the term number, which is very slow. At x = 1 the series still converges, but you need many terms for a small error.
12. Can a power series equal a function exactly?
Yes, inside its interval of convergence, when all infinitely many terms are included. Any finite stop gives a partial sum, which is an approximation with the error this calculator reports.
13. What is the first term of ln(1 + x)?
It is x itself. The series runs x - x^2/2 + x^3/3 - x^4/4, so at small x the logarithm is close to x, which is a famous and useful approximation.
14. Is 1/(1 + x) related to 1/(1 - x)?
Directly. Replacing x with negative x in the geometric series flips every second sign, giving 1 - x + x^2 - x^3, which is exactly the series this calculator uses.
15. How accurate is the calculator with 20 terms?
Very accurate well inside the radius, because errors compound downward as terms shrink. Near the edge of a radius-1 series, even 20 terms can leave a visible error, which the results will show honestly.
Final Thoughts
A power series is a promise: give me enough simple terms and I will rebuild a complicated function. This calculator lets you audit that promise term by term, with the true value and the error printed beside every attempt. Try the geometric series at 0.5, push e^x out to 20 terms, and test the edges of the radius. Once you have watched errors shrink and explode with your own inputs, the theory tends to stay learned.