# How to simplify expressions in Mathematica with log and exp in them?

• Mathematica
• Master1022
You can see this by trying different values of z and seeing where the logarithm cuts the real axis. This discontinuity can be a source of error when using the logarithm in complex contexts.In summary, z is a real or complex number that must be used with care when representing it as a variable in Mathematica because the order of operations may not be preserved when composing Log[z] with other Mathematica functions. If z is real, using PowerExpand[] will ensure that the correct branch cut is used, but if z is complex, using Log[z] may lead to an error.f

#### Master1022

TL;DR Summary
How can I get the expression ## log(exp(z)) ## to return ## z ## in Mathematica?
Hi,

This is a pretty simple question, but I am new to Mathematica so I am not sure if I am missing something obvious.

Question: How do I make the expression ## e^{log(z)} ## return z?

Attempt:

I have used all of the following combinations and all of them return ## e^{log(z)}##. Are there any tips people have? I have seen some people online use some elaborate functions, but I am just looking for a simple(r) solution.

Mathematica:
e^log[z]
E^log[z]
PowerExpand[E^log[z]]
Simplify[PowerExpand[E^log[z]]]

PowerExpand[] works for me. Be sure to capitalize Log , Exp and E !

In[1]:= PowerExpand[Log[Exp[z]]]

Out[1]= z

jedishrfu and Master1022
PowerExpand[] works for me. Be sure to capitalize Log , Exp and E !

In[1]:= PowerExpand[Log[Exp[z]]]

Out[1]= z
Oh wow, that does work! Many thanks. Do you know of any reason why using an upper case Log[] inside a Solve[] function could lead to an error, but then I changed it to log[] (lower case) and the error went away).

Do you know of any reason why using an upper case Log[] inside a Solve[] function could lead to an error, but then I changed it to log[] (lower case) and the error went away).
To answer I'd have to see how you set up your Solve[] statement. Can you share it?