Solving non homogeneous linear equations