6
$\begingroup$

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?

$\endgroup$
3
  • 1
    $\begingroup$ Use //ComplexExpand//PowerExpand//Simplify (I suppose b is Real, if not, dont use the ComplexExpand part) $\endgroup$
    – Spawn1701D
    Commented Apr 14, 2013 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$ Commented Apr 14, 2013 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
    Commented Apr 14, 2013 at 7:28

2 Answers 2

7
$\begingroup$

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] // 
 TraditionalForm

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.

$\endgroup$
1
  • $\begingroup$ Thank you very much @ Artes. Much obliged! $\endgroup$ Commented Apr 14, 2013 at 0:27
6
$\begingroup$

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
$\endgroup$
1
  • $\begingroup$ thank you @ Szabolcs. You are absolutely right, b is real. $\endgroup$ Commented Apr 14, 2013 at 0:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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