Hello, I would like to factorize an expression with sage that contains constant variables (i.e. parameters), but I cannot figure out how to do that.
Here is an example : x, y are variables and A is a parameter
var('A x y')
f = Ax + x + A^2exp(y) + y print (f.factor())
Sage returns 'A^2e^y + Ax + x + y'. Instead, I would like that sage returns '(A+1)x + (A^2+1)exp(y)'.
How to do that ? Thank you