how to evaluate the algebraic expressions