Let $k\in\mathbb{N}$ and $A,B\in M_n(\mathbb{R})$ such that $AB-BA=A^k$. Show that $A$ is not invertible.
I can show the claim if $k=1$: Assume that $A$ is invertible. We have $AB=(I_n+B)A$, so $B=A^{-1}(I_n+B)A$. Taking the trace gives a contradiction.
How can I proceed for the general case?
Use the same idea: $A^{-k}(AB-BA)=I_n$ implies that $A^{1-k}B-A^{-k}BA=I_n$, we deduce that:
$A^{1-k}B=I_n+A^{-k}BA$ and $tr(A^{1-k}B)=Tr(I_n)+Tr(A^{-k}BA)$, since $Tr(A^{1-k}B)=Tr(A^{-k}BA)$ you have the contradiction.