I thought that 'ratexpand' was generally more efficient than 'expand.'
But look at this:
(%i1) gcd : spmod$
(%i2) f : sum(concat(a,k)/(x-concat(p,k)),k,1,5)$
(%i3) g : sum(concat(b,k)/(x-concat(p,k)),k,1,5)$
(%i4) w : f * (diff(g,x) + g^2) - g * (diff(f,x) + f^2)$
(%i5) showtime : all$
Evaluation took 0.00 seconds (0.00 elapsed)
(%i6) ratexpand(w)$
Maxima encountered a Lisp error:
Error in PROGN [or a callee]: The storage for CONS is exhausted.
Currently, 93516 pages are allocated.
This Lisp error happens after much computer whirring (longer
than the time it took me to pour a cup of coffee). The function
'expand' doesn't have this problem:
(%i7) expand(w)$
Evaluation took 00.30 seconds (00.30 elapsed)
It seems that expand didn't cheat:
(%i8) first(%);
Evaluation took 0.00 seconds (0.00 elapsed)
(%o8)
(2*a3*b4*b5)/(x^3-p5*x^2-p4*x^2-p3*x^2+p4*p5*x+p3*p5*x+p3*p4*x-p3*p4*p5)
Barton