1
$\begingroup$
Clear["Global`*"]
Maximize[{Tan[a], a + b + c == \[Pi], 
   Sin[a] + 3 Sin[b] Cos[c] == 0, \[Pi]/2 < c < \[Pi], 
   0 < a < \[Pi]/2, 0 < b < \[Pi]/2}, {a, b, c}] // FullSimplify

Why is running this code always displaying Running? No calculation results

enter image description here

$\endgroup$

2 Answers 2

5
$\begingroup$

We calculate the max value of a, then Tan[a] since Tan is increasing in 0 < a < π/2

max=Maximize[{a, a + b + c == π, 
  Sin[a] + 3 Sin[b] Cos[c] == 0, π/2 < c < π, 0 < a < π/2,
   0 < b < π/2}, {a, b, c}]
Tan[max // First] // FullSimplify

3/4

$\endgroup$
1
  • $\begingroup$ That is to say, if the maximum value of the function cannot be obtained in one step, then use monotonicity to find the maximum value of the independent variable first $\endgroup$
    – csn899
    May 29, 2023 at 0:32
2
$\begingroup$

Or use a numeric method

$Version

(* "13.2.1 for Mac OS X ARM (64-bit) (January 27, 2023)" *)

Clear["Global`*"]

{max, arg} = 
 NMaximize[{Tan[a], a + b + c == π, 
     Sin[a] + 3 Sin[b] Cos[c] == 0, π/2 < c < π, 
     0 < a < π/2, 0 < b < π/2}, {a, b, c}, 
    WorkingPrecision -> 30] // N // Rationalize

(* {3/4, {a -> 0.643501, b -> 0.463648, c -> 2.03444}} *)
$\endgroup$

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.