If one has a symmetric matrix $A$, one can diagonalize it with an orthonormal change of basis vectors, e.g. $S^TAS$ is diagonal. Now lets consider the following matrix $$A=\begin{bmatrix} 1&1\\ 1&2 \end{bmatrix}. $$ This matrix corresponds to the symmetric form $$x_1^2+2x_1x_2+2x_2^2=(x_1+x_2)^2+x_2^2.$$
For me this looks like there has to be a way of determining some $S$ as above (without having to diagonalize etc., just by completing of the square) by taking some change of variables $x_1\leadsto x_1+x_2,\ x_2\leadsto x_2$. This would be done by the matrix $$S=\begin{bmatrix} 1&1\\ 0&1 \end{bmatrix}$$ but this doesn't work out for me...
Any help will be gratefully appreciated.
Edit: Let me reformulate my question. By Sylvester's law of inertia there exists for every symmetric matrix $A$ some basis such that $S^TAS$ is diagonal with only 1,-1 and 0 on the diagonal, where $S$ is a (not necessarily orthogonal) invertible matrix. I want to determine $S$ without having to calculate all the eigenvalues and diagonalize $A$, because the eigenvalues dont occur in the wanted form.