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?

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

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.

  • $\begingroup$ Thank you very much @ Artes. Much obliged! $\endgroup$ – 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
  • $\begingroup$ thank you @ Szabolcs. You are absolutely right, b is real. $\endgroup$ – Korben Dallas Apr 14 '13 at 0:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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