Factor ac+xc+aw^2+xw^2