Let two matrices $A,B \in M_n(\mathbb{R})$ satisfy $AB = BA$. Then show that: $\det(A^2 + AB + B^2) \geq 0$.
This looks similar to Prove that $\det (A^n + B^n) \geq 0 $ .
The obvious approach is to use $AB = BA$ to rewrite $A^2 + AB + B^2$ as $\dfrac34 \left(A+B\right)^2 + \dfrac14 \left(A-B\right)^2$. But these are matrices, not numbers, so does it really help?
Since $A$ and $B$ commute, we have $A^2+AB+B^2=(A-jB)(A-j^2B)$ where $j=e^{\frac{2i\pi}3}$, and since $A$ and $B$ have real coefficients,
$$\det(A^2+AB+B^2 ) = \det(A-jB)\det(A-j^2B) \\ = \det(A-jB) \overline{\det(A-jB)} =|\det(A-jB)|^2\geq 0$$
This generalizes easily to $$\det(A^2 + 2\Re(z) AB+|z|^2B)\geq 0$$ where $z\in \mathbb C$.