Let $f(x) = \begin{vmatrix} \sin^2 x & -2 + \cos^2 x & \cos 2x \\ 2 + \sin^2 x & \cos^2 x & \cos 2x \\ \sin^2 x & \cos^2 x & 1 + \cos 2x \end{vmatrix}$, $x \in [0, \pi]$. Then the maximum value of $f(x)$ is equal to ______.
Numerical-value question: the answer is a number.
Show answer
The answer is 6.
Key from source paper