how to solve equations with variables on both sides