I'm sorry but I still do not get the logic. Suppose I have something like x**4*f(x)**2 / (1 - x**2 * f(x)) I wouldn't want to substitute x power 4, I would want to substitute x power 2. Also could you explain the need of using a generator here. I'm not clear.