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


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!


1 Answer 1


To avoid potential naming conflicts, you should avoid using capital letters to start user-defined variables/functions (e.g., A and B). In the desired result a factor of A can be cancelled.

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

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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.