1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Completing the square

  1. Dec 14, 2011 #1
    How do I complete the square for: [tex]x^2 + 2y^2 + 2z^2 + 4xy +4xz + 4yz[/tex]
    I can do it for a normal quadratic [itex]ax^2 + bx + c[/itex] but how do I do it for something like this with more than one variable?
  2. jcsd
  3. Dec 14, 2011 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Gold Member

    I doubt that there is one particular "correct" result for this.

    Notice that this polynomial does contain a perfect square for two of the variables, y & z: [itex]2y^2+4yz+2z^2=2(y+z)^2\,. [/itex]

    Factor 4x out of the two remaining "mixed" terms.
    I see two ways to finish. You can figure out how many terms of (y+z)2 to add & subtract, or you can figure out how many terms of x2 to add & subtract. The latter way gives a simpler looking answer.
  4. Dec 14, 2011 #3
    I've got it equal to the sum of squares: [tex]2(x+y+z)^2 - x^2[/tex] What does this mean the rank and signature is? There is 1 positive square and 1 negative square so is the rank 1+1=2 and the signature 1-1=0?
  5. Dec 14, 2011 #4

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    You can apply (essentially) the algorithm that leads to Cholesky factorization of a matrix. In your example, start by looking at the x-terms, which are [itex] x^2 + 4xz + 4yz .[/itex] These are what you would get if you looked at [itex] (x+2y+2z)^2, [/itex] because that is where you would get terms of the form 4xy and 4xz. Anyway, we have [tex] x^2 + 4xy + 4xz = (x+2y + 2z)^2 - 4y^2 - 4z^2 - 8yz, [/tex], so your function f(x,y,z) is
    [tex] (x+2y+2z)^2 -2y^2 - 2z^2 -4yz. [/tex] Now [tex]2y^2+2z^2+4yz = 2(y+z)^2,[/tex]
    so we finally have [tex] f(x,y,z) = (x+2y+2z)^2-2(y+z)^2. [/tex]

  6. Dec 14, 2011 #5
    So is the rank 2 and the signature 0?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook