acalculator

What is the sum of a series?

Type the n-th term a(n), the first n and the last n (or inf). The page adds a finite series, and for an infinite series says whether it converges and, for geometric and telescoping series, gives the sum.

Your numbers

Use n as the variable.
Sum
5.142857143

The sum of (-3)^(n + 1)/4^(n - 1) from n = 1 to inf is 5.142857143.

The series
Converges
Exact sum
36/7

Sum: 5.142857143. The sum of (-3)^(n + 1)/4^(n - 1) from n = 1 to inf is 5.142857143.

How to calculate

Sums a(n) from n = n0 to a whole number or to infinity, and says whether an infinite series converges.

Example with the default inputs (Term a(n) (-3)^(n + 1)/4^(n - 1), From n = 1, To n = inf): The sum of (-3)^(n + 1)/4^(n - 1) from n = 1 to inf is 5.142857143.

Method: Geometric series with ratio r: a/(1 − r) when |r| < 1. Rational terms: partial fractions that telescope.

  • n takes every whole number from the first to the last.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Term a(n) (-3)^(n + 1)/4^(n - 1), From n = 1, To n = inf gives The series Converges, Sum 5.142857, Exact sum 36/7.Source: OpenStax, Calculus Volume 2, section 5.2 Infinite Series, Example 5.9(a). https://openstax.org/books/calculus-volume-2/pages/5-2-infinite-series
  2. Term a(n) 1/(n (n + 1)), From n = 1, To n = inf gives The series Converges, Sum 1, Exact sum 1.
  3. Term a(n) n/(n + 1), From n = 1, To n = inf gives The series Diverges.

How it works

The page sums a(n) for every whole number n from n0 to the last n, which is a whole number or ∞ (typed inf).

Finite sums

The terms are added one by one in 64-bit floating point with a running correction (Neumaier summation), so rounding does not build up; the Sum is shown to 10 significant figures, rounded half up. A finite sum has no exact form on this page. It may have up to 999,999 terms after the first. A term that is not a real number gives a message naming its n.

Infinite series

The page shows The series: Converges or Diverges, and for a convergent series whose sum it finds, the Sum and the Exact sum. It decides in this order.

1. Rational terms (a(n) uses only numbers, n, + − * /, and whole-number powers). Each of a(n0) to a(n0 + 1000) must be a real number, or the page names the first n where it is not. When a(n) has a division or a negative power, the algebra also solves 1/a(n) = 0: for each real solution, the nearest whole number n from n0 on where a(n) is not a real number (a term 1/0, such as n = 2000 for 1/(n − 2000)) is named, and the series has no answer; when the algebra finds no solutions list, the page gives no answer. The size of a(n) behaves like n^d with d = the whole number nearest log10(|a(10⁷)/a(10⁶)|), which must equal the whole number nearest log10(|a(10¹⁵)/a(10¹⁴)|); if they differ, the leading terms have not taken over (1/(n² + 10¹⁵) is still about 10⁻¹⁵ at n = 10⁷) and the page gives no answer:

  • d ≥ −1: Diverges (the terms are no smaller than a multiple of 1/n; compared with the harmonic series, or they do not go to 0).
  • d ≤ −2: Converges (compared with Σ 1/n²).

