Hi Francois, On Mon, 21 Sep 2009 21:22:39 +0200 Francois Maltey <fmal...@nerim.fr> wrote:
<snip> > Concretely > ??? I'll don't see how to operate over exp(2x) => exp(x)^2. > ??? Is there a hold (or freeze) function in sage which remains > exp(a)^2. Also look at integrate (exp(2*x)/(exp(3*x)+1), x). The > changevar is y=exp(x) in y^2/(y^3+1). Unfortunately there is no hold function for symbolic expressions ATM. Although this is supported by GiNaC, I don't see an immediate way to expose this functionality with the current wrapper. I'll try to think of a solution for this. > Maybe sage (or pyginac) has too haste to transform exp(a)^2 to > exp(2a). ??? Might I have arguments about this choice ? Of course you can. I consider symbolics in Sage very much a work in progress, and any suggestion for improvement is more than welcome. I see your point about simplifying exp(x)^2 to exp(2*x) now. The main reason I left this simplification while fixing #6948 was that MMA does things this way. Another consideration was that before performing any nontrivial operation on symbolic expressions (integration, transforms, etc.), we would have to perform some normalization, and this seemed like a normal form as it is. As a workaround, you can do the following to replace exp(x) with y in the example above: sage: t = exp(2*x)/(exp(3*x)+1) sage: w = SR.wild() sage: match_list = t.find(exp(w*x)); match_list [e^(2*x), e^(3*x)] sage: match_list[0].match(exp(w*x)) {$0: 2} sage: for i in match_list: ....: exponent = i.match(exp(w*x))[w] ....: t = t.subs(i == y^exponent) ....: sage: t y^2/(y^3 + 1) If you think it'll help, I can probably prepare a pynac package that disables the automatic simplification of exp powers. I don't have time to submit that to Sage (say, as an alternative solution to #6948), but it's not hard to do this for experimental purposes. Thank you. Burcin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---