Completing the square to decompose quadratic forms in three variables











up vote
0
down vote

favorite












Given the quadratic form $Q(textbf{x}) = x^2 + 2xy - 4xz +2yz -4z^2$, the question asks to decompose $Q$ into sums of squares, first by eliminating terms in $z$, then terms in $y$, and then terms in $x$.



I know the signature of $Q$ is $(2,1)$ from the solution, but I'm at a loss for how to actually perform what the question is asking. For instance, I recognize that I can take the terms in $x$ and $z$ and form $(x-2z)^2$, but I don't really see what to do next. Any suggestions?










share|cite|improve this question







New contributor




Matt Swanson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Is there a typo? $(x-2z)^2$ doesn't give $-4z^2.$
    – user376343
    2 days ago















up vote
0
down vote

favorite












Given the quadratic form $Q(textbf{x}) = x^2 + 2xy - 4xz +2yz -4z^2$, the question asks to decompose $Q$ into sums of squares, first by eliminating terms in $z$, then terms in $y$, and then terms in $x$.



I know the signature of $Q$ is $(2,1)$ from the solution, but I'm at a loss for how to actually perform what the question is asking. For instance, I recognize that I can take the terms in $x$ and $z$ and form $(x-2z)^2$, but I don't really see what to do next. Any suggestions?










share|cite|improve this question







New contributor




Matt Swanson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Is there a typo? $(x-2z)^2$ doesn't give $-4z^2.$
    – user376343
    2 days ago













up vote
0
down vote

favorite









up vote
0
down vote

favorite











Given the quadratic form $Q(textbf{x}) = x^2 + 2xy - 4xz +2yz -4z^2$, the question asks to decompose $Q$ into sums of squares, first by eliminating terms in $z$, then terms in $y$, and then terms in $x$.



I know the signature of $Q$ is $(2,1)$ from the solution, but I'm at a loss for how to actually perform what the question is asking. For instance, I recognize that I can take the terms in $x$ and $z$ and form $(x-2z)^2$, but I don't really see what to do next. Any suggestions?










share|cite|improve this question







New contributor




Matt Swanson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











Given the quadratic form $Q(textbf{x}) = x^2 + 2xy - 4xz +2yz -4z^2$, the question asks to decompose $Q$ into sums of squares, first by eliminating terms in $z$, then terms in $y$, and then terms in $x$.



I know the signature of $Q$ is $(2,1)$ from the solution, but I'm at a loss for how to actually perform what the question is asking. For instance, I recognize that I can take the terms in $x$ and $z$ and form $(x-2z)^2$, but I don't really see what to do next. Any suggestions?







real-analysis quadratic-forms






share|cite|improve this question







New contributor




Matt Swanson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|cite|improve this question







New contributor




Matt Swanson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|cite|improve this question




share|cite|improve this question






New contributor




Matt Swanson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 days ago









Matt Swanson

132




132




New contributor




Matt Swanson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Matt Swanson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Matt Swanson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Is there a typo? $(x-2z)^2$ doesn't give $-4z^2.$
    – user376343
    2 days ago


















  • Is there a typo? $(x-2z)^2$ doesn't give $-4z^2.$
    – user376343
    2 days ago
















Is there a typo? $(x-2z)^2$ doesn't give $-4z^2.$
– user376343
2 days ago




Is there a typo? $(x-2z)^2$ doesn't give $-4z^2.$
– user376343
2 days ago










1 Answer
1






active

oldest

votes

















up vote
0
down vote













a method. Usually we take the matrix $H$ to be the Hessian matrix of second partial derivatives. In the special case of integer coefficients with all the mixed coefficent terms even, we can get $H$ all integers by taking half the Hessian matrix.



Outcome this time:



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

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



It is the diagonal elements of $D$ and the rows of $Q$ that give the expression,
$$ color{red}{ (x+y-2z)^2 - (y-3z)^2 + z^2 } $$



Algorithm discussed at http://math.stackexchange.com/questions/1388421/reference-for-linear-algebra-books-that-teach-reverse-hermite-method-for-symmetr
https://en.wikipedia.org/wiki/Sylvester%27s_law_of_inertia
$$ H = left(
begin{array}{rrr}
1 & 1 & - 2 \
1 & 0 & 1 \
- 2 & 1 & - 4 \
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}
1 & 1 & - 2 \
1 & 0 & 1 \
- 2 & 1 & - 4 \
end{array}
right)
$$



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



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

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



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



$$ E_{2} = left(
begin{array}{rrr}
1 & 0 & 2 \
0 & 1 & 0 \
0 & 0 & 1 \
end{array}
right)
$$

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



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



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

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



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



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

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






