# Putting an equation in quadratic form

1. Apr 28, 2010

e.g:
Q(x,y,z)=7x^2-2y^2-40z^2-14xz+20yz.

I know it equals 7(x-z)^2 -2(y-5z)^2 +3z^2. dnt know how to get there though.

2. Apr 28, 2010

Dnt wrry figured it out.

3. Apr 28, 2010

### CompuChip

What you want to do is first make a square which gets all the x terms right, then a square which gets all the y terms right, but without touching the x. Then in the end, you can use the z2 term to balance the z's.

So, for example, with an x you have 7x2 and -14xz.
If you write c (x - a)2, you will get terms with c x2 and 2 x a c, and stuff with a2, which you can cancel by -a2 terms, if you need. So you can reproduce these two terms by taking c = 7, a = -z.

Then you do the same with the y, choosing numbers c and a such that you exactly get the right y2 and yz terms.

Then, you multiply out everything you have so far. If you did it right, all the terms will match, except possibly those with only z2. Since z2 is itself a square, you can easily fix this by adding the appropriate amount of z2 at the end, and you're done.