Orthogonal Change of Variables

Find an orthogonal change of variables X=PY such that:

–2x1^2 + 2x1x2 - 2x2^2

takes the form:

Ay1^2 + By2^2

Sorry if this may be confusing. The numbers next to the variables should be subscripts. For instance x1^2 should be x subscript 1 to the power of 2.

confused about the same type of problem

my problem is find an orthogonal change in variables x=py such that

4x1^2 + 10x1x2 + 4x2^2

takes the form ?x1^2 + ?x2^2

p=?

the question marks are blanks for answers, there should be subscripts and ^2 is squared

so i think i understand how to find p... you diagonalize and find the eigenvectors, but i dont know how to answer the x1^2 + x2^2 part.