Question: How to apply a recursive rule in an expression?

Hi guys,

let's say that we have an ugly, massive long expression with high power products of variables for example this:

x^10*y^2+x^9*y^8+x^7*y^3+x^5*y+x*y+y

and we want to reduce the powers of these variables using these rules:

x^3=a*x+y , x^2*y=b*x+c*y , x*y^2=x+d*y , y^3=e*y

so what i want is something that recursively apply those rules to the above expression until there is no product greater than 1,

is there any command to do this?

PS: I have already tried algsubs and applyrule but they didn't fully satisfy what I wanted

Please Wait...