Showing a matrix $A$ is positive definite

linear algebramatricespositive definite

I am trying to show that the following matrix is positive definite:
$$A=\begin{pmatrix}
2 & -1 & 0 \\
-1 &2 &-1 \\
0 & -1 &2
\end{pmatrix}.$$

A matrix $A\in\mathbb{R}^{n\times n}$ is positive definite if $x^TAx>0$ (there are other ways to show the matrix $A$ is positive definite, e.g. by calculating the deteminant of each principal matrix, but I am not concerned with this).

\begin{align}
x^TAx&=\begin{pmatrix} x_1 & x_2 & x_3\end{pmatrix}\begin{pmatrix}
2 & -1 & 0 \\
-1 &2 &-1 \\
0 & -1 &2
\end{pmatrix}\begin{pmatrix} x_1 \\ x_2 \\ x_3\end{pmatrix} \\
&=2x_1^2-2x_1x_2+2x_2^2-2x_2x_3+2x_3^2. \tag{1}
\end{align}

How is this greater than zero? I have tried to complete the square, but I have not been successful.

Best Answer

As Gerry Myerson's question comment indicates, you have

$$\begin{equation}\begin{aligned} & 2x_1^2 - 2x_1x_2 + 2x_2^2 - 2x_2x_3 + 2x_3^2 \\ & = x_1^2 + (x_1^2 - 2x_1x_2 + x_2^2) + (x_2^2 - 2x_2x_3 + x_3^2) + x_3^2 \\ & = x_1^2 + (x_1 - x_2)^2 + (x_2 - x_3)^2 + x_3^2 \\ & \ge 0 \end{aligned}\end{equation}\tag{1}\label{eq1A}$$

Note it is $0$ only if $x_1 = x_2 = x_3 = 0$, so the result is always positive for any non-zero vector.

Regarding the stated result in your textbook, is it missing the $-$ signs or did you not put them in?