MATLAB: Is SIMPLIFY not able to simplify a straightforward expression in Symbolic Math Toolbox 5.3 (R2009b)

Symbolic Math Toolbox

When I execute the following commands:
syms x
simplify(log(exp(x)))
I receive the following result
ans =
log(exp(x))
I expected an answer of 'x'.

Best Answer

This is the expected behavior of the SIMPLIFY function in the Symbolic Math Toolbox 5.3 (R2009b). By default, the function tries to make as few assumptions about the symbolic variables as possible. Considering the above example, the expression 'log(exp(x))' cannot always be simplified to the expression 'x'. In particular, consider if x = 2*pi*i (where i is the imaginary unit). Then log(exp(x)) = 0, which is clearly not equal to x.
In order to do simplifications with looser assumptions about the symbolic variables, call the MuPAD SIMPLIFY function in the MuPAD notebook interface or in MATLAB through the FEVAL or EVALIN commands. Using the MuPAD command directly allows the inclusion of the 'IgnoreAnalyticConstraints' option which controls the level of mathematical rigor that the solver uses on the analytical constraints on the solution.
For example:
syms x
feval(symengine,'simplify',log(exp(x)),'IgnoreAnalyticConstraints')
For more information on the MuPAD SIMPLIFY command, the 'IgnoreAnalyticConstraints' option, and other options which can be used with the MuPAD SIMPLIFY command you may refer to: