# positive semidefinite versus all the eigenvalues having non-negative real parts

Suppose matrix $A$ with all its eigenvalues having non-negative real parts, can we get that $x^TAx\geq0$ holds for any vector $x$?

Another question is that, suppose matrix $A$ is positive semi-definite, $B$ is a positive definite diagonal matrix with the same dimension as $A$. Do all the eigenvalues of $AB$ have nonnegative real parts?

Since $B$ is a diagonal positive definite matrix, $B^{\frac{1}{2}}$ is invertible. Then $B^{\frac{1}{2}}ABB^{-\frac{1}{2}}=B^{\frac{1}{2}}AB^{\frac{1}{2}}=(B^T)^{\frac{1}{2}}AB^{\frac{1}{2}}$, which is positive semi-definite.
Therefore, all the eigenvalues of $AB$ have non-negative real parts.