Message Boards Message Boards

4 Replies
4 Total Likes
View groups...
Share this post:

How to simplify an expression? want a specific form.

Posted 11 years ago
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
4 Replies
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
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

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
Thanks for your suggestion, Collect works on patterns can solve this problem perfectly~
POSTED BY: yilun chen
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract