# Proof of Convexity?

Given a positive semidefinite matrix $A$, is $\operatorname{Tr}X^TAX$ a convex function in $X$? Am looking for a proof of convexity or non-convexity, whichever is true.

-

Yes, it is convex. For any real $t$ and any $X$ and $Y$, let $$\newcommand{Tr}{\text{Tr}} f(t) = \Tr((tX +(1-t)Y)^T A\ (tX+(1-t)Y) = t^2 \Tr (X^T A X) + t(1-t) \Tr (X^T A Y) + t(1-t) \Tr (Y^T A X) + (1-t)^2 \Tr(Y^T A Y)$$ This is a quadratic function of $t$, and is always $\ge 0$ since $A$ is positive semidefinite. A quadratic function of one variable that is always $\ge 0$ is convex, so for $0 \le t \le 1$, $$f(t) = f(t\cdot 1 + (1-t) \cdot 0) \le t f(1) + (1-t) f(0) = t \Tr(X^T A X) + (1-t) \Tr(Y^T A Y)$$
First, observe that ${\rm Tr}(Y^T Y) = \sum_{i,j} y_{ij}^2$ is a convex function of $Y$. Now let $L$ be the symmetric square root of $A$ and define $Y=LX$; we have that ${\rm Tr}(X^T A X) = {\rm Tr}(Y^T Y)$. So your function is the composition of a convex function with a linear function and hence convex.