4

I have a sum of exponentials that I'd like to simplify. The issue is when I use Simplify, Mathematica loves to factor out one exponential factor. See below: $$e^{-i (d (\text{kx1}+\text{kx2})+2 \beta +\gamma +\delta +\text{$\theta $1}+\text{$\theta $2})} \left((e^{i (d (\text{kx1}+\text{kx2})+2 \beta )}+2 e^{i (d (\text{kx1}+\text{kx2})+2 \beta +\gamma +\delta )}+e^{i (d (\text{kx1}+\text{kx2})+2 (\beta +\gamma +\delta ))}+2 e^{i (d (\text{kx1}+\text{kx2})+2 \beta +\gamma +\delta +2 \text{$\theta $1})}+e^{i (d (\text{kx1}+\text{kx2})+2 (\beta +\text{$\theta $1}))}\right....))$$

Otherwise, when I try to Expand it I get $$e^{i (d (\text{kx1}+\text{kx2})+2 \beta )-i (d (\text{kx1}+\text{kx2})+2 \beta +\gamma +\delta +\text{$\theta $1}+\text{$\theta $2})}+2 e^{i (d (\text{kx1}+\text{kx2})+2 \beta +\gamma +\delta )-i (d (\text{kx1}+\text{kx2})+2 \beta +\gamma +\delta +\text{$\theta $1}+\text{$\theta $2})}+e^{i (d (\text{kx1}+\text{kx2})+2 (\beta +\gamma +\delta ))-i (d (\text{kx1}+\text{kx2})+2 \beta +\gamma +\delta +\text{$\theta $1}+\text{$\theta $2})}+2 e^{i (d (\text{kx1}+\text{kx2})+2 \beta +\gamma +\delta +2 \text{$\theta $1})-i (d (\text{kx1}+\text{kx2})+2 \beta +\gamma +\delta +\text{$\theta $1}+\text{$\theta $2})}+e^{i (d (\text{kx1}+\text{kx2})+2 (\beta +\text{$\theta $1}))-i (d (\text{kx1}+\text{kx2})+2 \beta +\gamma +\delta +\text{$\theta $1}+\text{$\theta $2})}$$

Any help on how to "simplify" correctly would be greatly appreciated. Note, Refine does nothing in my case.

cormullion
  • 24,243
  • 4
  • 64
  • 133
lababidi
  • 319
  • 1
  • 5

1 Answers1

7

Taking the expression you get when Expand is applied, Simplify and FullSimplify work nicely if one isn't going to generalize it to much.

expr =  E^( I( d(kx1 + kx2) + 2β) - I ( d(kx1 + kx2) +  2β + γ + δ + θ1 + θ2)) + 
      2 E^( I( d(kx1 + kx2) + 2β + γ + δ) - I( d(kx1 + kx2) +  2β + γ + δ + θ1 + θ2)) + 
        E^( I( d(kx1 + kx2) + 2(β + γ + δ)) - I( d(kx1 + kx2) + 2β + γ + δ + θ1 + θ2)) + 
      2 E^( I( d(kx1 + kx2) + 2β + γ + δ + 2θ1) - I( d(kx1 + kx2) + 2β + γ + δ + θ1 + θ2)) + 
        E^( I( d(kx1 + kx2) + 2(β + θ1)) - I( d(kx1 + kx2) + 2 β + γ + δ + θ1 + θ2));

We can apply Simplify :

Simplify[ expr]

enter image description here

or FullSimplify

FullSimplify[expr]

enter image description here

If we assume another conditions (the second argument of Simplify or FullSimplify) we can get a simpler expression, e.g. assuming θ1 == θ2 and γ + δ == 0 yields :

Simplify[ expr, θ1 == θ2 && γ + δ == 0]
3 + 4 E^(-2 I θ2)

Edit 1

Taking into account the comments beneath I could do the task in another way, since it seems you just don't like the factorizing effect of Simplify on the whole expression. Therefore we can write the expression in the List form, then simplify every term seperately and finally write the terms as a sum :

Plus @@ Simplify[ List @@ expr]
E^(I ( γ + δ - θ1 - θ2)) + 2 E^(I ( θ1 - θ2)) + E^(-I ( γ + δ - θ1 + θ2)) 
+ 2 E^(-I (θ1 + θ2)) + E^(-I ( γ+ δ + θ1 + θ2))

or even better map Simplify over the expression, simply :

Simplify /@ expr

since it returns the same :

Plus @@ Simplify[List @@ expr] == Simplify /@ expr
True

Edit 2

There are many ways to do things in Mathematica, here is another useful one :

expr /. Power[a_, b_] :> Power[a, Simplify[b]]

or if you want to simplify only exponentials :

expr /. E^(a_) :> E^Simplify[a]

They return the results as mapping Simplify over the expression, e.g. :

Simplify /@ expr == expr /. Power[a_, b_] :> Power[a, Simplify[b]
True
Artes
  • 57,212
  • 12
  • 157
  • 245
  • 2
    Simplifies nicely to trig functions, if you actually type in \[ImaginaryI] instead of i. – Guillochon Jul 19 '12 at 20:49
  • @Guillochon Do you mean when using ExpToTrig? – CHM Jul 19 '12 at 20:57
  • @CHM FullSimplify will actually convert to trig automatically, if it can. – Guillochon Jul 19 '12 at 22:24
  • @Guillochon I was asking because I get the same result when I use FullSimplify on expr/. "i" -> \[ImaginaryI]. – CHM Jul 19 '12 at 22:30
  • Here's the thing. I do NOT want it to factor out one of the exponentials. Secondly, my list of exponentials is really long, so FullSimplify would take a really long time. Let me clarify that all I wanted was basically to simplify each individual exponential, if that makes sense. – lababidi Jul 24 '12 at 21:10
  • @lababidi First, you should ask a clear question with the expression you try to simplify in the Mathematica form. You should update your question to make it a constructive one. I updated my answer to the form you wanted. – Artes Jul 26 '12 at 08:56