Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Sum Calculator

Sum

Function: sum (<expr>, <i>, <i_0>, <i_1>) Represents a summation of the values of <expr> as the index <i> varies from <i_0> to <i_1>. The noun form sum is displayed as an uppercase letter sigma.

numer:true;
x:[166,187,169,191,175,161,176,170,195,197,187,168,171,161,173];
n:length(x);
m:1/n*sum(x[i],i,1,n);
v:1/n*sum((x[i]-m)^2,i,1,n);
s:sqrt(v);
display(m,v,s);

sum evaluates its summand <expr> and lower and upper limits <i_0> and <i_1>, sum quotes (does not evaluate) the index <i>.

If the upper and lower limits differ by an integer, the summand <expr> is evaluated for each value of the summation index <i>, and the result is an explicit sum.

Otherwise, the range of the index is indefinite. Some rules are applied to simplify the summation. When the global variable simpsum is true, additional rules are applied. In some cases, simplification yields a result which is not a summation; otherwise, the result is a noun form sum.

When the evflag (evaluation flag) cauchysum is true, a product of summations is expressed as a Cauchy product, in which the index of the inner summation is a function of the index of the outer one, rather than varying independently.

The global variable genindex is the alphabetic prefix used to generate the next index of summation, when an automatically generated index is needed.

gensumnum is the numeric suffix used to generate the next index of summation, when an automatically generated index is needed. When gensumnum is false, an automatically-generated index is only genindex with no numeric suffix.

See also sumcontract, intosum, bashindices, niceindices, nouns, evflag, and zeilberger.

Examples:

          (%i1) sum (i^2, i, 1, 7);
          (%o1)                          140
          (%i2) sum (a[i], i, 1, 7);
          (%o2)           a  + a  + a  + a  + a  + a  + a
                           7    6    5    4    3    2    1
          (%i3) sum (a(i), i, 1, 7);
          (%o3)    a(7) + a(6) + a(5) + a(4) + a(3) + a(2) + a(1)
          (%i4) sum (a(i), i, 1, n);
                                      n
                                     ====
                                     \
          (%o4)                       >    a(i)
                                     /
                                     ====
                                     i = 1
          (%i5) sum (2^i + i^2, i, 0, n);
                                    n
                                   ====
                                   \       i    2
          (%o5)                     >    (2  + i )
                                   /
                                   ====
                                   i = 0
          (%i6) sum (2^i + i^2, i, 0, n), simpsum;
                                        3      2
                             n + 1   2 n  + 3 n  + n
          (%o6)             2      + --------------- - 1
                                            6
          (%i7) sum (1/3^i, i, 1, inf);
                                      inf
                                      ====
                                      \     1
          (%o7)                        >    --
                                      /      i
                                      ====  3
                                      i = 1
          (%i8) sum (1/3^i, i, 1, inf), simpsum;
                                          1
          (%o8)                           -
                                          2
          (%i9) sum (i^2, i, 1, 4) * sum (1/i^2, i, 1, inf);
                                        inf
                                        ====
                                        \     1
          (%o9)                      30  >    --
                                        /      2
                                        ====  i
                                        i = 1
          (%i10) sum (i^2, i, 1, 4) * sum (1/i^2, i, 1, inf), simpsum;
                                            2
          (%o10)                       5 %pi
          (%i11) sum (integrate (x^k, x, 0, 1), k, 1, n);
                                      n
                                     ====
                                     \       1
          (%o11)                      >    -----
                                     /     k + 1
                                     ====
                                     k = 1
          (%i12) sum (if k <= 5 then a^k else b^k, k, 1, 10);
                    10    9    8    7    6    5    4    3    2
          (%o12)   b   + b  + b  + b  + b  + a  + a  + a  + a  + a

There are also some inexact matches for sum. Try ?? sum to see them.

(%o1)                                true
(%i2) 

Sum Example

Related Examples

sum

f(n) := (-1/2)^n;

sum(f(n), n, 1, 2);

Calculate

sum

prod(n^8,n,1,5);

sum(i*6,i,1,4);

Calculate

sum

sum(n,n,1,100);

Calculate

sum

sum((1/n)*(1+((1+2*i)...

Calculate

sum

sum(1/k^2,k,1,Inf);

Calculate

sum

sum(n,n,1,4);

Calculate

sum

sum(i,i,1/1,1/20);

Calculate

sum

n:4;

eq1:sum(1/2*(n-i+1)*(...

sum((n-i+1)*(n-i+2),i...

Calculate

sum

sum(k^8/3^k,k,0,30);

Calculate

sum

sum(n,n,1,n);

Calculate