Solving systems of equations with two variables