Let $A,B$ be $2\times 2$ matrices such that $AB=BA$. Prove that for every positive integer $p$: $$ \det(A^p+B^p)=\det (A^p)+\det(B^p) +\operatorname{tr}\left(\left(A\operatorname{adj}(B)\right)^p\right) $$ where $\operatorname{adj}(B)$ is the classical adjoint of $B$.
I'm stuck with this problem. I tried with small $p$, but it is still difficult in those small cases. Maybe the Caley-Hamilton Theorem will have some help.
Thanks a lot.
Start by assuming that $A$ and $B$ are diagonal, so $$A=\begin{pmatrix} a & 0 \\ 0 & b \end{pmatrix}$$ and $$B=\begin{pmatrix} c & 0 \\ 0 & d \end{pmatrix}.$$
The left hand side of your equation is then $$(a^p+c^p)(b^p+d^p),$$ while the right hand side is $$a^pb^p+c^pd^p+(a^pd^p+b^pc^p),$$ the formula is correct.
Diagonalizable matrices are dense in all matrices, and the determinant and trace are unchanged by conjugation. Finally, since $A$ and $B$ commute, if they are diagonalizable then they are simultaneously diagonalizable. Hence the equation is true on a dense subset of all pairs of commuting matrices, which means it holds for all of them, since all functions and operations involved are continuous.
When you don't understand a problem simplify it till you can work an example.