Using the Discriminant of a Quadratic Equation to Test Positive Definiteness

The semester is drawing to a close, and many top students are getting busy. For someone like me, who isn't exactly a top student, though, pretty much every day looks the same — I just want to dig deeper into the things I find interesting, because I think that really mastering something useful is what matters most. Both my mathematical analysis and higher algebra instructors required a term paper, and I wrote on topics I find particularly interesting — "Euler's mathematics" and "a study of hypercomplex numbers" — which I'll share later on.

Although the semester is nearly over, our courses aren't finished yet — in fact, new material keeps coming all the way through week eighteen. As exams approach, our Higher Algebra course is also winding down. Recently we've been covering quadratic forms, specifically positive definite quadratic forms and positive definite matrices. The textbook offers two methods for testing positive definiteness: one based on elementary row/column operations derived from the definition, and the other the leading-principal-minor method. I have no quarrel with the former, but I find the latter hard to appreciate — while it's correct, it's ugly and computationally heavy. I still haven't figured out what's supposedly good about the leading-principal-minor method. In my view, the discriminant-based approach discussed in this post is the simple, quick way to go.

Positive Definite Quadratic Forms

A positive definite quadratic form is a quadratic homogeneous function of n variables $x_1,x_2,...,x_n$ such that, as long as $x_i$ are not all zero, its value is always positive. For example,

$$2 x_1^2+x_2^2-2 x_1 x_2=x_1^2+(x_2-x_1)^2$$

This is a fairly simple positive definite quadratic form; in the multivariate case we also have things like

$$5 x_1^2+x_2^2+5 x_3^2+4 x_1 x_2-8 x_1 x_3-4 x_2 x_3$$

and so on. But it's not easy to see the positive definiteness of the expression above directly. To test it, we could rewrite it in matrix form and then check it via elementary operations or the leading-principal-minor method. Instead, I test it by considering the solutions of the equation

$$f(t)=5 x_1^2+x_2^2+5 t^2+4 x_1 x_2-(8 x_1 + 4 x_2 )t=0$$

To do this, it's easy to verify that

$$f(0)=5 x_1^2+x_2^2+4 x_1 x_2=(2 x_1+x_2)^2 +x_1^2 \leq 0$$

Because its discriminant is

$$\begin{aligned} \Delta &=(8 x_1 + 4 x_2 )^2-4\times 5\times(5 x_1^2+x_2^2+4 x_1 x_2)\\ &=-36 x_1^2-4 x_2^2-16 x_1 x_2\\ &=-4[5 x_1^2+(2 x_2 -x_1)^2] \end{aligned}$$

when $x_1,x_2$ are not all zero, the discriminant is negative, so the original equation has no solution, meaning $f(t)$ is always greater than 0; when $x_1=x_2=0$, there is exactly one solution $t=0$, and for $t > 0$, we also have $f(t) > 0$. Hence the quadratic form above is positive definite.

Positive Definite Matrices

Organizing the above approach systematically gives us the following test for positive definite matrices.

A positive definite matrix is an n×n real matrix $\boldsymbol{A}_n$ such that for any nonzero n-dimensional real column vector $\boldsymbol{x}$, we have

$$\boldsymbol{x}^{T} \boldsymbol{A}_n \boldsymbol{x} > 0$$

Write $\boldsymbol{A}_n$ in block form as

$$\boldsymbol{A}_n=\left[ \begin{matrix} \boldsymbol{A}_{n-1}& \boldsymbol{b}\\ {\boldsymbol{c}^T}&d \end{matrix}\right]$$

where $\boldsymbol{A}_{n-1}$ is an (n-1)×(n-1) matrix. Also write the vector $\boldsymbol{x}$ in block form as

$$\left( {\begin{matrix} {\boldsymbol{y}}\\t \end{matrix}} \right)$$

where $\boldsymbol{y}$ is an (n-1)-dimensional vector consisting of the first n-1 entries of $\boldsymbol{x}$, and $t$ is the n-th entry of $\boldsymbol{x}$. Then

