I need to express this quadratic form $$\alpha^2+\alpha{x}+\beta{x}+xy-\beta^2$$ as a sum or difference of squares. (maximum 4 squares) How could I do that? It seem so difficult for me.
I let you know what I'm looking for in these two examples:
I. $x^2+2xy-4xz-6yz-z^2=\left(x+y-2z\right)^2-\left(y+z\right)^2-\left(2z\right)^2$
II. $x^2-2xy+xz=(x-y+\frac{1}{2}z)^2-(y-\frac{1}{2}z)^2$
Please help me figure it out!
Is there any algorithm for such thing that I want?