Are these two matrices equal? Let $M$ be a $n\times n$ definite positive real diagonalizable matrix and $D$ the diagonal matrix of eigenvalues of $M$ (all positive, then). Let $P$ be a matrix the columns of which form a basis of eigenvectors. Then we have $M=PDP^{-1}$.
As $P$ is not unique, let $Q$ be another matrix the columns of which form an another basis of eigenvectors. Then we have $M=QDQ^{-1}$.
Now suppose I have to deal with two matrices which are: $A=PD^{1/2}P^{-1}$ and $B=QD^{1/2}Q^{-1}$...
Can I conclude that $A=B$ ? It's my first intuition, but I couldn't manage to go through any demonstration or any counter-example. Could you provide me some help?
 A: The answer is yes. If $\lambda$ und $\mu$ are two (positive) eigenvalues, then we have $\lambda =\mu \iff \sqrt\lambda = \sqrt\mu$ (since we take positive roots, right?). This implies that for $X\in {\rm GL}_n(\Bbb R)$ we have the equivalences
$$
\begin{align*}
XDX^{-1} = D &\iff D^{-1}XD = X\\
&\iff (D^{1/2})^{-1} XD^{1/2} = X\\
&\iff XD^{1/2}X^{-1} = D^{1/2}.
\end{align*}
$$
More precisely, if $D$ has the form ${\rm diag}(\lambda_1I_{n_1},\dotsc, \lambda_r I_{n_r})$ (with $I_{n_j}$ the $n_j\times n_j$-identity matrix and $\lambda_i\neq \lambda_j$ for $i\neq j$) then 
$$
\{X\in {\rm GL}_n(\Bbb R) \mid D^{-1}XD = X\} = {\rm diag}({\rm GL}_{n_1}(\Bbb R),\dotsc, {\rm GL}_{n_r}(\Bbb R)).
$$
(And the same for $D$ replaced by $D^{1/2}$.)
Now take $P,Q \in {\rm GL}_n(\Bbb R)$ with $PDP^{-1} = QDQ^{-1}$. Then $(Q^{-1}P) D (Q^{-1}P)^{-1} = D$, so by the above also $(Q^{-1}P) D^{1/2} (Q^{-1}P)^{-1} = D^{1/2}$. Therefore, $PD^{1/2}P^{-1} = QD^{1/2}Q^{-1}$.
A: Yes. Suppose $\lambda_1,\ldots,\lambda_k$ are the distinct eigenvalues of $M$ (so that $1\le k\le n$). Let $f$ be any polynomial such that $f(\lambda_i)=\lambda_i^{1/2}$ (e.g. take $f$ as a Lagrange interpolation polynomial). Then $f(D)=D^{1/2}$. It follows that
$$
A=PD^{1/2}P^{-1}=Pf(D)P^{-1}=f(PDP^{-1})=f(M)
$$
and similarly $B=f(M)$ too.
