# How can I minimize expression involving logarithms?

I am trying to find minimum of this expression: $$\log _a\left(\frac{4}{9} (3b-1)\right)+8 \log_{\frac{b}{a}}^2(a)-1,$$ where $$0 < b < a < 1$$. I tried

Clear[a, b]
Minimize[Log[a, 4 (3 b - 1)/9] + 8 (Log[b/a, a])^2 - 1,
0 < b < a < 1, {a, b}]


But I don't get the result. How can I get the result?

• Try with NMinimize instead. Commented Jun 27, 2020 at 10:48

We have a transcendental function of two variables and it is not straightforward to find global minima under given constraints because Minimize behind the scene uses symbolic equation solving functionality and sometimes it has to be supported by user's insight. However using both numerical and symbolic approach we can find an exact global minimum.

We define

f[a_,b_]:= Log[a, 4 (3 b - 1)/9] + 8 (Log[b/a, a])^2 - 1


To get an insight we play with

MinimalBy[ Table[ FindMinimum[{f[a, b], 0 < b < a < 1}, {b}],
{a, 73/100, 95/100, 2/100}], First, 3]

{{7.00101, {b -> 0.659199}}, {7.02367, {b -> 0.702245}}, {7.04024, {b -> 0.619364}}}


By direct inspection we find out where we should look for the global minimum:

RegionPlot[{ f[a, b] < 7.01, f[a, b] < 7.001, f[a, b] < 7.0001},
{a, 0.84, 0.9}, {b, 0.64, 0.7}, AxesLabel -> Automatic,
WorkingPrecision -> 30, PlotPoints -> 60, MaxRecursion -> 5]


With quite a good numerical approximation we can find

FindMinimum[{f[a, b], 3/5 < b <= 4/5, b < a < 1}, {{a, 0.87}, {b, 2/3}}]

 {7., {a -> 0.87358, b -> 0.666667}}


similarily works NMinimize[{f[a, b], 3/5 < b <= 4/5 < a < 1}, {a, b}], while Minimize doesn't work this way, nevertheless restricting one variable we can find an exact result. It is obvious that both partial derivatives have to vanish in the extremum:

Solve[Derivative[0, 1][f][a, 2/3] == 0 && 1/2 < a < 1, a]

 {{a -> (2/3)^(1/3)}}

Minimize[{f[(2/3)^(1/3), b], 1/3 < b < 1}, b] // FullSimplify

{7, {b -> 2/3}}

• Your answer and formatting are great. Are there guidelines to doing this efficiently? Commented Jun 27, 2020 at 17:29
• @PaulCommentary Thanks! It's force of my habit, I feel bad when my answer is imperfect, and so usually I have to edit and improve posts. Regarding guidelines I guess they are all collected in the help center. Commented Jun 27, 2020 at 20:34
Clear["Global*"]

f[a_, b_] := Log[a, 4 (3 b - 1)/9] + 8 (Log[b/a, a])^2 - 1

min = (FindMinimum[{f[a, b], 1/2 < b < a, 0 < a < 1}, {a, b},
WorkingPrecision -> 20] // N) /. x_Real :> RootApproximant[x] //

(* {7, {a -> (2/3)^(1/3), b -> 2/3}} *)


Verifying that the approximated results are exact

{min[[1]] == f[a, b], D[f[a, b], a] == 0, D[f[a, b], b] == 0} /. min[[2]]
// FullSimplify

(* {True, True, True} *)


You do not need numerical guess to find the minimum. Setting both partial derivatives to zero and eliminating variable a is enough.

f = Log[a, 4 (3 b - 1)/9] + 8 (Log[b/a, a])^2 - 1 //
PowerExpand[#, Assumptions -> {0 < a < 1, 1/3 < b < a}] &;

ee1 = (D[f, a] // Together // Numerator) //
PowerExpand[#, Assumptions -> {0 < a < 1, 1/3 < b < a}] &;

ee2 = (D[f, b] // Together // Numerator) //
PowerExpand[#, Assumptions -> {0 < a < 1, 1/3 < b < a}] &;

eli = Eliminate[{ee1 == 0, ee2 == 0}, Log[a]]

(*   b Log[b]^5 (6 Log[2] - 6 Log[3] - 3 Log[b] + 3 Log[-1 + 3 b]) ==
Log[b]^5 (2 Log[2] - 2 Log[3] + Log[-1 + 3 b])   *)

Solve[eli && 1/3 < b < 1, b]

(*   {{b -> 2/3}}   *)

Solve[0 == (ee1 /. b -> 2/3) && 1/3 < a < 1, a]

(*   {{a -> (2/3)^(1/3)}}   *)
`
• The critical point is found . One has else to ground this point is the minimum point. Commented Jul 22, 2020 at 16:04
• This should be no problem for even a undergraduate student. Commented Jul 22, 2020 at 18:11