Question: Pattern to remove all products of two variables from expression?

This came up in another language. I tried to solve it in Maple, but I am newbie so did not know how to.

The problem is to remove all products of  "a^n*b^m" that shows up in an expression, including any powers of "n,m". For example, given these three expressions

f0 := a^4+4*a^3*b +6*a^2*b^2+4*a*b^3+ b^4;
f1 := 3*(a*b -2*c);
f2 := (a*b -2*c)/(c - a*b);

Then applying the transformation needed, will result in

f0:= a^4+b^4;
f1:=-6*c;
f2:=-2;

Becuase the transformation will detect any a^n*b^m and simply replace this product by zero
from the resulting expression. So "a*b^2 + 2" will become "2", and so on.

I assume a function such as "patmatch" or "match" is needed. I tried, but could not figure how.
I also tried algsubs. How would this be coded in Maple?


Please Wait...