Problem A: The integral of the floor function |_x_|. Integrate[ |_x_|, {x, 0, a} ] = (2a - |_a_| - 1)*|_a_|/2 Solution A: Integrate[ |_x_|, {x, 0, a} ] = Integrate[ |_x_|, {x, 0, |_a_|} ] + Integrate[ |_x_|, {x, |_a_|, a} ] = Sum[ x, {x, 0, |_a_|-1} ] + (a - |_a_|)*|_a_| = |_a_|*(|_a_|-1})/2 + (a - |_a_|)*|_a_| = (2a - |_a_| - 1)*|_a_|/2 Problem B: 1 / [ 1 I -------- dx ] 1 / floor(-) 0 x - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Bill Gosper [1998-12-06 Sunday] wrote: (c309) integrate(1/floor(1/x),x,0,1); INTEGRATE could not determine whether there are poles in the interval of integration. Continuing... Time= 350 msecs 1 / [ 1 (d309) I -------- dx ] 1 / floor(-) 0 x To do it with Macsyma, we'll have to help. (It seems like the elementary stuff always turns up more shortcomings than the advanced stuff.) Change variables to unreciprocate the FLOORand: (c310) changevar(%,x=1/t,t,x); Time= 75 msecs inf / [ 1 (d310) I ----------- dt ] 2 / t floor(t) 1 Break the range into unit intervals. (Maybe this should be a command.) (c311) substpart(n+1,substpart(n,%,3),4); Time= 13 msecs n + 1 / [ 1 (d311) I ----------- dt ] 2 / t floor(t) n (c312) sum(''(subst(floor(n),floor(t),%)),n,1,inf); Time= 61 msecs n + 1 / [ 1 I -- dt inf ] 2 ==== / t \ n (d312) > ------------ / n ==== n = 1 We shouldn't have needed to tell it that floor(t) = floor(n) for n --------- / n ==== n = 1 (c314) closedform(%); NEWTON:>climax>library1>specfn.ibin.12 being loaded. Time= 29099 msecs 2 %pi (d314) ---- - 1 6 On the other hand, if you simply PLOT(1/floor(1/x)), you'll see that the integral is obviously the disjoint union of half-squares, of total area (c315)(1/2+sum((1/n-1/(n+1))^2/2,n,1,inf),%%=closedform(%%)); Time= 1007 msecs inf ==== \ 1 1 2 > (- - -----) 2 / n n + 1 %pi ==== ---- - 3 n = 1 1 3 1 (d315) ------------------ + - = -------- + - 2 2 2 2 The equivalence of the two infinite sums can also be shown with summation by parts: (c316) d313=sumbyparts(d313,1/(n-1)/n/(n+1)); NEWTON:>climax>library1>result.ibin.6 being loaded. Time= 9422 msecs inf ==== \ 1 > ----------- inf 1 1 / 2 2 ==== - - ----- ==== n (n + 1) \ n n + 1 n = 1 (d316) > --------- = ----------------- / n 2 ==== n = 1 1 1 (inf + 2) (------- - -------) inf + 1 inf + 2 1 - ----------------------------- + - 2 (inf + 1) 2 Oops, sumbyparts needs to take limits: (c317) substpart(limit(subst(oo,inf,piece),oo,inf),%,2,2); Time= 202 msecs inf ==== \ 1 > ----------- inf 1 1 / 2 2 ==== - - ----- ==== n (n + 1) \ n n + 1 n = 1 1 (d317) > --------- = ----------------- + - / n 2 2 ==== n = 1 The determination of 1/(n-1)/n/(n+1) as the right "dv" for the (apparently shipping, but undocumented) sumbyparts function was rather neat, but used experimental, nonshipping features. I can provide it, and probably a derivation using only shipping features, if anyone asks.