Using matrix to complete the square

In summary, the process for finding the symmetric matrix that defines a quadratic form is to row reduce the matrix into row echelon form, and use the upper triangle matrix to complete the square.
  • #1
PhizKid1
2
0
Given a quadratic form: [tex]x^2 - 4xy + 6xz + 2xt + 4y^2 + 2yz + 4yt + 5z^2 - 6zt - t^2[/tex], find the symmetric matrix that defines this, row reduce this matrix into row echelon form, and use this upper triangle matrix to complete the square and write the quadratic form as the sum/difference of squares.So here is the matrix representation using x, y, z, and t as the diagonals from left to right and x being the first order, y second order, z third order, t fourth order:

[tex]\left[ \begin{array}{cccc}1 & -2 & 3 & 1 \\-2 & 4 & 1 & 2 \\3 & 1 & 5 & -3 \\1 & 2 & -3 & -1 \\\end{array} \right][/tex]

Row echelon:

[tex]\left[ \begin{array}{cccc}1 & -2 & 3 & 1 \\0 & 7 & -4 & -6 \\0 & 0 & 7 & 4 \\0 & 0 & 0 & \frac{174}{49} \\\end{array} \right][/tex]

NOTE: Rows 2 and 3 were switched during this process! (It was unavoidable.)

Now, I'm not sure what to do with this matrix, as it's no longer the same matrix that represents the original quadratic.
 
Physics news on Phys.org
  • #2
PhizKid said:
Given a quadratic form: [tex]x^2 - 4xy + 6xz + 2xt + 4y^2 + 2yz + 4yt + 5z^2 - 6zt - t^2[/tex], find the symmetric matrix that defines this, row reduce this matrix into row echelon form, and use this upper triangle matrix to complete the square and write the quadratic form as the sum/difference of squares.So here is the matrix representation using x, y, z, and t as the diagonals from left to right and x being the first order, y second order, z third order, t fourth order:

[tex]\left[ \begin{array}{cccc}1 & -2 & 3 & 1 \\-2 & 4 & 1 & 2 \\3 & 1 & 5 & -3 \\1 & 2 & -3 & -1 \\\end{array} \right][/tex]

Row echelon:

[tex]\left[ \begin{array}{cccc}1 & -2 & 3 & 1 \\0 & 7 & -4 & -6 \\0 & 0 & 7 & 4 \\0 & 0 & 0 & \frac{174}{49} \\\end{array} \right][/tex]

NOTE: Rows 2 and 3 were switched during this process! (It was unavoidable.)

Now, I'm not sure what to do with this matrix, as it's no longer the same matrix that represents the original quadratic.
Hi PhizKid, :)

To find the canonical form of this quadratic form follow the steps outlined in the following link.

Engineering Mathematics, Volume 2 > 2. Quadratic Forms > 2.7 Methods of Reduction of a Quadratic Form to a Canonical Form - Pg. : Safari Books Online
 
  • #3
Hi, it says I have to pay money to read it.
 
  • #4
PhizKid said:
Given a quadratic form: [tex]x^2 - 4xy + 6xz + 2xt + 4y^2 + 2yz + 4yt + 5z^2 - 6zt - t^2[/tex], find the symmetric matrix that defines this, row reduce this matrix into row echelon form, and use this upper triangle matrix to complete the square and write the quadratic form as the sum/difference of squares.So here is the matrix representation using x, y, z, and t as the diagonals from left to right and x being the first order, y second order, z third order, t fourth order:

[tex]\left[ \begin{array}{cccc}1 & -2 & 3 & 1 \\-2 & 4 & 1 & 2 \\3 & 1 & 5 & -3 \\1 & 2 & -3 & -1 \\\end{array} \right][/tex]

Row echelon:

[tex]\left[ \begin{array}{cccc}1 & -2 & 3 & 1 \\0 & 7 & -4 & -6 \\0 & 0 & 7 & 4 \\0 & 0 & 0 & \frac{174}{49} \\\end{array} \right][/tex]

NOTE: Rows 2 and 3 were switched during this process! (It was unavoidable.)

Now, I'm not sure what to do with this matrix, as it's no longer the same matrix that represents the original quadratic.
The usual echelon process is used on a matrix that encodes a system of linear equations. The matrix here encodes a quadratic form, so a slightly different form of echelon process is needed. I have not seen this process before, but it must work like this: For the matrix $\begin{bmatrix}1 & -2 & 3 & 1 \\-2 & 4 & 1 & 2 \\3 & 1 & 5 & -3 \\1 & 2 & -3 & -1\end{bmatrix}$, you start in the usual way, getting zeros down the first column. This reduces the matrix to $\begin{bmatrix}1 & -2 & 3 & 1 \\0&0&7&4 \\0&7&-4&-6 \\0&4&-6&0\end{bmatrix}$.

