I think you should not be using rules for one-time substitutions of names
for constant subexpressions.
You might find that subst or ratsubst does what you want.
As for the possibility that maxima's automatically simplified and formatted
results will look different from what you wish, this is inevitable because
of the variety of uses of mathematics. Consider the sequence of formulas:
f=ab
f=ac
f=ad
f=ae
...
f=ak
f=al
f=ma ... because Newton said F=ma ?
f=an
My experience is that you cannot expect the program to get exactly the
nicest form for complicated expressions. It may be better to present the
answers as they come out of the computer program, rather than double the
size of your program to get the format just right.
If you test the computer systems that claim to do freshman calculus
problems, compare the answers to those "in the back of the book". They are
often different. The typeset answers in the back of the book are often
smaller and neater.
As for introductory material on maxima, you could look at the commercial
macsyma documentation, which might help.
http://www.cs.berkeley.edu/~fateman/macsyma
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Hugemann
> Sent: Wednesday, September 06, 2006 4:12 AM
> To: maxima at math.utexas.edu
> Subject: Re: [Maxima] Simplification problem
>
> > matchdeclare([a,b],true);
> > defrule(h,log(a) - log(b),log(a/b));
> > apply1([expression], h);
>
> I tried to apply this to a very simple example:
>
> matchdeclare([a,b],true);
> defrule(h,log(a) - log(b),log(a/b));
> log(a) - log(b);
> apply1(%, h);
>
>
> and it did not work: by default, the logarithms are splitted.
> Thus the second line already gives the following output:
>
> h : log(a) - log(b) -> log(a) - log(b)
>
> and applying this rule does of course lead to nothing.
>
> ..........
>
> logcontract(%), though, works with this simple example, but
> applying it at the end of my code really makes things messy...
>
> I've got a little bit further by adding the following lines
> to my code:
>
> sol:radcan(%);
> defrule(h1,2*v0^2-4*a*t*v0+2*a^2*t^2,2*(v0-a*t)^2);
> defrule(h2,-2*v0^2+4*a*t*v0-2*a^2*t^2,-2*(v0-a*t)^2);
> apply1(sol,h1);
> apply1(%,h2);
>
> ..........
>
> The instruction
>
> defrule(h,log(v0-a*t) - log(v0),log(1-a*t/v0));
>
> really works in priciple, but applying it to the output of
> the last apply1-operation again leads to nothing.
>
> ..........
>
> Besides my actual problem, again the question: Is there any
> 'real life'
> introduction to Maxima? What reading would you suggest? The
> PDFs I have found so far are either comprising (maxima.pdf)
> or rather short (intromax.pdf). I don't feel that I have
> learned how to really work with Maxima.
>
> I am writing a book at the moment and I would like to provide
> the reader with automated Maxima proofs in order to keep the
> book's text as short as possible.
>
> Of course, I could take Maxima's solution of the ODE and
> massage it by hand, but this is not my intention!
>
> Greatings from M?nster, Germany
> Wolfgang Hugemann
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>