How to | Evaluate Infinite Sums and Products
In calculus, infinite sums and products can pose a challenge to manipulate by hand. The Wolfram Language can evaluate a huge number of different types of sums and products with ease.
Use Sum to set up the classic sum
, with the function to sum over as the first argument. Use the Wolfram Language's usual range notation {variable,minimum,maximum} as the second argument:
Sum[1 / n ^ 2, {n, 1, Infinity}]This also works for finite sums like
:
Sum[1 / n ^ 2, {n, 1, 100}]Use 1. to get the decimal representation:
Sum[1. / n ^ 2, {n, 1, 100}]Limit[Abs[Pi ^ 2 / 6 - Sum[1 / n ^ 2, {n, 1, k}]], k -> Infinity]Some functions have an infinite sum representation, and the Wolfram Language will recognize these. For example
:
Sum[1 / n ^ s, {n, 1, Infinity}]Many functions have product representations as well, and the Wolfram Language will even recognize these.
Use Product to check
, a function found by the mathematician Euler. The arguments of Product have the same form as Sum:
Pi z Product[1 - z ^ 2 / n ^ 2, {n, 1, Infinity}]Even more abstract functions will be recognized; the Product representation of
involves the set of prime numbers:
Product[1 / (1 - Prime[k] ^ -s), {k, 1, Infinity}]