> That works well, but what about when the expression is multivariate, > such as: > > expand((1+x+1/y)^10) > > It would be nice to have a general command to count the number of > summands in such an expression. >
Yep, I agree. Here is a *terrible* way to do it: sage: var('x,y') (x, y) sage: f = x+y + 1 sage: len(expand(f._maxima_())) 3 sage: len(expand((f**4)._maxima_())) 15 Someone should file an enhancement ticket to do this in a more sensible way. I also have no idea whether or not it works with anything more complicated than rational functions -- do you want to use just rational functions? It might be better to just work with polynomial rings and their fraction fields ... -cc --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---