Prove that $ \det(A^4 + A^2 B^2 + 2A^2 + I) \geq 0 $ Problem:
Let $ A $ and $ B $ be an $ n \times n $ matrices with real entries. If $ AB = -BA $, prove that
$$ {\det}{\left(A^4 + A^2B^2 + 2A^2 + I\right)} \geq 0. $$
My Approach:
If $ A $ invertible, then
$$ AB = -BA \implies AA^{-1}B = -BA^{-1}A \implies B = -B \implies B = O. $$
So,
$$ {\det}{\left(A^4 + A^2B^2 + 2A^2 + I\right)} = {\det}{\left(A^4 + 2A^2 + I\right)} = {\det}{\left(\left(A^2 + I\right)^{2}\right)} = \left({\det}{\left(A^{2} + I\right)}\right)^2 \geq 0. $$
If $ B $ invertible, then
$$ AB = -BA \implies AB^{-1}B = -BB^{-1}A \implies A = -A \implies A = O. $$
So,
$$ {\det}{\left(A^4 + A^2B^2 + 2A^2 + I\right)} = {\det}{(I)} = 1 \geq 0. $$
My Questions:

*

*Can we 'center' multiply both sides of the equation $ AB = -BA $ with a matrix? For example, in my solutions, $ AB = -BA \implies AA^{-1}B = -BA^{-1}A $.

*How do we prove it when $ A $ and $ B $ not invertible?

Thanks
 A: Since $AB=-BA$, so we have $A^2B^2=-(AB)^2$. Now consider the matrix
\begin{align*}
\det(A^4+A^2B^2+2A^2+I)&=\det((A^4+2A^2+I)\color{magenta}{-(AB)^2})\\
&=\det((A^2+I)^2-(AB)^2)\\
&=\det((A^2-AB+I)(A^2+AB+I))\\
&=\det((A^2+\color{blue}{BA}+I)(A^2+AB+I))\\
&=\det(A^2+BA+I)\det(A^2+AB+I)\\
&=\det((A+B)A+I)\det(A(A+B)+I)\\
&=\det((A+B)A+I)^2\\
& \geq 0. & (\because \, A,B \in M_{n}(\Bbb{R}))
\end{align*}
For the second to last line use the result given here:
Sylvester's determinant identity
OR you can check out Weinstein–Aronszajn identity
to show that
$$\det((A+B)A+I)=\det(A(A+B)+I)$$
Note:

Based on @Pythagoras's suggestion, I am adding the following proof for the fact that $AB$ commutes with $A^2+I$. This is required for the (third) step in which I did the factorization:
\begin{align*}
(A^2+I)AB&=A^3B+AB\\
&=A^2(\color{blue}{-BA})\color{blue}{-BA}\\
&=-A(AB)A-BA\\
&=A(BA)A-BA\\
&=(AB)A^2-BA\\
&=-BA^3-BA\\
&=-BA(A^2+I)\\
&=AB(A^2+I).
\end{align*}
A: This answer is not really different from Anurag A's, but I think it is clearer to present the answer in the way below.
Let $A=\pmatrix{0&A_2\\ 0&A_4}$ where $A_4$ is invertible. The condition $AB=-BA$ implies that $B=\pmatrix{B_1&B_2\\ 0&B_4}$ where $A_4$ and $B_4$ anti-commute. Hence it suffices to prove the inequality for the matrix pairs $(0,B_1)$ and $(A_4,B_4)$, i.e., for the cases where $A$ is either zero or invertible.
When $A$ is zero, the determinant is $1$ and the inequality is true. When $A$ is invertible, we have
$$
\det(A^4+A^2B^2+2A^2+I)
=\det(A)^2\det\left(B^2+(A+A^{-1})^2\right).\tag{1}
$$
Since $A$ anti-commutes with $B$, so do $A^{-1}$ and $A+A^{-1}$. In general, if $BC+CB=0$, then $B^2+C^2=(B+C)^2$. Therefore the RHS of $(1)$ is equal to $\left[\det(A)\det(B+A+A^{-1})\right]^2$, which is nonnegative because $A$ and $B$ are real.
