# Properly Force Mathematica to Simplify Log Expressions/Rules

I want to be able to expand $\log(x^n e^x) = n \log(x) +x$:

FullSimplify[Log[x^n Exp[x]], x > 0 && Element[n, Integers] && n > 1]


yields

Log[E^x x^n]


whereas

-1 +FullSimplify[Log[x^n Exp[x]] + 1,  x > 0 && Element[n, Integers] && n > 1]


yields

x + n Log[x]


what gives? Maybe it recognizes that I want to do arithmetic outside the log, so it then simplifies the expression; if that's the case, how can I force it to do that without hacking it by adding and subtracting 1?

thanks!

-
Can use PowerExpand with assumptions. The use of assumptions, while not really needed in your example, is good practice for cases where branch cuts might otherwise inadvertently be crossed. PowerExpand[Log[x^n Exp[x]], Assumptions -> x > 0 && Element[n, Integers] && n > 1] Out[1]= x + n Log[x] – Daniel Lichtblau Feb 24 '13 at 21:16

## 1 Answer

Maybe:

FullSimplify[PowerExpand@Log[x^n Exp[x]],
x > 0 && Element[n, Integers] && n > 1]

x + n Log[x]

-