Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

When solving an analytical expression, I need to take the Log of something. However, Mathematica seems unable to reduce a simple Log of an exponential:

Log[E^x] // does not output 'x'

Why does this not work?


share|improve this question

closed as off-topic by ubpdqn, m_goldberg, RunnyKine, Yves Klett, Sjoerd C. de Vries Mar 13 at 15:41

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – ubpdqn, m_goldberg, RunnyKine, Yves Klett
If this question can be reworded to fit the rules in the help center, please edit the question.

Try Log[E^x] // PowerExpand –  Kuba Mar 13 at 11:47
Or FullSimplify[Log[E^x], Assumptions -> x \[Element] Reals] –  rasher Mar 13 at 11:50
3274 and 20107 and probably more. –  Öskå Mar 13 at 11:53
Awesome. Thanks! –  LBogaardt Mar 13 at 12:01
Also related: mathematica.stackexchange.com/q/35023/12 –  Szabolcs Mar 13 at 15:42

1 Answer 1

It does not work because the transformation is not generally valid. For example:

In[1]:= Log@Exp[x]
Out[1]= Log[E^x]

In[2]:= % /. x -> 3 Pi I
Out[2]= I π

As Kuba said, PowerExpand will ignore this and just expand this expression, as well as expand expressions of the form (x^a)^b to x^(a b).

In[3]:= PowerExpand[Log@Exp[x]]
Out[3]= x

In newer versions of Mathematica it is possible to force PowerExpand to return a generally valid result, like this:

In[4]:= PowerExpand[Log@Exp[x], Assumptions -> True]
Out[4]= x + 2 I π Floor[1/2 - Im[x]/(2 π)]
share|improve this answer

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