mutiple integral



  This is an example of multiple integral in maxima:

  Integrate(x^3*y^3,[x,a,b],[y,c,d]);

(b^4/4-a^4/4)*(d^4/4-c^4/4)

 Integrate is defined by:

 mosca(ff)::=buildq([f:ff],lambda([[l]],(re:l[1],for i:2 thru length(l) do 
if listp(l[i]) then re:apply(f,cons(re,l[i])) else re:f(re,l[i]),re)));

Integrate:mosca(integrate);



  using the same pattern (mosca)  you can obtain for example:

  multidimensional sum:

  Sum:mosca(sum);


   Sum(a[i]^2+b[j]^3,[i,1,3],[j,1,3]);

  3*b[3]^3+3*a[3]^2+3*b[2]^3+3*a[2]^2+3*b[1]^3+3*a[1]^2


  the only problem is that the free variable i in the for loop can conflict with
the free variable in the function.