0
$\begingroup$

This is probably a naive question, but here it goes:

I know that $$r\cos a+s\cos b+t\cos c \leq \frac{rs}{2t}+\frac{rt}{2s}+\frac{ts}{2r},$$

subject to the conditions $a+b+c=\pi$ and $r,s,t$ are positive reals.

My question is whether I can ask Mathematica to find the RHS in the above inequality.

I tried:

Maximize[{r*Cos[a] + s*Cos[b] + t*Cos[c], c = Pi - a - b, r > 0, s > 0, t > 0}, {a, b}] 
$\endgroup$
7
  • 1
    $\begingroup$ Please write down the Mathematica code you tried. Thanks! $\endgroup$ Oct 14, 2014 at 13:51
  • $\begingroup$ Maximize[{rcos[a] + scos[b] + t*cos[c], c = pi - a - b, r > 0, s > 0, t > 0}, {a, b}] $\endgroup$
    – the_fox
    Oct 14, 2014 at 13:56
  • 1
    $\begingroup$ You got syntax issues - take care of upper/lowercase spelling, and = is not equivalent to ==. $\endgroup$
    – Yves Klett
    Oct 14, 2014 at 14:31
  • $\begingroup$ Maximize[{rCos[a] + sCos[b] + t*Cos[Pi - a - b], r > 0, s > 0, t > 0}, {a, b}] ? $\endgroup$
    – the_fox
    Oct 14, 2014 at 14:50
  • $\begingroup$ Yes, that's now capitalized correctly. $\endgroup$ Oct 14, 2014 at 14:55

2 Answers 2

6
$\begingroup$

Here is a way of obtaining the result that you want.

Define the expression to be maximised, using a + b + c == Pi to eliminate c.

expr = r Cos[a] + s Cos[b] + t Cos[Pi - a - b];

Solve for the stationary points w.r.t. a and b.

sol = Solve[D[expr, a] == 0 && D[expr, b] == 0, {a, b}]

(* Lots of ConditionalExpression due to the periodicity of the expression being maximised *)

Substitute the solutions back into the expression. Then post-process the result in several stages: (1) FullSimplify using that {r, s, t} > 0, (2) Refine to remove the degeneracy due to periodicity, and (3) Expand to write the results nicely.

expr0 = expr /. sol //
  FullSimplify[#, {r, s, t} > 0] & //
  Refine[#, C[1] \[Element] Integers && C[2] \[Element] Integers] & //
  Expand

(*
  {
    r + s - t,
    r - s + t,
    -r + s + t,
    -r - s - t,
    (r s)/(2 t) + (r t)/(2 s) + (s t)/(2 r),
    (r s)/(2 t) + (r t)/(2 s) + (s t)/(2 r)
  }
*)

Check all of these stationary values against the conjectured upper bound.

ForAll[{r, s, t}, {r, s, t} > 0, 
  expr0 <= (r s)/(2 t) + (r t)/(2 s) + (s t)/(2 r)] // Resolve

(* True *)
$\endgroup$
1
  • $\begingroup$ Great answer! Thanks a lot. $\endgroup$
    – the_fox
    Oct 15, 2014 at 9:57
2
$\begingroup$

If you want get the same symbolic result, i'm afraid mathematica cant handle that. But still a few comments. The first is of course syntax problems (see example below). You can always consider numerical task: say, you want to maximize left side with known right side, i.e. known r,s,t. Another point - Maximize cant manage all the tasks for sure, consider using NMaximize. I would suggest:

r = 1;
t = 2;
s = 3;
NMaximize[{r Cos[a] + s Cos[b] + t Cos[c], a + b + c == Pi}, {a, b, c}]
$\endgroup$
1
  • $\begingroup$ Ok, thanks. I am not interested in numerical solutions though; rather, I was hoping for an "inequality proving" routine within Mathematica. $\endgroup$
    – the_fox
    Oct 14, 2014 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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