Is the orthogonal decomposition of a symmetric matrix unique? Suppose I have a real symmetric matrix $M$, and it can be decomposed in two ways: $M = AUA^T$ and $M = BVB^T$, where


*

*$U$ and $V$ are diagonal matrices

*The columns of $A$ are orthonormal to each other

*The columns of $B$ are also orthonormal to each other.


Can we say that $U = V$ and $A = B$?
 A: No, for example if $A$ is any orthogonal matrix then $I(I)I^T = A(I)A^T$ are two different decompositions of the identity.
Also if $B$ is a permutation matrix and $U$ is diagonal then $B^TUB$ is diagonal $AB$ is orthogonal and $AUA^T = (AB)(B^TUB)(AB)^T$.
What is true is that the entries of the diagonal matrix $U$ will be the eigenvalues (with multiplicity) of $M$, so $U$ will be unique up to a permutation.
A: No.  Unless all of the eigenvalues are the same, $U$ is not necessarily equal to $V$ because we can permute the diagonal entries to get a different diagonal matrix.
Also, $A$ is not necessarily equal to $B.$  Following is an example in which even if we fix $U,$ we can find an infinite number of orthogonal matrices $A$ such that $M = AUA^{\mathrm T}.$  The key to the example is that an eigenvalue of $M$ is repeated.
Consider
$$M = \begin{pmatrix}
10 &  2 &  2 \\
 2 & 13 &  4 \\
 2 &  4 & 13
\end{pmatrix}.$$
The eigenvalues are $18, 9, 9,$ and the corresponding eigenvectors are
$$\begin{pmatrix}
1 \\
2 \\
2
\end{pmatrix},
\begin{pmatrix}
-2 \\
 0 \\
 1
\end{pmatrix},
\begin{pmatrix}
-2 \\
 1 \\
 0
\end{pmatrix}.$$
Let us fix $U$ as
$$U = \begin{pmatrix}
18 & 0 & 0 \\
 0 & 9 & 0 \\
 0 & 0 & 9
\end{pmatrix}.$$
If all of the eigenvalues were different, we would use the corresponding eigenvectors, normalized, for the columns of $A.$  Because, however, $9$ is a repeated eigenvalue, its two eigenvectors are not necessarily orthogonal, which is the case here.  But we can use, for example, the Gram-Schmidt process, to get an orthogonal basis and then normalize those vectors to get $A:$
$$A = \begin{pmatrix}
\frac13 & \frac{-2}{\sqrt{5}} & \frac{-2}{\sqrt{45}} \\
\frac23 & 0                   & \frac5{\sqrt{45}} \\
\frac23 & \frac1{\sqrt{5}}    & \frac{-4}{\sqrt{45}}
\end{pmatrix}.$$
Now the eigenspace associated with eigenvalue $9$ is the plane through the origin and perpendicular to the other eigenvector $(1, 2, 2)^{\mathrm T},$ so we can use any pair of orthonormal vectors in that plane to form the second two columns of $A.$  One way to get other such pairs of vectors is to rotate the two that we already have (the second and third columns of $A$) about the axis in line with $(1, 2, 2)^{\mathrm T}.$  I used the formula after Lemma 98 in the article "Rotation About an Arbitrary Axis" to get a matrix that performs that rotation:
$$\begin{pmatrix}
\frac{1- \cos\theta}9 + \cos\theta & \frac{2(1- \cos\theta)}9 - \frac{2\sin\theta}3 & \frac{2(1 - \cos\theta)}9 + \frac{2\sin\theta}3 \\
\frac{2(1- \cos\theta)}9 + \frac{2\sin\theta}3 & \frac{4(1- \cos\theta)}9 + \cos\theta & \frac{4(1- \cos\theta)}9 - \frac{\sin\theta}3 \\
\frac{2(1 - \cos\theta)}9 - \frac{2\sin\theta}3 & \frac{4(1- \cos\theta)}9 + \frac{\sin\theta}3 & \frac{4(1- \cos\theta)}9 + \cos\theta
\end{pmatrix} = R_\theta$$
where $\theta$ is the angle of rotation.
Then $M = (R_\theta A)U(R_\theta A)^{\mathrm T}$ where the columns of $R_\theta A$ are orthonormal to each other.  Thus, there are an infinite number of ways (by choosing any real number for $\theta$) to decompose $M$ as you requested.
