Solve this following
Question:

Let

$f(x)=\left|\begin{array}{ccc}\sin ^{2} x & -2+\cos ^{2} x & \cos 2 x \\ 2+\sin ^{2} x & \cos ^{2} x & \cos 2 x \\ \sin ^{2} x & \cos ^{2} x & 1+\cos 2 x\end{array}\right|, x \in[0, \pi]$

Then the maximum value of $f(x)$ is equal to

Solution:

$\left|\begin{array}{ccc}-2 & -2 & 0 \\ 2 & 0 & -1 \\ \sin ^{2} x & \cos ^{2} x & 1+\cos 2 x\end{array}\right|\left(\begin{array}{l}R_{1} \rightarrow R_{1}-R_{2} \\ \& R_{2} \rightarrow R_{2}-R_{3}\end{array}\right)$

$-2\left(\cos ^{2} x\right)+2\left(2+2 \cos 2 x+\sin ^{2} x\right)$

$4+4 \cos 2 x-2\left(\cos ^{2} x-\sin ^{2} x\right)$

$f(\mathrm{x})=4+\underbrace{2 \cos 2 \mathrm{x}}_{\max =1}$

$f(\mathrm{x})_{\max }=4+2=6$