Sums and products

Example 1. Calculation of an infinite sum symbolically. After that we solve it numerically and show the double precision result with 16 decimal digits by clicking on the result and pressing the ENTER key.

Underoverscript[∑, i = 1, arg3] 1/i^2 N[%]     (* Takes numerical result from the previous output . *)

π^2/6

1.64493

RowBox[{1.64493, }]

We could always tray to write the formulae by the standard way by the function Sum[ ]  in the form:

Sum[1/i^2, {i, 1, ∞}]

π^2/6

Example 2. When possible, Mathematica find the exact formulae:

Underoverscript[∑, i = 1, arg3] iUnderoverscript[∑, i = 1, arg3] i^2 Underoverscript[∑, i = 1, arg3] i^3

1/2 n (1 + n)

1/6 n (1 + n) (1 + 2 n)

1/4 n^2 (1 + n)^2

Example 3. The multiple sums can contain the indices depending from the previous, for instance k=1, ..., n and  m=k, ..., n:

s1 = Underoverscript[∑, k = 1, arg3] Underoverscript[∑, m = k, arg3] (k * m)

1/24 n (1 + n) (2 + n) (1 + 3 n)

Example 4. One can calculate special sums depending on variables and constants:

s2 = Underoverscript[∑, k = 0, arg3] Underoverscript[∑, m = 0, arg3] x^ky^m

-(1 - x^(1 + n) - y + x^(2 + n) y + x y^2 (x y)^n - x^2 y^2 (x y)^n)/((-1 + x) (-1 + y) (-1 + x y))

Example 5. Attempt to calculate the infinite sum symbolically, but since it cannot,  the system shows the inital formula instead of the result. After that we solve the truncated sums and receive a result in the form of a standard of decimal fraction by choice. By inreasing the upper bound we can find the approximate value of the sum.

Underoverscript[∑, i = 1, arg3] Underoverscript[∑, j = 1, arg3] (1/(i^3 + j^3))

RowBox[{Underoverscript[∑, i = 1, arg3], RowBox[{Underoverscript[∑, j = 1, arg3], RowBox[{1., /, (i^3 + j^3)}]}]}]

Underoverscript[∑, i = 1, arg3] Underoverscript[∑, j = 1, arg3] (1/(i^3 + j^3)) &n ... will,  , asure,  , to,  , operate,  , with,  , real,  , number}], ,,  , not fractions}], *)}]}]}]

14549951251313062169970617/12017679094033690960512000

1.21071

1.21071

RowBox[{RowBox[{Underoverscript[∑, i = 1, arg3], RowBox[{Underoverscript[∑, j = 1, ... owBox[{Underoverscript[∑, j = 1, arg3], RowBox[{(, RowBox[{1., /, (i^3 + j^3)}], )}],  }]}]

1.34862

1.36353

RowBox[{Underoverscript[∑, i = 1, arg3], RowBox[{Underoverscript[∑, j = 1, arg3], RowBox[{(, RowBox[{1., /, (i^3 + j^3)}], )}],  }]}]

1.36437

We obtained an absolute error of 2 decimal digits, so the sum is 1.36.

Example 6. Now Example 5 is written in a standard form. In addition the numerical summation algorithm is applied by the function NSum[ ].

Sum[1/ (i^3 +j^3), {i,1,Infinity },{j,1,Infinity }]
Sum[1/ (i^3 +j^3), {i,1,100}, {j,1,100}];
% //N
NSum[1/(i^3 + j^3),{i,1,2000},{j,1,2000}]

Underoverscript[∑, i = 1, arg3] Underoverscript[∑, j = 1, arg3] 1/(i^3 + j^3)

1.34862

RowBox[{RowBox[{1.36202, }], +, RowBox[{0.,  , }]}]

Example 7.  Here is a case when the index variable increases with a value of 3. The result is given by 16 decimal digits.

Sum[1/i^3,{i, 1,33,3}]
N[%,16]

13387308346588554663968149
--------------------------
13116805863727582016000000
1.020622587973876

Example 8. Calculating a product is easy by analogy. The operators which end with ; do not show output data. This is convenient when it is bulky or of no interest.

Product[1/i^2, {i,1,100}];  N[%]
Product[1/i^2, {i,1,Infinity}]
NProduct[1/i^2, {i,1,Infinity}]  (*  NProduct uses numerical method of calculation *)

1.148134297558721*10^-316

1.3463*10^-157

0

0

We can also do it with mathematical symbolics, by using te palette:

Underoverscript[∏, i = 1, arg3] 1/i^2 ; %//N

1.148134297558721*10^-316


Created by Mathematica  (December 21, 2007)