Finding the inverse of a rational function with a root as a denominator