# Diagonalising the form by completing the square [closed]

Write down the matrix A associated to the quadratic form $$3x^2 + 3y^2+3z^2-2xy-2xz-2yz$$ Classify the form as positive/negative definite/semidefinite, or indefinite. Diagonalise the form by completing the square.

I've worked out the matrix which is:

$$\begin{pmatrix} 3 & -1 & -1 \\ -1 & 3 & -1 \\ -1 & -1 & 3 \\ \end{pmatrix}$$

How would I then complete the square to diagoanlise the form?

Any help is much appreciated :) Thank you!

## closed as off-topic by Namaste, user284331, Saad, Ethan Bolker, user223391 Apr 7 '18 at 3:43

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Namaste, user284331, Saad, Ethan Bolker, Community
If this question can be reworded to fit the rules in the help center, please edit the question.

In this case, it's quite simple:$$3x^2 + 3y^2+3z^2-2xy-2xz-2yz=(-x+y+z)^2+(x-y+z)^2+(x+y-z)^2.$$

There is the intuitive leap as in the other answer, but if you want a systematic method there is the beginning. $$3x^2 + 3y^2+3z^2-2xy-2xz-2yz$$ collect all $x$ terms $$=3(x^2 -\frac{2}{3}x(y+z))+ 3y^2+3z^2-2yz$$ complete the square $$=3(x^2 -\frac{2}{3}x(y+z)+\frac{(y+z)^2}{9}) -\frac{(y+z)^2}{3}+ 3y^2+3z^2-2yz$$ $$=3(x -\frac{1}{3}(y+z))^2-\frac{(y+z)^2}{3}+ 3y^2+3z^2-2yz$$ now factor the $y,z$ terms.

• Hi sorry, just going back to this again. Should it not be x in the last line of working as opposed to x^2? – TheReal7 Apr 16 '18 at 12:20

Algorithm discussed at http://math.stackexchange.com/questions/1388421/reference-for-linear-algebra-books-that-teach-reverse-hermite-method-for-symmetr
$$H = \left( \begin{array}{rrr} 3 & - 1 & - 1 \\ - 1 & 3 & - 1 \\ - 1 & - 1 & 3 \\ \end{array} \right)$$ $$D_0 = H$$

$$E_j^T D_{j-1} E_j = D_j$$ $$P_{j-1} E_j = P_j$$ $$E_j^{-1} Q_{j-1} = Q_j$$ $$P_j Q_j = Q_j P_j = I$$ $$P_j^T H P_j = D_j$$ $$Q_j^T D_j Q_j = H$$

$$H = \left( \begin{array}{rrr} 3 & - 1 & - 1 \\ - 1 & 3 & - 1 \\ - 1 & - 1 & 3 \\ \end{array} \right)$$

==============================================

$$E_{1} = \left( \begin{array}{rrr} 1 & \frac{ 1 }{ 3 } & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right)$$ $$P_{1} = \left( \begin{array}{rrr} 1 & \frac{ 1 }{ 3 } & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; Q_{1} = \left( \begin{array}{rrr} 1 & - \frac{ 1 }{ 3 } & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; D_{1} = \left( \begin{array}{rrr} 3 & 0 & - 1 \\ 0 & \frac{ 8 }{ 3 } & - \frac{ 4 }{ 3 } \\ - 1 & - \frac{ 4 }{ 3 } & 3 \\ \end{array} \right)$$

==============================================

$$E_{2} = \left( \begin{array}{rrr} 1 & 0 & \frac{ 1 }{ 3 } \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right)$$ $$P_{2} = \left( \begin{array}{rrr} 1 & \frac{ 1 }{ 3 } & \frac{ 1 }{ 3 } \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; Q_{2} = \left( \begin{array}{rrr} 1 & - \frac{ 1 }{ 3 } & - \frac{ 1 }{ 3 } \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; D_{2} = \left( \begin{array}{rrr} 3 & 0 & 0 \\ 0 & \frac{ 8 }{ 3 } & - \frac{ 4 }{ 3 } \\ 0 & - \frac{ 4 }{ 3 } & \frac{ 8 }{ 3 } \\ \end{array} \right)$$

==============================================

$$E_{3} = \left( \begin{array}{rrr} 1 & 0 & 0 \\ 0 & 1 & \frac{ 1 }{ 2 } \\ 0 & 0 & 1 \\ \end{array} \right)$$ $$P_{3} = \left( \begin{array}{rrr} 1 & \frac{ 1 }{ 3 } & \frac{ 1 }{ 2 } \\ 0 & 1 & \frac{ 1 }{ 2 } \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; Q_{3} = \left( \begin{array}{rrr} 1 & - \frac{ 1 }{ 3 } & - \frac{ 1 }{ 3 } \\ 0 & 1 & - \frac{ 1 }{ 2 } \\ 0 & 0 & 1 \\ \end{array} \right) , \; \; \; D_{3} = \left( \begin{array}{rrr} 3 & 0 & 0 \\ 0 & \frac{ 8 }{ 3 } & 0 \\ 0 & 0 & 2 \\ \end{array} \right)$$

==============================================

$$P^T H P = D$$ $$\left( \begin{array}{rrr} 1 & 0 & 0 \\ \frac{ 1 }{ 3 } & 1 & 0 \\ \frac{ 1 }{ 2 } & \frac{ 1 }{ 2 } & 1 \\ \end{array} \right) \left( \begin{array}{rrr} 3 & - 1 & - 1 \\ - 1 & 3 & - 1 \\ - 1 & - 1 & 3 \\ \end{array} \right) \left( \begin{array}{rrr} 1 & \frac{ 1 }{ 3 } & \frac{ 1 }{ 2 } \\ 0 & 1 & \frac{ 1 }{ 2 } \\ 0 & 0 & 1 \\ \end{array} \right) = \left( \begin{array}{rrr} 3 & 0 & 0 \\ 0 & \frac{ 8 }{ 3 } & 0 \\ 0 & 0 & 2 \\ \end{array} \right)$$ $$Q^T D Q = H$$ $$\left( \begin{array}{rrr} 1 & 0 & 0 \\ - \frac{ 1 }{ 3 } & 1 & 0 \\ - \frac{ 1 }{ 3 } & - \frac{ 1 }{ 2 } & 1 \\ \end{array} \right) \left( \begin{array}{rrr} 3 & 0 & 0 \\ 0 & \frac{ 8 }{ 3 } & 0 \\ 0 & 0 & 2 \\ \end{array} \right) \left( \begin{array}{rrr} 1 & - \frac{ 1 }{ 3 } & - \frac{ 1 }{ 3 } \\ 0 & 1 & - \frac{ 1 }{ 2 } \\ 0 & 0 & 1 \\ \end{array} \right) = \left( \begin{array}{rrr} 3 & - 1 & - 1 \\ - 1 & 3 & - 1 \\ - 1 & - 1 & 3 \\ \end{array} \right)$$

...............