Solving linear equations with two variables