part A(i managed to solve it):

X is a variable of

where

are different rational numbers.

solve XD=DX for X.

solution:

so i get

so for both side to be equal X must be of diagonal structure

every member must be zero except the diagonal

because the lambda values are given as different.

part B(the one that i dont understand):

what is the solution space of XA=AX (use part A)??

i tried

XA=AX

XPDP^-1=PDP^-1X (multiplying by p from the right)

XPDP^-1P=PDP^-1XP

XPD=PDP^-1XP (multiplying by p^-1 from the left)

P^-1XPD=P^-1PDP^-1XP

P^-1XPD=DP^-1XP

another thing i could find is the eigen values of the matrix

i got

and

and

P^-1AP

i can substitute A by X but whats to do next??