If $A,B$ are real symmetric $n\times n$ matrices with $A^{2k+1}=B^{2k+1}$, then is $A=B$? Let $A,B$ be two $n\times n$ real symmetric matrices with $A^{2k+1}=B^{2k+1}$ for some integer $k\geq0$, then is it necessarily the case that $A=B$? We require the exponent to be odd since for any matrix, $(-A)^{2k}=A^{2k}$ so this statement is trivially false.
I know that $A,B$ must both have a basis of orthogonal eigenvectors, so $A=Q_1\Lambda_1Q_1^T$ and $B=Q_2\Lambda_2Q_2^T$ with $\Lambda_i$ diagonal and $Q_iQ_i^T=I_n$ ($i=1,2$), so the equation is equivalent to $Q_1\Lambda_1^{2k+1}Q_1^T=Q_2\Lambda_2^{2k+1}Q_2^T$. I'm not sure how to continue from here except to write $(Q_2^TQ_1)\Lambda_1^{2k+1}(Q_2^TQ_1)^T=\Lambda_2^{2k+1}$.
Moreover, can we somehow generalize this?
 A: $\newcommand{\diag}{\mathrm{diag}}$
You made a good attempt. To continue, let $\Lambda_1 = \diag(\lambda_1, \ldots, 
\lambda_n), \Lambda_2 = \diag(\mu_1, \ldots, \mu_n)$. Then you have reached
\begin{align*}
Q_2^TQ_1\diag(\lambda_1^{2k + 1}, \ldots, \lambda_n^{2k + 1}) 
= \diag(\mu_1^{2k + 1}, \ldots, \mu_n^{2k + 1})Q_2^TQ_1.
\end{align*}
Denote $Q_2^TQ_1$ by $P = (p_{ij})_{n  \times n}$, then comparing the $(i, j)$ entries of both sides of
$$P\diag(\lambda_1^{2k + 1}, \ldots, \lambda_n^{2k + 1}) = \diag(\mu_1^{2k + 1}, \ldots, \mu_n^{2k + 1})P$$
yields $p_{ij}\lambda_j = \mu_ip_{ij}$, i.e.,
$$P\diag(\lambda_1, \ldots, \lambda_n) = \diag(\mu_1, \ldots, \mu_n)P.$$
That is, $A = B$.
Similar argument is also used in showing the square root of a positive semi-definite symmetric matrix is unique.
A: Maybe interpreting the process of diagonalizing $A$ as finding a similar matrix rather than congruence can help you directly find the way out. Remember that similar matrices share the same characteristic polynomial, and that whatever $k\in\mathbb{N}$ is, $f(x)=x^{2k+1}$ is a bijection over $f:\mathbb{R}\to\mathbb{R}$.
