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

Click For Summary
SUMMARY

The discussion focuses on simplifying expressions in Mathematica involving logarithmic and exponential functions, specifically how to make the expression e^{log(z)} return z. Users found that using PowerExpand[Log[Exp[z]]] successfully simplifies the expression to z. It is crucial to use uppercase functions like Log, Exp, and E to avoid errors, particularly when using the Solve[] function. The discussion also highlights the importance of understanding the domain of z, as log(z) is only defined for z > 0 when z is real.

PREREQUISITES
  • Familiarity with Mathematica syntax and functions
  • Understanding of logarithmic and exponential properties
  • Knowledge of complex numbers and their properties
  • Basic grasp of function capitalization in Mathematica
NEXT STEPS
  • Learn about PowerExpand and its applications in Mathematica
  • Research the behavior of Log and Exp with complex numbers in Mathematica
  • Explore the Solve[] function and its requirements for variable definitions
  • Study the implications of branch cuts in complex analysis
USEFUL FOR

Mathematica users, mathematicians, and students working with logarithmic and exponential functions, particularly those dealing with complex numbers and simplification techniques.

Master1022
Messages
590
Reaction score
116
TL;DR
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.

[CODE title="Mathematica"]e^log[z]
E^log[z]
PowerExpand[E^log[z]]
Simplify[PowerExpand[E^log[z]]][/CODE]

Thanks in advance.
 
Physics news on Phys.org
PowerExpand[] works for me. Be sure to capitalize Log , Exp and E !

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

Out[1]= z
 
  • Like
  • Wow
Likes   Reactions: jedishrfu and Master1022
renormalize said:
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).
 
Master1022 said:
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?
 
@Master1022, in your first post you asked two different questions:
How can I get the expression ##\log(exp(z))## to return z in Mathematica?
Question: How do I make the expression ##e^{\log(z)} return z?

First off, is z a complex number? A variable named z is often used to represent a complex number, so if you use z to represent a real number, that can lead to confusion amongst readers.

Mathematically, ##\log(exp(z))## is always defined and is equal to z, but the opposite order in the composition may not be defined due to ##\log(z)## not being defined. If z is real, log(z) is defined only for z > 0.

If z is complex, the Mathematica documentation says this:
Log[z] has a branch cut discontinuity in the complex z plane running from ##-\infty## to 0.
 

Similar threads

Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K