Group Abstract Group Abstract

Message Boards Message Boards

How to simplify an expression? want a specific form.

I have an expr. with the form of 
a1 and bi are all symbols,not number
I want it in the following form:
What should I do? Here Simplify doesn't work
POSTED BY: yilun chen
8 months ago
Perhaps Factor can help: 
In[3]:= Factor[E^(a1 t) b1 + E^(a1 t) b2 + E^(a1 t) b3]

Out[3]= (b1 + b2 + b3) E^(a1 t)
POSTED BY: Ilian Gachevski
8 months ago
Thanks~actually the problem is a little bit more complicated, here is the original expression:
E^(-k22 t) ((0.5 b2 bb1^2 (-1 + E^(-k22 t)))/k22 - ( 0.5 b2 c1^2 (-1 + E^(k22 t)))/k22 - ( 0.5 a1^2 b2 (-1 + E^((k22 - 2 k33) t)))/(k22 - 2 k33) -...
Expand it and we  get:
-((0.5 b2 c1^2)/k22) + (0.5 b2 bb1^2 E^(-2 k22 t))/k22 - ( 0.5 b2 bb1^2 E^(-k22 t))/k22 + (0.5 b2 c1^2 E^(-k22 t))/k22 + ( 0.5 a1^2 b2 E^(-k22 t))/(k22 - 2 k33) - ...
the items of the sum are all of  the form:
b E^[a t] t^n
where a,b can be very complicated,
I want to put those items with the same a and n together, i.e, to simplify the expression to make sure that 
E^[a t]*t^n*(b1+b2+..)
only appear once in the sum, put the coefficients together in the bracket. Is this possible? 
POSTED BY: yilun chen
8 months ago

Here is my suggestion. Get all of E^(a t) using Cases. Then use Collect with var = (List of E^(a t)) (see Mathematica help for details). You will need further processing to factor out the factors t^n.

Youngjoo Chung
POSTED BY: Youngjoo Chung
8 months ago
Thanks for your suggestion, Collect works on patterns can solve this problem perfectly~
POSTED BY: yilun chen
7 months ago