# [Maxima] Q: How to control rewriting

Enrique Perez-Terron enrio at online.no
Tue Apr 3 18:15:26 CDT 2012

```Hello,

I have an expression of the form

A*B*C*D
EQ1: F = ---------
E

where C/E has a particular simplification.

I would like to have this expression rewritten on the form

C
EQ2: F = A*B*D*---
E

This would allow me to use, e.g.

substpart( simplify(piece), EQ2, 2, 4 )

My question is how to produce EQ2 from EQ1, short of rewriting manually or
copying and pasting.
I am clumsy; when I do complex things manually I invariably do mistakes,
forget a parenthesis or whatever, so I would like to have methods of doing
this where I either get an error message or I get something that is
mathematically equivalent to what I started with.

Maybe

A: part(EQ1, 2,1,1)
B: part(EQ1, 2,1,2)
C: part(EQ1, 2,1,3)
D: part(EQ1, 2,1,4)
E: part(EQ1, 2,2)
F: part(EQ1, 1)

EQ2: F = A*B*D*(C/E)

EQ1 - EQ2

would be an approach, where the last line is the control. (Assume that the
letters A-E are actually not in use up to this point.)

Now, this could work, but it is quite a bit of writing. I wish something
more legible too.

How can I do this?

Thanks
Enrique
```