I'm trying to use maxima to get some closed form expressions for an
expression I have involving several nested geometric series. Aside from
myriad syntax errors I've made, I noticed the following problem (the
code listing is at the bottom).
I define a function C(s,sp):= A(s+sp)+B(s,sp)+B(sp,s); where A and B
are defined earlier in the code. Clearly, C(s,sp) should be symmetric
in s and sp. However, if I simply type C(s,sp) at the maxima prompt,
what I get isn't. On the other hand, C(x,y) is.
Is this a bug or what am I not understanding?
As always, thanks in advance.
David
Here's the test code:
kill(all);
assume(phi[1](s)>0);
assume(phi[1](sp)>0);
assume(phi[1](s+sp)>0);
assume(phi[0](s)>0);
assume(phi[0](sp)>0);
assume(phi[0](s+sp)>0);
assume(1-abs(phi[1](s))>0);
assume(1-abs(phi[1](sp))>0);
assume(1-abs(phi[1](s+sp))>0);
assume(1-abs(phi[0](s))>0);
assume(1-abs(phi[0](sp))>0);
assume(1-abs(phi[0](s+sp))>0);
assume(1-phi[1](s)*phi[0](s)>0);
assume(1-phi[1](sp)*phi[0](sp)>0);
assume(1-phi[1](s+sp)*phi[0](s+sp)>0);
assume(phi[0](sp+s)*phi[1](sp+s)-phi[0](s)*phi[1](s)<0);
assume(phi[0](sp+s)*phi[1](sp+s)-phi[0](sp)*phi[1](sp)<0);
simpsum:true;
geom(x,m,n):= (x^m-x^(n+1))/(1-x);
B(s,sp):=-phi[1](s)*phi[1](s+sp)*phi[0](s+sp)/(1-phi[1](s+sp)*phi[0](s
+sp))
+(1-phi[1](s))*sum((phi[1](s)*phi[0](s))^n*(
geom( (phi[0](s+sp)*phi[1](s+sp))/(phi[0](s)*phi[1](s)), 1, n-1 )
-phi[1](s+sp)/phi[1](s)
*geom((phi[0](s+sp)*phi[1](s+sp))/(phi[0](s)*phi[1](s)), 0, n-1))
, n , 1, inf );
A(s):=phi[1](s)*(1+phi[0](s))/(1-phi[1](s)*phi[0](s));
C(s,sp):=A(s+sp)+B(s,sp)+B(sp,s);
C(s,sp);
a1:factor(%);
assume(phi[0](x)>0);
assume(phi[0](y)>0);
assume(phi[0](x+y)>0);
assume(phi[1](x)>0);
assume(phi[1](y)>0);
assume(phi[1](x+y)>0);
assume(phi[0](x)*phi[1](x)-1<0);
assume(phi[0](y)*phi[1](y)-1<0);
assume(phi[0](x+y)*phi[1](x+y)-1<0);
C(x,y);
a2:factor(%);
subst(y,sp,a1)$
a3:subst(x,s,%);
ratsimp(a2-a3);
P.S., one last thing, is there some what to tell maxima that a function
is positive? I don't think that I should have to have copies of some of
the assumes.