For the example in OP FullSimplify
gives the desired result:
FullSimplify [(5 + 3 x)/(2 + 3 x)]
1 + 3/(2 + 3 x)
To take a different example for which neither Simplify
nor FullSimplify
makes the desired simplification without additional work:
expr = (5 + 2 x)/(2 + 3 x);
Simplify @ expr
(5 + 2 x)/(2 + 3 x)
FullSimplify @ expr
(5 + 2 x)/(2 + 3 x)
"to minimize the number of occurrences of the variables" you can use a custom ComplexityFunction
that penalizes multiple occurences of symbols. For example,
cF = Simplify`SimplifyCount[#] + 100 Count[#, _Symbol, All] &;
Using it with FullSimplify
FullSimplify[expr, ComplexityFunction -> cF]
2/3 + 11/(6 + 9 x)
With Simplify
we need to do more:
Simplify[expr, ComplexityFunction -> cF]
(5 + 2 x)/(2 + 3 x)
Adding Apart
to the Automatic
TransformationFunctions
used by Simplify
gives the desired result:
Simplify[expr, ComplexityFunction -> cF, TransformationFunctions -> {Automatic, Apart}]
2/3 + 11/(6 + 9 x)