# Diagonal Matrix Problem

Could someone check if the solution of the problem is right?

Problem:

Let $$A, B \in \mathbb{C}^{n\times n}$$ be selfadjoint ,such that $$[A,B] := AB − BA = 0$$ Show that there is a unitary matrix $$U \in \mathbb{C}^{n\times n}$$ such that $$U^*$$A$$U$$ and $$U^*BU$$ are both diagonal.

Solution:

Let $$D$$1 =$$U^*$$A$$U$$ and $$D$$2 =$$U^*BU$$ .

As $$A$$ and $$B$$ are selfadjoint follows that $$D^*$$=$$(U^*AU)^*$$= $$U^*AU$$=$$D$$1, so $$D$$1 is hermitian, which also means that $$D$$1 must be diagonal ?

• No it's wrong. you don't have the same $U$ for $A$ and $B$ in the beginning. – Yanko Jan 13 at 15:10

No, it is not right. You started your solution by saying “Let $$D_1=U^*AU$$”, without saying what $$U$$ is.
• @Kai The problem asks you to find such unitary $U$. – xbh Jan 13 at 15:16
• @Kai No. What you are supposed to prove is that there is an unitary matrix $U$ such that both matrices $U^*AU$ and $U^*BU$ are diagonal. – José Carlos Santos Jan 13 at 15:32