answered 4 years ago
I am not sure about the context, but you can do:
sage: (f/x^2).expand() * x^2 (x + 3/x)*x^2