mathematica pull out common factor