# How can I get exact maximal value of this expression?

I am trying to find the exact maximum value of the expression $$E= \sqrt{5 a^2+a (4 b-2 c)+2b^2+4 b c+5 c^2}+\sqrt{2a^2+a (2 b+2 c)+2 b^2-2 bc+2 c^2}+\sqrt{26 a^2+a (10c-2 b)+26 b^2+10 b c+2 c^2} ,$$ where $$a^2 + b^2 + c^2 = 1$$ and $$a, b, c > 0$$.

I know that, the answer is $$4\sqrt{3} + \sqrt{6} .$$ When I tried

NMaximize[{(Sqrt[2*a^2 + (2*b + 2*c)*a + 2*b^2 - 2*b*c + 2*c^2] +
Sqrt[5*a^2 + (4*b - 2*c)*a + 2*b^2 + 4*b*c + 5*c^2] +
Sqrt[26*a^2 + (-2*b + 10*c)*a + 26*b^2 + 10*b*c + 2*c^2]),
a^2 + b^2 + c^2 == 1, a > 0, b > 0, c > 0}, {a, b, c}]


{9.37769, {a -> 0.801784, b -> 0.534523, c -> 0.267261}}


When I tried,

Maximize[{(Sqrt[2*a^2 + (2*b + 2*c)*a + 2*b^2 - 2*b*c + 2*c^2] +
Sqrt[5*a^2 + (4*b - 2*c)*a + 2*b^2 + 4*b*c + 5*c^2] +
Sqrt[26*a^2 + (-2*b + 10*c)*a + 26*b^2 + 10*b*c + 2*c^2]),
a^2 + b^2 + c^2 == 1, a > 0, b > 0, c > 0}, {a, b, c}]


It's take about 3 minutes, I could't get the answer. How can I get exact maximize value of that expression?

Writing:

rad1 = Sqrt[5 a^2 + 4 a b + 2 b^2 - 2 a c + 4 b c + 5 c^2];
rad2 = Sqrt[2] Sqrt[a^2 + b^2 - b c + c^2 + a (b + c)];
rad3 = Sqrt[2] Sqrt[13 a^2 - a b + 13 b^2 + 5 (a + b) c + c^2];

bond = {a^2 + b^2 + c^2 == 1, a > 0, b > 0, c > 0};
sol1 = NMaximize[{fct, bond}, {a, b, c}, WorkingPrecision -> 40];

max = WolframAlpha[ToString[sol1[[1]]], str][[1, 1]];
a0 = WolframAlpha[ToString[sol1[[2, 1, 2]]], str][[1, 1]];
b0 = WolframAlpha[ToString[sol1[[2, 2, 2]]], str][[1, 1]];
c0 = WolframAlpha[ToString[sol1[[2, 3, 2]]], str][[1, 1]];

sol2 = {max, {a -> a0, b -> b0, c -> c0}}
sol1 == N[sol2]


I get:

{4 Sqrt[3] + Sqrt[6], {a -> 3/Sqrt[14], b -> Sqrt[2/7], c -> 1/Sqrt[14]}}

True

which is what is desired.

I don't know why Maximize is unable to find the maximum. Instead of using Maximize, you could try using Lagrange multipliers. To make the algebra easier, define:

constraint1 = 2*a^2+(2*b+2*c)*a+2*b^2-2*b*c+2*c^2 - d^2;
constraint2 = 5*a^2+(4*b-2*c)*a+2*b^2+4*b*c+5*c^2 - e^2;
constraint3 = 26*a^2+(-2*b+10*c)*a+26*b^2+10*b*c+2*c^2 - f^2;
constraint4 = a^2 + b^2 + c^2 - 1;


Then, the goal is to maximize d + e + f subject to having each constraint equal to 0 (I'm ignoring the positivity constraint for now). Using Lagrange multipliers, we want to extremize the function:

obj = d + e + f + λ1 constraint1 + λ2 constraint2 + λ3 constraint3 + λ4 constraint4;


Setting the derivatives with respect to each of the unknowns to 0:

eqns = Thread[D[obj, {{a, b, c, d, e, f, λ1, λ2, λ3, λ4}}] == 0];


Let's solve them:

sols = Solve[eqns, {a, b, c, d, e, f, λ1, λ2, λ3, λ4}, Reals];//AbsoluteTiming


{1.77698, Null}

Now, let's impose the constraints that a, b, c, d, e, and f are all positive:

r = Cases[sols, x_ /; AllTrue[{a, b, c, d, e, f} /. x, GreaterEqualThan[0]]]


{{a -> 3/Sqrt[14], b -> Sqrt[2/7], c -> 1/Sqrt[14], d -> Sqrt[3], e -> Sqrt[6], f -> 3 Sqrt[3], λ1 -> 1/(2 Sqrt[3]), λ2 -> 1/( 2 Sqrt[6]), λ3 -> 1/(6 Sqrt[3]), λ4 -> 1/2 (-4 Sqrt[3] - Sqrt[6])}}

So, the maximum value is:

d + e + f /. First [r]


4 Sqrt[3] + Sqrt[6]