The page then looks for the sum by telescoping. The algebra writes a(n) as partial fractions. Each fraction must have the form c/(n + d)^k for a whole number k ≥ 1: k is the nearest whole number to log10(|T(10⁵)/T(10⁶)|) for the fraction T; c and d come from |T(n)|^(−1/k), which is a straight line in n, at n = 30 and n = 40; and c/(n + d)^k must equal T at n0, n0 + 1, n0 + 3 and 50 to 1 part in 10¹². The fractions are grouped by k and by d (two d's are in one group when they differ by a whole number). In each group the c's must add to 0 (to 10⁻⁹); then the group telescopes. For each fraction, with x = n0 + (the smallest d in its group) and m = d − (that smallest d), its share of the sum is −c (1/x^k + 1/(x + 1)^k + … + 1/(x + m − 1)^k). c and x must be fractions p/q with q ≤ 1000 (to 1 part in 10¹²), written exactly. The algebra adds all the shares. If any step fails, the page says Converges without a sum.

2. Geometric terms (any other a(n)). With r = a(n0 + 1)/a(n0), a finite number (so a(n0) is not 0), the ratios a(n0 + j + 1)/a(n0 + j) for j = 1, 2 and 7 must equal r to 1 part in 10⁹. Then:

  • |r| ≥ 1: Diverges.
  • |r| < 1: Converges to a(n0)/(1 − r), written a(n0)/(1 − a(n0 + 1)/a(n0)) with the terms exactly.

3. The divergence test (terms that are neither). The algebra finds the limit of a(n) as n → ∞. If it is a number other than 0 (an exact one, checked numerically), the page says Diverges. Otherwise it says it cannot decide: this page handles rational and geometric series.

The sum is worked out from that exact text as a decimal; the Exact sum is the text simplified by the algebra when the simplified form checks and stays exact, otherwise the text as it is (left out when it holds a rounded number). Every sum is checked. The partial sums to n0 + 10,000 and n0 + 100,000 terms must approach the sum: the second must be no further from it than the first, and within 1 part in 1,000 of max(1, |sum|). The partial sums stop early once 50 terms in a row are below 10⁻¹⁷ of the running sum. A result that holds a number the algebra could only give rounded (a whole number past 2⁵³; a fraction p/q, p and q being the numbers that multiply its top and its bottom, such as 288557167/(342919925e), when q after removing its factors 2 and 5 is over 1,000,000, or is over 1 while |p| times it is over 10¹²; or a decimal with more than 12 significant digits) is never shown as exact.

What you can type

  • A number has at most 15 digits in a row. A computer number keeps only about 16 digits, so a longer one (9007199254740993) would stand for a nearby number (9007199254740992), and the page asks for fewer digits instead. Write very large or very small numbers with a power of ten (1e-20).
  • The term a(n) uses the variable n. Numbers can have decimals; + − * / and ^; brackets; a number or bracket next to n multiplies (2n, 3(n + 1)). Constants pi and e; functions sqrt, ln, exp, sin, cos and the others of the integral calculator.
  • From n = a whole number, at most 10¹² in size. To n = a whole number no less than it (fewer than 10⁶ more), or inf (also infinity, ∞, oo).

Worked examples by hand

Σ from n = 1 to ∞ of (−3)^(n+1)/4^(n−1) (OpenStax Calculus Volume 2, section 5.2, Example 5.9(a)). The first term is (−3)²/4⁰ = 9 and the ratio is r = −3/4, so |r| < 1 and the sum is 9/(1 + 3/4) = 36/7: it converges.

Σ from n = 1 to ∞ of 1/(n(n + 1)) (OpenStax Calculus Volume 2, section 5.2, Example 5.7(c)). The terms behave like n^−2, so the series converges. 1/(n(n + 1)) = 1/n − 1/(n + 1): c = 1, d = 0 and c = −1, d = 1 in one group, whose c's add to 0. With x = 1, the share of −1/(n + 1) (m = 1) is −(−1)(1/1) = 1, and the share of 1/n (m = 0) is 0. The sum is 1: it converges.

Σ from n = 1 to ∞ of n/(n + 1) (OpenStax Calculus Volume 2, section 5.2, Example 5.7(a)). The terms behave like n^0 (they approach 1, not 0), so the series diverges.

Other questions people ask

What is the sum of a geometric series?

A geometric series a + ar + ar² + … has a constant ratio r between terms. If |r| < 1 it converges to a/(1 − r), where a is the first term; if |r| ≥ 1 (and a ≠ 0) it diverges. Σ from n = 1 to ∞ of (1/2)ⁿ = (1/2)/(1 − 1/2) = 1.

What is a telescoping series?

One whose partial sums collapse because each term cancels part of the next. 1/(n(n + 1)) = 1/n − 1/(n + 1), so the sum from 1 to N is 1 − 1/(N + 1), and the infinite sum is 1.

How do I know if a series diverges?

If the terms do not go to 0, the series diverges (the divergence test): Σ n/(n + 1) diverges because its terms approach 1. Terms that do go to 0 are not enough: the harmonic series Σ 1/n diverges although 1/n → 0.

Why does the page say "Converges" but give no sum?

Some series converge to a number with no simple formula the page can find. Σ 1/n² converges (its terms are smaller than those of a telescoping series), and its sum π²/6 is a famous result, but it is not geometric or telescoping, so the page reports convergence only.

How do I type the term?

Use n as the variable: 1/(n (n + 1)), (1/2)^n, (-1)^n/3^n, n^2. For a finite sum, type the last n; for an infinite series, type inf.

How is the answer checked?

A finite sum is added term by term, as a decimal. An infinite sum is compared with the partial sums of 10,000 and 100,000 terms, which must approach it.