display expression exactly as entered



You can disable Maxima's default transformations a.k.a. general
simplification, by setting simp:false.

However, this breaks most of Maxima's functionality.  For example:

(%i4) simp:false;
(%o4) false
(%i5) (W/4)*(1/(1+x));
(%o5) W/4*(1/(1+x))
(%i6) diff(%,x);
(%o6) 'diff(1/(1+x),x,1)*(W/4)+0*(1/(1+x))

In this case, 0*(1/(1+x)) is not simplified to 0, diff(1/(1+x),x,1) is not
performed.  This second case may seem mysterious until you understand that
Maxima normally does not use a division operator internally, but transforms
it to multiplication and exponentiation -- (a/b) internally is actually a *
b^-1, as you can see in the Lisp representation:

(%i7) ?print(a/b)$
((MQUOTIENT) $A $B)
(%i8) simp:true$
(%i9) ?print(a/b)$
((MTIMES SIMP) $A ((MEXPT SIMP) $B -1))

You can also block default simplifications by using the "box" function (and
set boxchar:" " if you want the boxes to be invisible).

But this doesn't guarantee to preserve order:

(%i3) box(W/4)*box(1/(1+x));
(%o3) box(1/(x+1))*box(W/4)

And Maxima functions treat boxes as unknown functions:

(%i4) diff(%,x);
(%o4) 'diff(box(1/(x+1)),x,1)*box(W/4)

Why exactly do you want to preserve your input form?  Is it because you find
it more intuitive when you're manipulating the expression?  Because you want
to present this form as part of your output?  Because you want to do
transformations which depend on the form of the expression?

In the last case, you might want to look at ratsubst rather than subst:

(%i5) expr: (W/4)*(1/(1+x));
(%o5) W/(4*(x+1))
(%i6) subst(q,W/4,%);
(%o6) W/(4*(x+1))                         <<< W/4 is not syntactically
present in expr
(%i7) ratsubst(q,W/4,%);
(%o7) q/(x+1)                               <<< but ratsubst recognizes it

Does that help?

            -s


On Mon, Oct 24, 2011 at 10:01, Ether Jones <maxima at etherjones.us> wrote:

> Hello,
>
> Is there a way to force maxima to display an expression exactly as I have
> entered it, rather than "simplifying" it for me?
>
> For example, when I enter (W/4)*(1/(1+x)) it displays as   W/(4*(x+1))
>
> Please see attached WXM file or the PNG screenshot.
>
> Thank you.
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>