Quadric represented in matrix form

1.1k Views Asked by At

I just want to make sure I understand this right.

In the book our teacher describes matrix representation of quadric as (sorry for the 3x3 matrix it should be 2x2)

$$[ 1\,\,\, x^T]\begin{bmatrix} c & b^T \\ b & A \\ \end{bmatrix}\begin{bmatrix} 1 \\x \end{bmatrix}=x^TAx+2b^Tx+c$$

So am I right to represent this function

$$0=5x^2+3y^2+3z^2-2xy+2yz-2xz-10x+6y-2z-10$$ as $$\begin{bmatrix} -10 & -5 & 3 & -1 \\ -5 & 5 & -1 & -1 \\ 3 & -1 & 3 & 1 \\ -1 & -1 & 1 & 3 \end{bmatrix}$$

There were no examples of such representation included in the book and I struggle to find any on the internet.

Sorry, if it's a stupid question.

2

There are 2 best solutions below

0
On BEST ANSWER

First the $(1,x^T)$ on the right needs to be transposed for the product to be well defined.

Then it depends on the order of $1,x,y,z$ in the vectors from left and right. But if the vectors have the order I wrote then it should be correct. In other words

$$ [1,x,y,z]\begin{bmatrix} -10 & -5 & 3 & -1 \\ -5 & 5 & -1 & -1 \\ 3 & -1 & 3 & 1 \\ -1 & -1 & 1 & 3 \end{bmatrix} \begin{bmatrix} 1 \\ x \\ y \\ z \end{bmatrix}$$

Also if you set it equal to 0 it is not a function in the variables but a level set to the function.

0
On

The expression of a quadric in the matrix form $$\begin{bmatrix}1&\mathbf x^T\end{bmatrix} \begin{bmatrix} c & \mathbf b^T \\ \mathbf b & A\end{bmatrix} \begin{bmatrix}1\\ \mathbf x\end{bmatrix} = \mathbf x^TA\mathbf x+2\mathbf b^T\mathbf x+c$$ is completely general: it works for any number of variables. If you have $n$ variables, the vectors $\mathbf x$ and $\mathbf b$ will be $n$-dimensional and the matrix $A$ will be $n\times n$.

To see how to convert from an implicit Cartesian equation $f(\mathbf x)=0$ for a quadric into this form, expand the above expression in terms of coordinates. If we have $\mathbf x = (x_1,\cdots,x_n)^T$, then the expression becomes $$\sum_{i=1}^n\sum_{j=1}^n a_{ij}x_ix_j+\sum_{i=1}^n2b_ix_i+c.\tag{*}$$ We find immediately that $c$ is just the constant term of the quadric and that the elements of the vector $\mathbf b$ are the coefficients of the corresponding linear terms, halved. As for the quadratic part of the expression, there are two types of quadratic terms in $f(\mathbf x)$: some are of the form $p_i x_i^2$ and others $q_{ij}x_ix_j$, with $i\lt j$. Comparing this to the sum in (*), we can see right away that the diagonal elements of $A$ are the coefficients $p_i$ of the squared terms of the quadric. For the off-diagonal elements, on the other hand, we have $a_{ij}+a_{ji}=q_{ij}$. In principle, you could use any values that add up to $q_{ij}$ for this pair of matrix elements, but it turns out that only the symmetric part of $A$ contributes to the expression $\mathbf x^TA\mathbf x$, so you might as well make $A$ symmetric in the first place by setting $a_{ij}=a_{ji}=\frac12 q_{ij}$ for $i\ne j$. This makes the larger matrix symmetric, which gives it several useful properties.

Comparing this to your work, assuming that you’ve chosen the order $\mathbf x = (x,y,z)^T$, then you’ve gotten the matrix exactly right.