Question: How to replace many variables with one

How can I replace/substitute a combination of variables with a new variable?

For example, if ...


I want to assign the value g:=1+i

so that h returns g^2+g^3*A+g^4*B

Do I have to change the 1+i to a name? or can it be done as it is?

Please Wait...