[GiNaC-devel] Powers of exponents
Francois Maltey
fmaltey at nerim.fr
Sun Oct 4 22:14:47 CEST 2009
Hello everybody,
I'm a new ginac user because I discover sage. So you might excuse my
point of view if my arguments are out of ginac purpose. And this message
isn't direct reponse for this patch.
// 1 //
I understand that ginac operates over complex analysis as the other
computer algebra systems.
In this case it's very curious to write exp(u)^v == exp(u*v).
Fine choices of "branch cuts" may allow this point of view for a local
study,
but it isn't usual mathematics for general purpose.
You understand I don't like the exp(u)^v == exp(u*v)
// 2 //
It' bad if exp(x)/exp(x) remains : sage reduces sin(x)/sin(x) == 1 as
usual.
I don't know the inner algorithms of ginac but I suppose that all
function calls as sin(x) are seen as a new variable in the expression
which is a fraction with a lot of variables, even if someones as sin(x)
and cos(x) are linked together by cos(x)^2+sin(x)^2==1.
So exp(x)/exp(x) must be simplified in 1.
// 3 //
Look at sin(x) and cos(x).
Sometimes the user prefers the expanded formula with Tchebytchev polynomials
(cos(2x)+1)/(sin(2x)) == (2 cos(x)^2)/(2 sin(x) cos(x)) == cos(x)/sin(x)
== cotan(x).
Othertimes the user wants to combine 2 cos(x)^2 into the (almost) linear
form cos(2x)+1.
Computer algebra systems don't have any automatic transform
but the user calls the expand or the combine function for theses
opposite purposes.
Calculus are similar with exp : both transforms exp(x)^2 <==> exp(2*x)
are useful.
I observe that ginac respects algebraic user input :
by example there are very view transform with
x = 2*t/(1-t^2) ;
x.subs(t=x) == 4*t / (1 - (2*t/(1-t^2))^2)
Then the user calls expand, "simplify_fractions" or others functions if
he wants an other form of this input.
power and exp functions might be in the same case :
exp(x)^2 remains exp(x)^2 and exp(2*x) remains exp(2*x).
Then an expand call translates exp(2*x) to exp(x)^2
and a combine (or an other name) translates back exp(x)^2 to exp(2*x)
If it does so, ginac respects also the user choice for the exp function
as it does for the fractions.
More information about the GiNaC-devel
mailing list