# If $A$ and $B$ are positive semidefinite matrices, then is $(A+B)^{2}$?

I have a question: If $A$ and $B$ are $n\times n$ positive semidefinite matrices, why does it follow that $(A+B)^{2}$ is positive semidefinite?

I know that to prove that $(A+B)^{2}$ is positive semidefinite, I need to prove that the eigenvalues of $(A+B)^{2}$ are nonnegative, but I don't know how to about this.

-
It would be useful for you to specify whether the definition of positive semidefinite that you are using implicitly implies the matrices are symmetric or not. See my answer below for more details. –  cardinal Apr 22 '12 at 17:00

## 2 Answers

The answer is: It depends!

There are two common definitions of positive semidefiniteness.


Definition 2: Same as Definition 1, with the additional requirement that $\A$ be symmetric.

Let's start with the second definition, which may be the more commonly assumed. In this case, the stated result is true and follows easily from the definitions. In particular, $$\x^T(\A + \B)\x = \x^T \A \x + \x^T \B \x \geq 0 \>,$$ since both terms in the middle are nonnegative. Furthermore if $\A$ and $\B$ are both symmetric, then so is $\A + \B$. Hence, $$\x^T (\A + \B)^2 \x = \x^T (\A+\B)^T (\A+\B) \x = \|(\A+\B) \x\|_2^2 \geq 0 \>.$$

Now, let's look at the first definition. If we drop the assumption that $\A$ and $\B$ are symmetric, then the stated result in the question is false.

It is, of course, still true that $\A+\B$ is positive semidefinite (the same proof above applies), but $(\A+\B)^2$ may not be.

Counterexample: It suffices to consider only a single matrix $\A$, with $\B = 0$. Take $$\A = \left(\begin{array}{rr} 1 & -2 \\ 0 & 1\end{array}\right) \>.$$ Then, if $\x = (x_i)$, $$\x^T \A \x = x_1^2 - 2 x_1 x_2 + x_2^2 = (x_1 - x_2)^2 \geq 0 \>.$$ So, $\A$ is positive semidefinite. However, $$\A^2 = \left(\begin{array}{rr} 1 & -4 \\ 0 & 1\end{array}\right) \>,$$ which is clearly not positive semidefinite; to see this, just take $\x$ to be a vector of ones.

-

First prove that the sum of positive semidefinite is positive semidefinite, and then prove that the square of positive semidefinite is positive semidefinite.

Added in edit: here's the proof.

Recall that a matrix $A$ is positive semidefinite if $z^TAz\geq0$ for all $z\in\mathbb{R}^n$. So, if $A,B$ are positive semidefinite and $z\in\mathbb{R}^n$, then $$z^T(A+B)z=z^TAz+z^TBz\geq0,$$ so $A+B$ is positive semidefinite.

And for the square of positive semidefinite, it is enough to show that the square of a symmetric matrix is positive semidefinite. Indeed, $$z^TA^2z=z^TA^TAz=(Az)^T(Az)=\|Az\|^2\geq0.$$

-
it is easy to prove that the square of positive semidefinite matrix is positive semidefinite. But, I don't know how to prove that the sum of two positive semidefinite matrices is positive senidefinite. I know that $tr(A+B)=tr(A)+tr(B)\geq 0$, but this doesn't imply that the eigenvalues of $(A+B)$ are all nonnegative. Can you, please, prove it? –  M.Krov Apr 21 '12 at 22:10
I've edited the answer to include the proof. –  Martin Argerami Apr 21 '12 at 22:19
This answer seems to assume that $A$ and $B$ are symmetric. –  cardinal Apr 22 '12 at 1:12
@cardinal: yes indeed. I fail to see what's the point of considering positive semidefiniteness for non-symmetric matrices. You can have the definition, but what properties can you obtain from it? –  Martin Argerami Apr 22 '12 at 1:58
I agree that the theory is much richer once symmetry is imposed. But, the alternate definition not assuming symmetry is, of course, not mine. Indeed, I was thrown off myself when reading your answer at first, given the definition you provide! :) –  cardinal Apr 22 '12 at 2:03