I have a quite cumbersome expression in Mathematica and browsing through it I can identify that it could be written as
$$f(t) = A e^{a t} + B e^{b t}+ C e^{c t} ...$$
I wanted to be able to use something like Collect[f, {Exp[a t], Exp[b t], Exp[c t], ...}, Simplify], so that I could obtain the expression written as above and simplify the coefficients.
My first take would be to use a ReplaceAll and change each of these exponential to a constant {Exp[a t], Exp[b t], Exp[c t], ...}-> {X, Y, Z, ...} and then apply Collect. However, these exponentials are themselves ugly beasts, and the only way to do the replacements that I found was to go through the cumbersome expression itself and copy-paste each exponential. These worked to some extent, but not fully and is far from satisfactory.
Is there a proper way to collect for a family of functions of a given variable $f_a(t)=e^{a t}$ ? Or a nice implementation of inner product for exponential functions that makes the above substitution systematic?
EDIT: This turned out to be a matter o simple syntax, as pointed out by @Lukas Lang. I now clarify my original question with a minimal example and solution.
First, I meant to collect for functions (mathematical functions) and not necessarily functions in the sense of mathematima f[t_]:= ...
So, the minimal example is
f = A1*Exp[a] + A2*Expa[a] + B1*Exp[b] + B2*Exp[b]
Using
Collect[f,Exp[_]]
we get $$f = (A_1 + A_2)e^{a} + (B_1+ B_2) e^{b}$$
Finally, we use the same syntax to simplify the coefficients. For instance, let $$A_1 = \cos^2(\theta),~A_2 = \sin^2(\theta),~B_1 = 2A_1,~ B_2 = 2 A_2$$
With which we apply Simplify,
fp = f/.{A1 -> Cos[\[Theta]]^2, B1 -> 2 Cos[\[Theta]]^2,
A2 -> Sin[\[Theta]]^2, B2 -> 2 Sin[\[Theta]]^2}
Collect[fp, Exp[_], Simplify]
And obtain, $$f'= e^{a} + 2e^{b}$$
The above is a bit trivial, since one could Simplify the whole expression easily, but it works for me with a very big expression, which simply hitting Simplify would not do.
f
and the output you want. i.e. example input and the output. $\endgroup$Collect[..., Exp[_]]
should already be enough $\endgroup$