A symmetric matrix that is similar to a diagonal matrix Perhaps someone here can help me with a homework exercise.

Given a symmetric matrix $A$, find an orthogonal matrix $B$ such that $B^tAB=D$ is a diagonal matrix whose entries are arranged in ascending order. Moreover, choose $B$ so that in each column the first entry different from zero is positive.

I am completely stuck and would be delighted if someone could explain an approach. Thanks!
Hallo vieleicht kann einer mir hier ei einer Hausaufgabe aushelfen.

Gegeben ist eine symmetrische Matrix $A$. Finden Sie eine orthogonale Matrix $B$, so dass $B^t A B = D$ eine Diagonalmatrix ist, deren Einträge in aufsteigender Reihenfolge angeordnet sind. Wählen Sie $B$ außerdem so, dass der erste von Null verschiedene Eintrag in jeder Spalte positiv ist.

Ich bin total aufgeschmissen und würde mich freuen wenn mir jemand eine Vorgehensweise erklären könnte. Danke!
 A: As a hint I would review the eigendecomposition for a symmetric matrix. Also note that in an eigendecomposition the order of the eigenvalues can be changed in the diagonal matrix and eigenvectors may be multiplied by any constant since only their direction is important (e.g. if $Av = \lambda v$ works then $A(cv) = \lambda (cv)$ also works for $c \in \mathbb{R}$).      
A: Since $A$ is symmetric, all the eigenvalues are real, the dimension of each eigenspace is equal to the algebraic  multiplicity of its eigenvalue in the characteristic equation and eigenvectors from different eigenspaces are orthogonal. (i) Arrange the eigenvalues in order $\lambda_1<\lambda_2<...$. (ii) For each eigenvalue find an orthonormal basis ($e.g.$ by the Gram-Scmidt procedure) for the eigenspace. If necessary, multiply the eigevector by -1 to make its first non-zero entry positive.(iii) Consruct $B$ by writing down all these orthonormal bases side by side as column vectors, first those for $\lambda_1, \text { then those for }\lambda_2 . etc.$
Then $B$ will be an $n \times n$ matrix and $$B^TB=I,BD=DB \text { where }D=\text{diag}(\lambda_1,...)$$ so $$B^TAB=D.$$
