Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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!

share|improve this question
2  
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 1

up vote 5 down vote accepted

Maybe:

FullSimplify[PowerExpand@Log[x^n Exp[x]], 
 x > 0 && Element[n, Integers] && n > 1]
x + n Log[x]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.