share|cite|improve this answer





















    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "69"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    Matt Swanson is a new contributor. Be nice, and check out our Code of Conduct.










     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3005447%2fcompleting-the-square-to-decompose-quadratic-forms-in-three-variables%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    a method. Usually we take the matrix $H$ to be the Hessian matrix of second partial derivatives. In the special case of integer coefficients with all the mixed coefficent terms even, we can get $H$ all integers by taking half the Hessian matrix.



    Outcome this time:



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

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



    It is the diagonal elements of $D$ and the rows of $Q$ that give the expression,
    $$ color{red}{ (x+y-2z)^2 - (y-3z)^2 + z^2 } $$



    Algorithm discussed at http://math.stackexchange.com/questions/1388421/reference-for-linear-algebra-books-that-teach-reverse-hermite-method-for-symmetr
    https://en.wikipedia.org/wiki/Sylvester%27s_law_of_inertia
    $$ H = left(
    begin{array}{rrr}
    1 & 1 & - 2 \
    1 & 0 & 1 \
    - 2 & 1 & - 4 \
    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}
    1 & 1 & - 2 \
    1 & 0 & 1 \
    - 2 & 1 & - 4 \
    end{array}
    right)
    $$



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



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

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



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



    $$ E_{2} = left(
    begin{array}{rrr}
    1 & 0 & 2 \
    0 & 1 & 0 \
    0 & 0 & 1 \
    end{array}
    right)
    $$

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



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



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

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



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



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

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






    share|cite|improve this answer

























      up vote
      0
      down vote













      a method. Usually we take the matrix $H$ to be the Hessian matrix of second partial derivatives. In the special case of integer coefficients with all the mixed coefficent terms even, we can get $H$ all integers by taking half the Hessian matrix.



      Outcome this time:



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

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



      It is the diagonal elements of $D$ and the rows of $Q$ that give the expression,
      $$ color{red}{ (x+y-2z)^2 - (y-3z)^2 + z^2 } $$



      Algorithm discussed at http://math.stackexchange.com/questions/1388421/reference-for-linear-algebra-books-that-teach-reverse-hermite-method-for-symmetr
      https://en.wikipedia.org/wiki/Sylvester%27s_law_of_inertia
      $$ H = left(
      begin{array}{rrr}
      1 & 1 & - 2 \
      1 & 0 & 1 \
      - 2 & 1 & - 4 \
      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}
      1 & 1 & - 2 \
      1 & 0 & 1 \
      - 2 & 1 & - 4 \
      end{array}
      right)
      $$



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



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

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



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



      $$ E_{2} = left(
      begin{array}{rrr}
      1 & 0 & 2 \
      0 & 1 & 0 \
      0 & 0 & 1 \
      end{array}
      right)
      $$

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



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



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

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



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



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

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






      share|cite|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        a method. Usually we take the matrix $H$ to be the Hessian matrix of second partial derivatives. In the special case of integer coefficients with all the mixed coefficent terms even, we can get $H$ all integers by taking half the Hessian matrix.



        Outcome this time:



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

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



        It is the diagonal elements of $D$ and the rows of $Q$ that give the expression,
        $$ color{red}{ (x+y-2z)^2 - (y-3z)^2 + z^2 } $$



        Algorithm discussed at http://math.stackexchange.com/questions/1388421/reference-for-linear-algebra-books-that-teach-reverse-hermite-method-for-symmetr
        https://en.wikipedia.org/wiki/Sylvester%27s_law_of_inertia
        $$ H = left(
        begin{array}{rrr}
        1 & 1 & - 2 \
        1 & 0 & 1 \
        - 2 & 1 & - 4 \
        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}
        1 & 1 & - 2 \
        1 & 0 & 1 \
        - 2 & 1 & - 4 \
        end{array}
        right)
        $$



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



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

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



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



        $$ E_{2} = left(
        begin{array}{rrr}
        1 & 0 & 2 \
        0 & 1 & 0 \
        0 & 0 & 1 \
        end{array}
        right)
        $$

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



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



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

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



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



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

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






        share|cite|improve this answer












        a method. Usually we take the matrix $H$ to be the Hessian matrix of second partial derivatives. In the special case of integer coefficients with all the mixed coefficent terms even, we can get $H$ all integers by taking half the Hessian matrix.



        Outcome this time:



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

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



        It is the diagonal elements of $D$ and the rows of $Q$ that give the expression,
        $$ color{red}{ (x+y-2z)^2 - (y-3z)^2 + z^2 } $$



        Algorithm discussed at http://math.stackexchange.com/questions/1388421/reference-for-linear-algebra-books-that-teach-reverse-hermite-method-for-symmetr
        https://en.wikipedia.org/wiki/Sylvester%27s_law_of_inertia
        $$ H = left(
        begin{array}{rrr}
        1 & 1 & - 2 \
        1 & 0 & 1 \
        - 2 & 1 & - 4 \
        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}
        1 & 1 & - 2 \
        1 & 0 & 1 \
        - 2 & 1 & - 4 \
        end{array}
        right)
        $$



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



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

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



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



        $$ E_{2} = left(
        begin{array}{rrr}
        1 & 0 & 2 \
        0 & 1 & 0 \
        0 & 0 & 1 \
        end{array}
        right)
        $$

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



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



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

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



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



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

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







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered 2 days ago









        Will Jagy

        100k597198




        100k597198






















            Matt Swanson is a new contributor. Be nice, and check out our Code of Conduct.










             

            draft saved


            draft discarded


















            Matt Swanson is a new contributor. Be nice, and check out our Code of Conduct.













            Matt Swanson is a new contributor. Be nice, and check out our Code of Conduct.












            Matt Swanson is a new contributor. Be nice, and check out our Code of Conduct.















             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3005447%2fcompleting-the-square-to-decompose-quadratic-forms-in-three-variables%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            MongoDB - Not Authorized To Execute Command

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

            Npm cannot find a required file even through it is in the searched directory