# Sums and Products

This constructs the sum .
 In[1]:=
 Out[1]=
You can leave out the lower limit if it is equal to 1.
 In[2]:=
 Out[2]=
This makes i increase in steps of 2, so that only oddnumbered values are included.
 In[3]:=
 Out[3]=
Products work just like sums.
 In[4]:=
 Out[4]=
 Sum[f,{i,imin,imax}] the sum Sum[f,{i,imin,imax,di}] the sum with i increasing in steps of di Sum[f,{i,imin,imax},{j,jmin,jmax}] the nested sum Product[f,{i,imin,imax}] the product

Sums and products.

This sum is computed symbolically as a function of n.
 In[5]:=
 Out[5]=
The Wolfram System can also give an exact result for this infinite sum.
 In[6]:=
 Out[6]=
As with integrals, simple sums can lead to complicated results.
 In[7]:=
 Out[7]=
This sum cannot be evaluated exactly using standard mathematical functions.
 In[8]:=
 Out[8]=
You can nevertheless find a numerical approximation to the result.
 In[9]:=
 Out[9]=

The Wolfram Language also has a notation for multiple sums and products. Sum[f,{i,imin,imax},{j,jmin,jmax}] represents a sum over i and j, which would be written in standard mathematical notation as . Notice that in Wolfram Language notation, as in standard mathematical notation, the range of the outermost variable is given first.

This is the multiple sum . Notice that the outermost sum over i is given first, just as in the mathematical notation.
 In[10]:=
 Out[10]=

The way the ranges of variables are specified in Sum and Product is an example of the rather general iterator notation that the Wolfram Language uses. You will see this notation again when we discuss generating tables and lists using Table ("Making Tables of Values"), and when we describe Do loops ("Repetitive Operations").

 {imax} iterate imax times, without incrementing any variables {i,imax} i goes from 1 to imax in steps of 1 {i,imin,imax} i goes from imin to imax in steps of 1 {i,imin,imax,di} i goes from imin to imax in steps of di {i,imin,imax},{j,jmin,jmax},… i goes from imin to imax, and for each such value, j goes from jmin to jmax, etc.

Wolfram Language iterator notation.