Solving for x in linear equations