0
$\begingroup$

I am trying to use Maximize to find the maximum value of f, which is a polynomial in terms of Sin[t] and Cos[t].

A = {{1, 2}, {2, 3}};
B = {{1, -2}, {-2, 0}};
p = {Cos[t], Sin[t]};
f = (p.A.A.p - (p.A.p)^2)(p.B.B.p - (p.B.p)^2)
Maximize[{f, 0 <= t <= \[Pi]/2}, t]

I thought it should be straightforward. However, the result I get is a very long expression, which does not make sense. I have no idea where I make a mistake.

code image

$\endgroup$
1
  • 1
    $\begingroup$ Try Maximize[{Simplify@f, 0 <= t <= \[Pi]/2}, t] // N. $\endgroup$ – Rohit Namjoshi Sep 7 '20 at 0:54
6
$\begingroup$
$Version

"12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020)"

Clear["Global`*"]

A = {{1, 2}, {2, 3}};
B = {{1, -2}, {-2, 0}};
p = {Cos[t], Sin[t]};

FullSimplify prior to finding the maximum

f = (p.A.A.p - (p.A.p)^2) (p.B.B.p - (p.B.p)^2) // FullSimplify

(* 1/16 (9 + 7 Cos[4 t] + 6 Sin[4 t])^2 *)

FullSimplify after finding the maximum

{max, arg} = Maximize[{f, 0 <= t <= π/2}, t] // FullSimplify

(* {1/8 (83 + 9 Sqrt[85]), {t -> 1/2 ArcTan[1/6 (-7 + Sqrt[85])]}} *)

The approximate numeric values are

{max, arg} // N

(* {20.747, {t -> 0.177157}} *)

Visually,

Plot[f, {t, 0, π/2}, Epilog ->
  {Red, AbsolutePointSize[4], Point[{t, f} /. arg]}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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