### The Maxima on-line user's manual

Algebra Calculator

#### Lsum

Function: lsum (<expr>, <x>, <L>) Represents the sum of <expr> for each element <x> in <L>.

A noun form lsum is returned if the argument <L> does not evaluate to a list.

Examples:

```          (%i1) lsum (x^i, i, [1, 2, 7]);
7    2
(%o1)                      x  + x  + x
(%i2) lsum (i^2, i, rootsof (x^3 - 1));
====
\      2
(%o2)                 >    i
/
====
3
i in rootsof(x  - 1)```

```(%o1)                                true
(%i2) ```

### Related Examples

? lsum;

Calculate

##### lsum-matrix-transpose

t: matrix([t11,t12,t1...

j: matrix([1,0,0],[0,...

z0: list_matrix_entri...

Calculate

##### lsum

f(n) := lsum(5^i^2, i...

Calculate

##### lsum-sum

lsum (1/n^2, n, [1,7]);

Calculate

##### lsum

a:[1,2,3,4,1,2,3];

ae:a/lsum(i,i,a);

Calculate

##### lsum-makelist-random-sum

lsum(k,k,makelist(lsu...

Calculate

##### lsum

a:[1,2,3,4,1,2,3];

be:\exp ^(a);

ae:a/lsum(i,i,a);

Calculate

##### lsum-plot2d

plot2d(1+lsum((1/i!)*...

Calculate

##### lsum-makelist-random

a:makelist(random(2),...

lsum(i,i,a);

Calculate

##### lsum-simpsum

eq1:lsum(4,n,N),simpsum;

Calculate