Search code examples
maximawxmaxima

wxMaxima: treat division as multiplication (gather overall divisions as multiplicative factor)


I'm wondering if there is any way to tell Maxima to return

1/2*x

instead of

x/2

I'm trying to handle u-substitutions using changevar however, it's returning expressions like:

\frac{\int \cos{u} \de{u}}{5}

whereas I'd like to have it display as

\frac{1}{5} \int \cos(u) \de{u}

or

\int \cos(u) \frac{1}{5} \de{u}

Is this possible? If so, any suggestions as to where to start?


Solution

  • I think the display option pfeformat has the effect you want. By default it's false. Here's what I get when it is enabled:

    (%i2) pfeformat: true $
    
    (%i3) 'integrate(cos(u),u)/5;
                                  /
                                  [
    (%o3)                   (1/5) I cos(u) du
                                  ]
                                  /
    (%i4) tex(%);
    $${{1}\over{5}}\,\int {\cos u}{\;du}$$
    

    The internal form of the expression is the same -- you can call ?print to see what it is -- and pfeformat just changes the way it's displayed.