Problem and result in one line



Maxima is not set up to do what you want very easily.

The problem is that the standard simplifier is responsible for the
transformations sqrt(4)=>2 and 6/3=>2.  In general, Maxima is not very
good at dealing with unsimplified expressions, and it is difficult to
prevent simplifications like this without turning off simplification
globally (simp:false).

There *are* tricks which would allow you to do this, but I suspect
they will cause more problems down the line.   In particular, you
would have to have simplification turned off when you *call* your
show_simplification function.  It can be done.... like this for
example:

(C1) simpequation: a=b$
(C2) showsimp(expr):=
?list(?car(simpequation),expr,block([simp:true],expand(expr,0,0)))$
(C3) simp:false;
(D3) 							  FALSE
(C4) showsimp(sqrt(4));
(D4) 						       SQRT(4) = 2

... but this will not work if simp is globally true, and in general,
Maxima does not work
very well with simp:false....

(C5) simp:true;
(D5) 							   TRUE
(C6) showsimp(sqrt(4));
(D6) 							  2 = 2

On Mon, 28 Mar 2005 00:09:50 +0100, Poul Riis  wrote:
> If I define
> integ(f,x):='integrate(f,x)=integrate(f,x);
> I can type
> integ(x^2,x) and get the problem and the result written in one line.
> How can I do something similar with simple reductions, for instance
> 6/3=2
> or
> sqrt(4)=2
> ?