# How to simplify Log[ Exp[x] *y ]?

How can the following expression be simplified:

Log[
Sqrt[ (m/(2*Pi*k*T)^3) *4*Pi*v^2 ] * Exp[ -(m*v^2 / (2*k*T)) ]
]


I would like to get the result:

Log[ Sqrt[ (m/(2*Pi*k*T)^3) *4*Pi*v^2 ] ]  - (m*v^2 / (2*k*T))

• expr /. Log[a_ E^b_] :> b + Log[a] – Bob Hanlon Sep 29 '16 at 23:11

Assuming all variables are positive:

FullSimplify[Log[Sqrt[(m/(2*Pi*k*T)^3)*4*Pi*v^2]*Exp[-(m*v^2/(2*k*T))]],{T>0,k>0,m>0,v>0}]

1/2 (-((m v^2)/(k T))+Log[(m v^2)/(2 k^3 \[Pi]^2 T^3)])


Is this better? Yours to decide.

EDIT:

Okay since you explained it in detail you just want to use the rule

$$\log\left(\exp \left(x\right)\cdot y\right)=x+\log\left(y\right)$$

So we implement this single rule as PatternMatching:

Log[Sqrt[(m/(2*Pi*k*T)^3)*4*Pi*v^2]*Exp[-(m*v^2/(2*k*T))]]/.Log[Exp[a_]*b_]:>a+Log[b]

-((m v^2)/(2 k T)) + Log[Sqrt[(m v^2)/(k^3 T^3)]/(Sqrt \\[Pi])]

• Nearly what I wanted: Since Log[Exp[x] * y] = x + Log[y], it would be nice keep the expression in x and y as they are originally. – mrz Sep 29 '16 at 22:48
• Look into the newest edit. – Julien Kluge Sep 29 '16 at 23:00
• This is great ... thanks – mrz Sep 29 '16 at 23:15

Maybe PowerExpand is what you're looking for. Not simpler, but expanded.

• This is interesting but expanding everything ... – mrz Sep 29 '16 at 22:38