Given a matrix M, find the matrix cos((pi)M/6). I solved this question using diagonalizing method. But the answer is changing if I change the positions of the eigenvalues. That is if write the eigenvalues as pi/6 and pi/2. I am getting the answer which is mentioned but if I switch the position and write pi/2 and pi/6, I am getting an answer with the negative signs switched. Can someone help?