I forgot to cc the group in my respond to Daniel Lemire...
I have recently suggested
1. Never use the maxima command ev.
Let me add to it:
2. Never use the maxima command expand except for
little demonstration programs which don't do anything
serious.
If you want to put expressions over a common
denominator and simplify them, and incidentally
run about 10-100 times faster, use ratsimp().
Or use rat() in which case all the rational
simplifications will be done contagiously.
There are some other commands that might be useful,
like ratexpand().
Even so you have found a serious bug in the interaction between
the particular lisp system and Maxima. It works
(gives 0) in Allegro Common Lisp.
My expectation is that the simultaneous use of
A and a confuses some part of the simplifier
that depends on the sorting order of the symbols.
... in particular, alphalessp thinks |$a| > $A and $A > |$a|.
one of the GCL hackers should fix this.
There is an easy work-around for this bug.
If you do something like substitute AA for A you will get
zero. Maxima can do this: subst(AA,A,%);
So it is either a GCL bug or it is a bug in the
source code that is particular to GCL.
You can avoid it by not using the same symbols with
different capitalization.
Or a different compiled version of Maxima.
Good luck!
RJF