# Simplifying a fraction with bringing in new variables

Let's say I have a fraction like this:

(a b x^2 + a^3 x) / (a^2 b x)


and I would like to simplify it by multiplying both the numerator and the denominator with

1/x^4


while introducing the following:

a/x = A and b/x = B


So in the end I'd get:

(A B + A^3) / (A^2 B)


Is there a way to do this in Mathematica?

Thank you!

(a b x^2 + a^3 x)/(a^2 b x) /. {a -> A*x, b -> B*x} // Simplify // Together