(%i76) matchdeclare([aa,bb],true); (%o76) done (%i77) let(aa*bb+aa*cc,aa*(bb+cc)); (%o77) aa*cc+aa*bb --> aa*(cc+bb) (%i78) letsimp((1-b)*x+(1-b)*e); (%o78) -b*x+x-b*e+e I want to get the result of (1-b)*(x+e), how? NOTE: I try to transform (1-e)*y+(1-b)*x+(1-b)*e+b-1 to (1-e)*y + (1-b)*(x+e-1), factor would not help here