Try to differentiateGeometry Level pending
\[\cos A \sin^2 \left( \frac A2 \right) + \cos B \sin^2 \left( \frac B2 \right) + \cos C \sin^2 \left( \frac C2 \right) \]
If \(A\), \(B\), and \(C\) are the angles of a triangle, then the maximum value of the expression above can be written as \( \dfrac PQ\), where \(P \) and \(Q\) are coprime positive integers, find \(Q-P \).
Bonus: For what type of triangle will the value of this expression be maximum??