Simplifying expressions with variables and coefficients