Rewriting exp(n*ln(x)) as a power: exp2pow

### 5.24.8 Rewriting exp(n*ln(x)) as a power: exp2pow

The exp2pow command is the inverse of pow2exp (see Section 5.24.7).

- exp2pow takes one argument:
  expr, an expression.
- exp2pow(expr) rewrites any subexpressions of expr of the form exp(n*ln(x)) as xn.

Example
Input:

exp2pow(exp(n*ln(x)))

Output:

xn

Note the difference with lncollect:

lncollect(exp(n*ln(x))) = exp(n*log(x))
lncollect(exp(2*ln(x))) = exp(2*log(x))
exp2pow(exp(2*ln(x))) = x^2

but

lncollect(exp(ln(x)+ln(x))) = x^2
exp2pow(exp(ln(x)+ln(x))) = x^(1+1)