0
$\begingroup$

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))
$\endgroup$
  • $\begingroup$ expr /. Log[a_ E^b_] :> b + Log[a] $\endgroup$ – Bob Hanlon Sep 29 '16 at 23:11
2
$\begingroup$

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[2] \\[Pi])]
$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – mrz Sep 29 '16 at 22:48
  • $\begingroup$ Look into the newest edit. $\endgroup$ – Julien Kluge Sep 29 '16 at 23:00
  • 1
    $\begingroup$ This is great ... thanks $\endgroup$ – mrz Sep 29 '16 at 23:15
1
$\begingroup$

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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