$$\begin{aligned} f(t)=\boldsymbol{x}^T \boldsymbol{A}_n \boldsymbol{x}&=\left(\boldsymbol{y}^{T},t\right)\left[ {\begin{array}{\cdot {20}{c}} \boldsymbol{A}_{n-1}& \boldsymbol{b}\\ {\boldsymbol{c}^T}&d \end{array}} \right] \left( {\begin{array}{\cdot {20}{c}} {\boldsymbol{y}}\\ t \end{array}} \right)\\ &=d t^2+\left(\boldsymbol{c}^{T} \boldsymbol{y}+\boldsymbol{y}^{T}\boldsymbol{b}\right)t+\boldsymbol{y}^{T}\boldsymbol{A}_{n-1}\boldsymbol{y}\\ &=d t^2+\left[\left(\boldsymbol{b}+\boldsymbol{c}\right)^{T}\boldsymbol{y}\right]t+\boldsymbol{y}^{T}\boldsymbol{A}_{n-1}\boldsymbol{y} \end{aligned}$$

If the matrix $\boldsymbol{A}_n$ is positive definite, then $f(0)=\boldsymbol{y}^{T}\boldsymbol{A}_{n-1}\boldsymbol{y} \geq 0$, i.e., $\boldsymbol{A}_{n-1}$ is positive definite — this is one necessary condition; another necessary condition is $d > 0$.

At the same time, the discriminant of $f(t)=0$ must be non-positive, i.e.,

$$\begin{aligned} \Delta &=\left[\left(\boldsymbol{b}+\boldsymbol{c}\right)^{T}\boldsymbol{y}\right]^2-4d\boldsymbol{y}^{T}\boldsymbol{A}_{n-1}\boldsymbol{y}\\ &=4\boldsymbol{y}^{T}\left(\boldsymbol{m}\boldsymbol{m}^T-d\boldsymbol{A}_{n-1}\right)\boldsymbol{y}\\ &\leq 0 \end{aligned}$$

where $\boldsymbol{m}=\frac{1}{2}(\boldsymbol{b}+\boldsymbol{c})$. This is just saying that $\left(d\boldsymbol{A}_{n-1}-\boldsymbol{m}\boldsymbol{m}^T\right)$ is positive definite. Moreover, note that the matrix $\boldsymbol{m}\boldsymbol{m}^T$ is itself positive definite, so if $\left(d\boldsymbol{A}_{n-1}-\boldsymbol{m}\boldsymbol{m}^T\right)$ is positive definite, then $\boldsymbol{A}_{n-1}$ is necessarily positive definite as well (the sum of two positive definite matrices is again positive definite). So the latter condition is already implied by the former. This gives us the following criterion:

The matrix $\boldsymbol{A}_n=\left[ \begin{array}{*{20}{c}} > \boldsymbol{A}_{n-1}& \boldsymbol{b}\\ > {\boldsymbol{c}^T}&d > \end{array} \right]$ is positive definite if and only if $d >0$ and $\left(d\boldsymbol{A}_{n-1}-\boldsymbol{m}\boldsymbol{m}^T\right)$ is positive definite, where $\boldsymbol{m}=\frac{1}{2}(\boldsymbol{b}+\boldsymbol{c})$.

In this way, the problem of testing positive definiteness for an n×n matrix reduces to the same problem for an (n-1)×(n-1) matrix, which can similarly be reduced further to an (n-2)×(n-2) matrix, and so on, until we're down to checking the positivity of a single number.

Closing Remarks

However you look at it, the method presented here should require less computation than either elementary row/column operations or the leading-principal-minor method, and the derivation is also fairly simple. So I still can't figure out why textbooks and online sources barely mention it. In fact, even when doing homework, I'd rather use this discriminant-based approach than the standard methods. Because, to me, a method I worked out myself that actually solves the problem is a good method. Even if I had never encountered the matrix formulation of quadratic forms, I could still use the discriminant to test whether a quadratic form is positive definite — whereas even given several years to think about it, I doubt I would have come up with something as "ugly" as the leading-principal-minor method.

Something readers might find surprising, though, is that this "ugly" leading-principal-minor method is actually essentially the same as the method in this post. We first check whether the bottom-right diagonal entry is positive, then reduce the matrix by one order and check whether the bottom-right diagonal entry of the new matrix is positive, and so on — and at each step, the bottom-right diagonal entry we need to check is essentially equivalent to a leading principal minor. There's no essential difference between the two approaches, but if you were actually implementing this in code, the method described here would clearly have a slight edge in efficiency.

English translation of a post from 科学空间 | Scientific Spaces by 苏剑林. Original: https://kexue.fm/archives/2195
Translated automatically with claude-sonnet-5; all equations are reproduced verbatim from the source. Copyright remains with the original author.