Robert Dodier wrote:
> Hello, I find the following expression is problematic for expand
> in the sense that it takes a tremendously long time and a very
> great amount of memory. What makes it so difficult?
>
> Is there a way to expand it from the leaves upward?
> I tried to figure out a way to apply a function from the
> bottom up, but I couldn't figure it out.
>
>
This expression can be "expanded" by rat() or ratexpand() in
approximately 0.03 seconds on my computer.
((128*%pi^2-520*%pi+528)*x^3+(194*%pi^3-248*%pi^2+400*%pi-528)*x)/(97*%pi^3-60*%pi^2-60*%pi)
If you turn off the gcd algorithm by gcd:false, and try rat() you get a
ratio of 2 polynomials in pi and x, of
degree something like 44 in pi.
The general "expand" function doesn't compute GCDs except for numeric
fractions, and thus the answer would
probably be very large, and unsimplified.
I think that expand is slow because it is doing a lot of work. The
"expand" command should almost never be used
on anything but very small expressions. Use rat, ratsimp, ratexpand...
RJF