I have a long and complex univariate expression with many parameters, $ f(x; a, b, c, d, ...) $.
I would like to group those parameters which only ever occur together.
Here is a very simple example where we can find the appropriate grouping by inspection:
f[x_] = (a + b) Exp[-c x] + (Exp[-d x]/(a + b))
How might I get Mathematica to recognize that
b only occur as a sum
a + b, never independently? I'd ultimately like Mathematica to to generate two expressions, like this:
f[x_] = r Exp[-c x] + (Exp[-d x] / r) and
r = a + b.
FullSimplify don't seem to be willing to define new parameters like
r to make the original expression for
f[x] look prettier.
Here are some additional examples with the desired output:
g[x_] = a*b*c Exp[-c x] + (Exp[-d x]/(a*b*c)) -->
g[x_] = r*c Exp[-c x] + (Exp[-d x]/(r*c)) and
r = a*b
h[x_] = (a - b)/(c + d) Exp [-c x] + Log[ (a - b)/(c + d) ] -->
h[x_] = r/(c + d) Exp [-c x] + Log[ r/(c + d) ] and
r = a - b
j[x_] = (a/b)*c Exp[-c x] + (Exp[-d x]/(a*b*c)) --> no simplification
(The real expression is far more complicated, which is why going through it and manually finding these combinations is not practical.)