Next, you want to exchange rows 2 and 3. In the usual Gaussian reduction process where the matrix represents a system of linear equations, that corresponds to switching the order of two equations. But the situation here is different. Each row and each column of the matrix is associated with one of the variables $x,\ y,\ z,\ t$ in the quadratic form. When you interchange rows 2 and 3, you are effectively switching the variables $y$ and $z$, and this means that you must also interchange columns 2 and 3. So instead of getting the matrix $\begin{bmatrix}1 & -2 & 3 & 1 \\0&7&-4&-6 \\ 0&0&7&4 \\0&4&-6&0\end{bmatrix}$, you get $\begin{bmatrix}1 & 3&-2 & 1 \\0&-4&7&-6 \\ 0&7&0&4 \\0&-6&4&0\end{bmatrix}$. You can now continue the echelon process in the usual way. If I have not made arithmetic mistakes, the reduced matrix is $\begin{bmatrix}1 & 3&-2 & 1 \\0&-4&7&-6 \\ 0&0& \frac{49}4& -\frac{13}2 \\0&0&0& \frac{272}{49} \end{bmatrix}$.

The next stage of the problem is to read off the information from the echelon form of the matrix to get a sum of squares. This also is new territory for me, but it seems to work like this: Use the top row of the matrix as coefficients for a linear combination of $x,\ z,\ y,\ t$ (remembering that $y$ and $z$ have been interchanged!), to get $(x + 3z - 2y + t)^2$. For the remaining rows, the coefficient on the main diagonal of the matrix stays outside the brackets, and all the coefficients inside the bracket get divided by that coefficient. So the next row of the matrix gives $-4\bigl(z - \frac74y + \frac32t \bigr)^2$. The final result is that $$\begin{aligned}x^2 - 4xy\! &{}+ 6xz + 2xt + 4y^2 + 2yz + 4yt + 5z^2 - 6zt - t^2 \\ &= (x + 3z - 2y + t)^2 - 4\bigl(z - \tfrac74y + \tfrac32t \bigr)^2 + \tfrac{49}4\bigl(y - \tfrac{26}{49}t \bigr)^2 + \tfrac{272}{49}t^2. \end{aligned}$$ I have not checked it in detail, but it does seems as though that is a correct algebraic identity. Amazing! (Nod) In 40 years of teaching linear algebra, I never came across this procedure. It is not at all obvious why it works, and I would be interested to know the theory behind it.
 
  • #5
Opalg said:
It is not at all obvious why it works, and I would be interested to know the theory behind it.

It looks like an LDL Cholesky decomposition, which is guaranteed to exist for a symmetric matrix.
That is,
$$x^TAx= x^T L D L^T x = (L^T x) D (L^T x)$$
where L is a lower unitriangular matrix and D is a diagonal matrix.

It's new to me as well, although Sudharaka posted a thread a little while ago to bring a quadric in a normal form that looks like this.
It's quite a bit faster to classify a quadric, than the regular procedure to find eigenvalues and eigenvectors. :)
 

FAQ: Using matrix to complete the square

1. What is "completing the square" in matrix form?

"Completing the square" is a method used in algebra to convert a quadratic equation into a perfect square trinomial. In matrix form, completing the square involves manipulating the elements of a matrix to make it a perfect square matrix.

2. Why is completing the square useful?

Completing the square allows us to solve quadratic equations, find the vertex of a parabola, and graph quadratic functions. It is also a crucial step in solving systems of equations using the elimination method.

3. How do you use a matrix to complete the square?

To use a matrix to complete the square, follow these steps:

  1. Rewrite the quadratic equation in matrix form, with the coefficients of x and x² as the elements of a 2x2 matrix.
  2. Find the inverse of the coefficient matrix.
  3. Multiply both the original matrix and its inverse by the constant term in the equation.
  4. Add the resulting matrices together to get a perfect square matrix.
  5. Factor the perfect square matrix, and rearrange the terms to get the equation in the form of (x + a)² = b.

4. Can completing the square be used with any matrix?

No, completing the square can only be used with a 2x2 matrix that represents a quadratic equation. It cannot be used with matrices of different dimensions or with non-quadratic equations.

5. What are the benefits of using matrix form to complete the square?

Using matrix form to complete the square can be more efficient and less error-prone than using the traditional method. It also allows for easier manipulation and calculation, especially when solving systems of equations.

Similar threads

Replies
5
Views
1K
Replies
1
Views
1K
Replies
5
Views
1K
Replies
4
Views
2K
Replies
7
Views
1K
Replies
2
Views
2K
Back
Top