I don't know if there is a problem in expand here that can be fixed without
rethinking expand in a major way, but... ratsimp simplifies this
instantaneously to a small expression (remember, the general simplifier
doesn't do GCDs). On the other hand, expand will probably result in a big
mess.
-s
On Mon, Jun 15, 2009 at 4:15 PM, Robert Dodier <robert.dodier at gmail.com>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.
>
> Incidentally this expression originates from trying to construct
> a cubic spline (the cspline function in package interpol) from
> some points like [%pi/2, %pi].
>
> Thanks for any insights,
>
> Robert Dodier
>
> ((2/%pi-1)*(((%pi/2-1)/(%pi-1)-1)
> *((6*(2/%pi-2*(4-%pi)/%pi)/%pi
> -(6*(2*(4-%pi)/%pi-(%pi-2)/(%pi/2-1))/(%pi-1)
> -6*((%pi-2)/(%pi/2-1)-2)*(%pi/2-1)/(%pi*(%pi-1)))
> /(2*((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2)))
> /(((%pi/2-1)/(%pi-1)-1)
> /(2*((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2))
> +2)
> -(6*(2*(2*%pi-5)/%pi-2/%pi)/%pi
> -(6*(2/%pi-2*(4-%pi)/%pi)/%pi
> -(6*(2*(4-%pi)/%pi-(%pi-2)/(%pi/2-1))/(%pi-1)
> -6*((%pi-2)/(%pi/2-1)-2)*(%pi/2-1)/(%pi*(%pi-1)))
> /(2*((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2)))
> /(2*(((%pi/2-1)/(%pi-1)-1)
> /(2*((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2))
> +2)))
> /(2*(2-1/(4*(((%pi/2-1)/(%pi-1)-1)
> /(2*((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2))
> +2)))
> *(((%pi/2-1)/(%pi-1)-1)
> /(2*((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2))
> +2)))
> /((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2)
> +(6*(2*(4-%pi)/%pi-(%pi-2)/(%pi/2-1))/(%pi-1)
> -6*((%pi-2)/(%pi/2-1)-2)*(%pi/2-1)/(%pi*(%pi-1)))
> /((2/%pi-1)*(%pi/2-1)/(2*(%pi-1))+2))
> /2
> +6*((%pi-2)/(%pi/2-1)-2)/%pi)
> *(x^3-x)
> /6
> +2*x
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>