# How can I simplify $\log(512)$ to $9\log(2)$?

Can you explain me about the result of Integrate.

\!$$\*SubsuperscriptBox[\(\[Integral]$$, $$1$$, $$3$$]$$\*SubsuperscriptBox[\(\[Integral]$$,
$$1$$, $$3$$]\*FractionBox[$$9 v$$, $$v + u\ v$$] \[DifferentialD]u \[DifferentialD]v\)\)
(*
2 log(512)
*)

% // Simplify
(*
2 log(512)
*)

% // FullSimplify
(*
18 log(2)
*)


However, I cannot FullSimplify this result

FullSimplify[Log]
(*
log(512)
*)

Log // N
(*
6.23832
*)

FullSimplify[2 Log] // N
(*
12.4766
*)


So question $1$ is how to simplify Log and why it doesn't simplify to 9Log by default.

9 Log // N
(*
6.23832
*)


When I'm integrating by hand, I collect 9 or 18 easily, so I like the result 18 log(2) , not 2 log(512), so I wonder why Mathematica gives this result?

Mathematica does not consider 9 Log to be "simpler" than Log. The full default ComplexityFunction is not disclosed (the one in the documentation is not entirely equivalent IIRC), but a good first-order approximation is often LeafCount

LeafCount /@ {Log, 9 Log}

{2, 4}


If you provide a ComplexityFunction that uses a different metric by which 9 Log has a lower score than Log, such as the largest integer that appears in the expression, it will reduce as you desire:

FullSimplify[Log, ComplexityFunction -> (Max @ Cases[#, _Integer, {0, -1}] &)]

9 Log


This kind of transformation Log -> 9 Log is not a simplification of the underlying expression but rather expanding it, there is PowerExpand which appears to be the simplest approach:

PowerExpand @ Log @ 512

9 Log


We can see that Log is simpler than 9 Log, to demonstrate it we can use TreeForm:

GraphicsRow[ TreeForm /@ {9 Log, Log}] When we are trying to transform adequate expressions with FullSimplify LeafCount only approximates ComplexityFunction, however in general it can't explain specific simplifications. Moreover ComplexityFunction works in a different way in Mathematica 9 in comparison to earlier versions, see e.g. FullSimplify does not work on this expression with no unknowns discussing how one can deal with similar problems.
Having said that I find simpler using the TransformationsFunctions option of FullSimplify rather than searching for appropriate ComplexityFunction, namely here we would use PowerExpand:

FullSimplify[ Log, TransformationFunctions -> PowerExpand]

9 Log


Now FullSimlify uses only PowerExpand while (see the documentation):

TransformationFunctions -> {Automatic, $f_1$, $f_2$, $\ldots$ } uses built-in transformation functions together with the functions $f_i$.

• Artes, congratulations on the Steward badge. That's a lot of reviewing. Thank you! – Mr.Wizard Dec 24 '13 at 12:45