Solving linear equations with subtraction