Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After some integration process, I ended up with the following expression:

(1/(b (-1 + E^b) Re[b]))E^-Re[b](  b E^b - b + E^Re[b] Re[b] - E^(b + Re[b]) Re[b]
                                 + E^Re[b] Sqrt[E^(-2 b) (-1 + E^b)^2] Re[b]
                                 + b E^(b + Re[b]) Sqrt[E^(-2b)(-1 + E^b)^2] Re[b] )

all is good, but this expression is supposed to be equal to

1 + (2/b) e^(-b) - 1/b

via simple numerical trials, i can confirm that they are equal. But, it would be great if I can actually make Mathematica simplify that nasty expression into this innocent form. I tried, Fullsimplify, it does not work. Does anyone have any suggestion?

share|improve this question
Use //ComplexExpand//PowerExpand//Simplify (I suppose b is Real, if not, dont use the ComplexExpand part) – Spawn1701D Apr 14 '13 at 0:08
Using Simplify[PowerExpand[%]] worked. Thank you. I did not know that this was more powerful than FullSimplify. I appreciate your help. – Korben Dallas Apr 14 '13 at 0:24
Perhaps you should declare b as a real (using the option Assumptions) in your integration process. it might save you some time. – Spawn1701D Apr 14 '13 at 7:28
up vote 7 down vote accepted

Algebraic simplifications like Simplify and FullSimplify can be used with the second argument - assumptions. We can assume e.g. that b is a real number i.e. b ∈ Reals (otherwise the system assumes that b is complex) :

Simplify[ (1/(b (-1 + E^b) Re[b])) E^-Re[b](-b + b E^b + E^Re[b] Re[b]
           - E^(b + Re[b]) Re[b] + E^Re[b] Sqrt[E^(-2 b) (-1 + E^b)^2] Re[b]
           + b E^(b + Re[b]) Sqrt[E^(-2 b) (-1 + E^b)^2] Re[b]),  b ∈ Reals] // 

enter image description here

Since there are two cases b >= 0 and b < 0 (in general there might be more cases depending on the assumptions) we should map Expand on the output ( common shorthands Map -- /@ and MapAll -- //@)

Expand //@ % // TraditionalForm

enter image description here

The same answer you can get with FullSimplify.

share|improve this answer
Thank you very much @ Artes. Much obliged! – Korben Dallas Apr 14 '13 at 0:27

The expression you gave simplifies to the form you are looking for only for positive and real $b$. Just give this assumption in Simplify:

In[14]:= Simplify[expr, b > 0]
Out[14]= (E^-b (2 + (-1 + b) E^b))/b

In[15]:= Expand[%]
Out[15]= 1 - 1/b + (2 E^-b)/b
share|improve this answer
thank you @ Szabolcs. You are absolutely right, b is real. – Korben Dallas Apr 14 '13 at 0:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.