Product of two positive definite matrices...

... is not positive definite?

I read this in my notes, but I think it might be wrong. I can't think of a counter example. I know that not being able to think of a counter example does not make it true, but I would think that the product of two positive definite matrices would still be positive definite.

Can anyone think of an example of where the product of two positive definite matrices would not be positive definite?

Product of positive definite matrices may not be positive definite

The examples we can give depend on our definition of positive definiteness. Taking the more general definition which allows non-Hermitian matrices (or non-symmetric matrices, in the real case), we say the n x n complex matrix $\displaystyle A$ is positive definite if, for any n x 1 complex vector $\displaystyle x$, $\displaystyle Re(x^*Ax) > 0$, where $\displaystyle Re(y)$ is the real part of $\displaystyle y$ and $\displaystyle x^*$ is the conjugate transpose of $\displaystyle x$. We say the n x n real matrix $\displaystyle A$ is positive definite if, for any n x 1 real vector $\displaystyle x$, $\displaystyle x^TAx > 0$. [1]

Consider the 2 x 2 real matrix

$\displaystyle A(\theta) = \left ( \begin{array}{cc}

\cos(\theta) & -\sin(\theta) \\

\sin(\theta) & \cos(\theta)

\end{array} \right ).$

This matrix rotates a vector $\displaystyle x$ counter-clockwise by $\displaystyle \theta$. As long as $\displaystyle \theta \in (-\frac{\pi}{2}, \frac{\pi}{2})$, $\displaystyle A(\theta)$ will be positive definite. To see this, note that $\displaystyle x^TA(\theta)x = x \cdot A(\theta)x = |x| |A(\theta)x| \cos(\theta)$, where $\displaystyle \theta$ is the angle between the vectors $\displaystyle x$ and $\displaystyle y=A(\theta)x$.

Now, suppose $\displaystyle \theta=\frac{\pi}{4}$. Then $\displaystyle B=A(\frac{\pi}{4})^2$ is a product of two positive definite matrices. However $\displaystyle B$ rotates a vector by $\displaystyle \frac{\pi}{2}$. As a result, $\displaystyle x$ and $\displaystyle z=Bx$ will be orthogonal, so $\displaystyle x^TBx = x \cdot Bx = |x| |Bx| \cos(\frac{\pi}{2}) = 0$. Thus B is not positive definite.

We can even find a negative definite matrix as a product of positive definite matrices. Try $\displaystyle C=A(\frac{\pi}{3})^2=A(\frac{2\pi}{3})$.

[1] Weisstein, Eric W. "Positive Definite Matrix." From MathWorld--A Wolfram Web Resource. Positive Definite Matrix -- from Wolfram MathWorld. Accessed 30 July 2010.