For given an expression like
$-\frac{e^{-\frac{\text{d1} t}{\text{c1}}} \left(-\text{a1} \text{a2} \text{d1}^2+\text{a1} \text{b2} \text{c1} \text{d1}+\text{a2} \text{b1} \text{c1} \text{d1}-\text{b1} \text{b2} \text{c1}^2\right)}{\text{c1} \text{d1} (\text{c2} \text{d1}-\text{c1} \text{d2})}-\frac{e^{-\frac{\text{d2} t}{\text{c2}}} \left(-\text{a1} \text{a2} \text{d2}^2+\text{a1} \text{b2} \text{c2} \text{d2}+\text{a2} \text{b1} \text{c2} \text{d2}-\text{b1} \text{b2} \text{c2}^2\right)}{\text{c2} \text{d2} (\text{c1} \text{d2}-\text{c2} \text{d1})}+\frac{\text{b1} \text{b2}}{\text{d1} \text{d2}}$
The Mathematica code of this expression is
(b1 b2)/(d1 d2) - ((-b1 b2 c1^2 + a2 b1 c1 d1 + a1 b2 c1 d1 -
a1 a2 d1^2) E^(-((d1 t)/c1)))/(
c1 d1 (c2 d1 - c1 d2)) - ((-b1 b2 c2^2 + a2 b1 c2 d2 + a1 b2 c2 d2 -
a1 a2 d2^2) E^(-((d2 t)/c2)))/(c2 d2 (-c2 d1 + c1 d2))
How to expand it into $\sum _{i=0}^{\infty } a_i e^{b_i}$ within Mathematica?
I know $a_i$ and $b_i$ for the given expression without writing any code, but how to write a personal general function to do this work?
Thank you very much!
a_i
andb_i
. Otherwise you could trivially write every functionf[t]=f[t]*E^0
. Are you expecting this expansion to be unique? $\endgroup$