I have some long expressions like exp
which can be divided into three specified part. I want to simplify each part to its simplest one use FullSimplify
.
The specified parts should be:
- the first part is
term1 = factor1 * E^(-(t/τe1))
, - the second part is
term2 = factor2 * DiracDelta[t]
, - the third part is
term3 = factor3
.
Here factor1
, factor2
, and factor3
shold not have E^(-(t/τe1))
or DiracDelta[t]
.
The one long expression is like this
exp = 1/(16 π (-1 + δ)) (1 +
2 (1/(9 η0^2 (λ0 + μ0)^4) E^(-(t/τe1)) μ0^2 (-(3
λ0 + 2 μ0) (6 η0 (λ0 + μ0) (λ0 +2 μ0) -
t μ0^2 (3 λ0 + 2 μ0)) -
x (6 η0 λ0 (λ0 + μ0) +
t μ0^2 (3 λ0 + 2 μ0))) + ((λ0 +
2 μ0) (x + λ0 + 2 μ0) DiracDelta[
t])/(λ0 + μ0)^2 -
3 (-((E^(-(t/τe1)) μ0^2 (3 λ0 +
2 μ0))/(3 η0 (λ0 + μ0)^2)) + ((λ0 +
2 μ0) DiracDelta[t])/(λ0 + μ0))))
I know firstly I should Expand
it into some terms, then divide these terms into three part, then use FullSimplify
to simplify them.
But I don't know how to use MatchQ
to get these three specified parts.
Please help me!
Thank you very much!
Edit 2017/05/27
The exp
without synatix error is like this:
exp=(1 + 2 ((E^(-(
t/\[Tau]e1)) \[Mu]0^2 ((-3 \[Lambda]0 -
2 \[Mu]0) (6 \[Eta]0 (\[Lambda]0 + \[Mu]0) (\[Lambda]0 +
2 \[Mu]0) - t \[Mu]0^2 (3 \[Lambda]0 + 2 \[Mu]0)) -
x (6 \[Eta]0 \[Lambda]0 (\[Lambda]0 + \[Mu]0) +
t \[Mu]0^2 (3 \[Lambda]0 + 2 \[Mu]0))))/(
9 \[Eta]0^2 (\[Lambda]0 + \[Mu]0)^4) + ((\[Lambda]0 +
2 \[Mu]0) (x + \[Lambda]0 + 2 \[Mu]0) DiracDelta[
t])/(\[Lambda]0 + \[Mu]0)^2 -
3 (-((E^(-(t/\[Tau]e1)) \[Mu]0^2 (3 \[Lambda]0 + 2 \[Mu]0))/(
3 \[Eta]0 (\[Lambda]0 + \[Mu]0)^2)) + ((\[Lambda]0 +
2 \[Mu]0) DiracDelta[
t])/(\[Lambda]0 + \[Mu]0))))/(16 \[Pi] (-1 + \[Delta]))
After using exp2=Collect[exp, {DiracDelta[t], Exp[-\[Tau]/\[Tau]e1]}, Simplify]
, I get
exp2=(E^(-(t/\[Tau]e1)) (9 E^(
t/\[Tau]e1) \[Eta]0^2 (\[Lambda]0 + \[Mu]0)^4 -
2 \[Mu]0^2 (x (6 \[Eta]0 \[Lambda]0 (\[Lambda]0 + \[Mu]0) +
t \[Mu]0^2 (3 \[Lambda]0 + 2 \[Mu]0)) - (3 \[Lambda]0 +
2 \[Mu]0) (t \[Mu]0^2 (3 \[Lambda]0 + 2 \[Mu]0) +
3 \[Eta]0 (\[Lambda]0^2 - \[Mu]0^2)))))/( 144 \[Pi] (-1 + \[Delta]) \[Eta]0^2 (\[Lambda]0 + \[Mu]0)^4) + ((x -
2 \[Lambda]0 - \[Mu]0) (\[Lambda]0 + 2 \[Mu]0) DiracDelta[t])/( 8 \[Pi] (-1 + \[Delta]) (\[Lambda]0 + \[Mu]0)^2)
Its return is very close to the answer I want. But exp2
has two terms, not three. The first term of exp2
contains E^(-(t/\[Tau]e1)) (temp1*(E^(t/\[Tau]e1)+temp2)
.
If I try Collect[Part[%, 1], Exp[-\[Tau]/\[Tau]e1], Simplify]
on the first term, then MMA just return it without change.
Could you help me to get three terms? I have about 50 long expressions like exp1
, So I need a function to do this work. Thank you!
Collect[exp, {Exp[-(t/τe1)], DiracDelta[t]}, Simplify]
. $\endgroup$Collect[Part[%,1], Exp[-(t/τe1)], Simplify ]
on the first term to divide it into two, but it doesn't work. $\endgroup$Collect
toexp
in your edit. $\endgroup$