Combining like terms in a quadratic expression