Consider expression $\frac{a - b}{a + b}$. When I apply $FullSimplify[\frac{a - b}{a + b}]$, I get $-1 + \frac{2a}{a+b}$, effectively getting rid of $b$ in the numerator. However, I want to get rid of $a$ and get $1 - \frac{2b}{a+b}$. How do I do this?
In general, I have a more complicated fraction, with multiple variables (and $FullSimplify$ simply does nothing). You can assume that the variable I want to get rid of participates linearly in both numerator and denominator (but its coefficients can be mildly complicated expressions in terms of other variables).
FullSimplify[(a - b)/(a + b) /. a -> d] /. d -> a
answers your question as written but is not very satisfying. In general, the user's idea of simplification often differs from Mathematica's idea.. Using a combination ofCollect
andFullSimplify
sometimes is useful. By the way, I would have expectedcf[e_] := LeafCount[e] + 100 Count[e, a, {0, Infinity}]; FullSimplify[(a - b)/(a + b), ComplexityFunction -> cf]
to solve your specific problem, but it does not. $\endgroup$