I have an expression of the form
C1 Exp[a1+b1 x] + C2 Exp[a2+b2 x] + C3 Exp[a3+b3 x] + ...
Where variables C, a, b are all expressions (some simpler than others) that do not depend on x. I don't know beforehand what all of these expressions look like.
I would like to first manipulate this such that the exponentials get factored, so
C1 Exp[a1]Exp[b1 x] + C2 Exp[a2]Exp[b2 x] + C3 Exp[a3]Exp[b3 x] + ...
Then I would like to combine terms of which b are equal, so for instance if we have b3=b2 then I would like to get
C1 Exp[a1]Exp[b1 x] + (C2 Exp[a2] + C3 Exp[a3]) Exp[b2 x] + ...
Now for each term (identified by unique values of b), I would like to get lists of coefficients and exponential terms, so
{C1 Exp[a1], C2 Exp[a2] + C3 Exp[a3]}
and
{b1, b2}.
For the latter, I think I can use Collect and simplify coefficients of functions (Exp[a x])
But how to get to C1 Exp[a1]Exp[b1 x] + (C2 Exp[a2] + C3 Exp[a3]) Exp[b2 x] + ...?
I looked at using Factor[] for factoring out Exp[a1+b1 x] to Exp[a1]Exp[b1 x]. I also considered using FourierTransform[] but that doesn't work either. It gives me a a sum of DiracDelta[]'s but then I still have the same problem.
Kind regards
Boudewijn Verhaar
============
EDIT:
I think I found an answer myself already. But it doesn't work flawlessly.
First, a case where it does work. I define my input expression:
blah = funcC1[x, y, z] Exp[funca1[x, y, z] + I funcb1[x, y, z] t] + funcC2[x, y, z] Exp[funca2[x, y, z] + I funcb2[x, y, z] t] + funcC3[x, y, z] Exp[funca3[x, y, z] + I funcb2[x, y, z] t]
Then I apply
ft = FourierTransform[blah, t, omg]
ft = Collect[ft, DiracDelta[__]]
divideBySqrt2Pi[x_] := Simplify[x/Sqrt[2 Pi]]
ampls = Map[divideBySqrt2Pi, Cases[ft, a_ DiracDelta[b_] -> a]]
diracArgs = Cases[ft, a_ DiracDelta[b_] -> b];
fromDiracArgToFreq[x_] := x - omg
freqs = Map[fromDiracArgToFreq, diracArgs]
This gives me the desired outcome, for ampls:
{E^funca1[x, y, z] funcC1[x, y, z], E^funca2[x, y, z] funcC2[x, y, z] + E^funca3[x, y, z] funcC3[x, y, z]}
and for freqs:
{funcb1[x, y, z], funcb2[x, y, z]}
But if I use as input only the first term
blah = funcC1[x, y, z] Exp[funca1[x, y, z] + I funcb1[x, y, z] t]
Then both statements involving Cases[ft, ...] yield empty lists. And I don't understand why, because the pattern is there.


Exp[a1]Exp[b1 x]autosimplifies toE^(a1 + b1 x). I don't think there's a way to do exactly what you want. However, if it's a question formatting output, there are things one can do to hold the factors (e.g.HoldForm[]orInactive[Exp][...]) and keep the autosimplification from happening. That tends to mess up computations down the line, if not handled carefully. $\endgroup$