Example 9 The function $F(x)=\left|\cos ^{2} x+2 \sin x \cos x-\sin ^{2} x+A x+B\right|$ has a maximum value $M$ on $0 \leqslant x \leqslant \frac{3}{2} \pi$ that depends on $A$ and $B$. For what values of $A$ and $B$ is $M$ minimized? Explain your conclusion.
Analysis: Start from a special case, for $A=B=0$, we have
$M=\max _{0 \leqslant x \leqslant \frac{3}{2} \pi} F(x)=\max _{0 \leqslant x \leqslant \frac{3}{2} \pi}\left\{\left|\sqrt{2} \sin \left(2 x+\frac{\pi}{4}\right)\right|\right\}=\sqrt{2}$.
Guess $M_{\text {min }}=\sqrt{2}$, we just need to prove that for $A, B$ not both 0, we have: $M=\max _{0 \leqslant x \leqslant \frac{3}{2} \pi} F(x)>\sqrt{2}$.
(1) Since $F(x)=\left|\sqrt{2} \sin \left(2 x+\frac{\pi}{4}\right)+A x+B\right|$.

So when $A=B=0$, $F(x)=\left|\sqrt{2} \sin \left(2 x+\frac{\pi}{4}\right)\right|$, in the interval $\left[0, \frac{3}{2} \pi\right]$, there are three points $x_{1}=\frac{\pi}{8}, x_{2}=\frac{5}{8} \pi, x_{3}=\frac{9}{8} \pi$ where $F(x)$ reaches the maximum value $M_{0}=\sqrt{2}$.
(2) Below, we prove: When $A, B$ are not both 0, $M=\max _{0 \leqslant x \leqslant \frac{3}{2} \pi} F(x)>\sqrt{2}$.
By contradiction: Assume $M=\max _{0 \leqslant x \leqslant \frac{3}{2} \pi} F(x) \leqslant \sqrt{2}$, then $f\left(\frac{\pi}{8}\right) \leqslant \sqrt{2}, f\left(\frac{5}{8} \pi\right) \leqslant \sqrt{2}, f\left(\frac{9}{8} \pi\right) \leqslant \sqrt{2}$, i.e.,
$$
\left\{\begin{array} { l } 
{ | \sqrt { 2 } + \frac { \pi } { 8 } A + B | \leqslant \sqrt { 2 } } \\
{ | \sqrt { 2 } + \frac { 5 } { 8 } \pi A + B | \leqslant \sqrt { 2 } } \\
{ | \sqrt { 2 } + \frac { 9 } { 8 } \pi A + B | \leqslant \sqrt { 2 } }
\end{array} \Leftrightarrow \left\{\begin{array}{l}
-2 \sqrt{2} \leqslant \frac{\pi}{8} A+B \leqslant 0 \\
0 \leqslant \frac{5}{8} \pi A+B \leqslant 2 \sqrt{2} \\
-2 \sqrt{2} \leqslant \frac{9}{8} \pi A+B \leqslant 0
\end{array} .\right.\right.
$$

From $\left\{\begin{array}{l}\frac{\pi}{8} A+B \leqslant 0 \\ \frac{5}{8} \pi A+B \geqslant 0\end{array} \Rightarrow \frac{4}{8} \pi A \geqslant 0 \Leftrightarrow A \geqslant 0\right.$,
From $\left\{\begin{array}{l}\frac{5}{8} A+B \geqslant 0 \\ \frac{9}{8} \pi A+B \leqslant 0\end{array} \Rightarrow \frac{4}{8} \pi A \leqslant 0 \Leftrightarrow A \leqslant 0\right.$,
So $A=0$, and $A, B$ are not both 0, i.e., $B \neq 0$.
So $M=\max _{0 \leqslant x \leqslant \frac{3}{2} \pi} F(x)=\max _{0 \leqslant x \leqslant \frac{3}{2} \pi}\left|\sqrt{2} \sin \left(2 x+\frac{\pi}{4}\right)+B\right|=\sqrt{2}+|B|>\sqrt{2}$, contradiction.
From (1) and (2), we know $M_{\min }=\sqrt{2}$, at this time $A=B=0$.