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

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*}
