# minimize the difference between two trace functions

Consider a real symmetric matrix $$A \in\mathbb{R}^{n\times n}$$ and the following function

$$f(A) = 2\cdot\text{tr}(A^\top A) - \Big(\text{tr}(A)\Big)^2$$

To minimize $$f(A)$$ we can differentiate and set the derivative to zero. Which implies that $$A^* = \frac{1}{2}\text{tr}(\text{A}^*)\mathbb{I}$$. The optimal solution suggests that the matrix $$A^*$$ must be diagonal. However, what if diagonal matrices were not allowed ? Can we find a non-diagonal $$A$$ that minimizes $$f(A)$$ ?

• However, note that $\text{tr}(x \mathbb I) = n x$, so if $n \ne 2$ ... Nov 20, 2019 at 20:42

No. Let $$\langle A, B \rangle = \operatorname{tr} (A^TB)$$. This is an inner product.
Let $$\phi(A) = 2 \operatorname{tr}(A^TA) - (\operatorname{tr}(A))^2 = 2\langle A, A \rangle - ( \langle I , A \rangle )^2$$.
Then $$D\phi(A)(H) = 4 \langle A, H \rangle -2 \langle I, A \rangle\langle I, H \rangle = 2 \langle 2A - \langle I, A \rangle I , H \rangle$$ and if we set the derivative to zero we get $$2A = \langle I, A \rangle I$$ or $$A = ({1 \over 2} \operatorname{tr} A ) I$$.
• That is what I have. However, there must be a non-diagonal $B$ such that $|f(B) - f(A^*) | \leq \epsilon$. Is it possible to find such a $B$ Nov 20, 2019 at 20:36
• Of course. The function is continuous. $\|E_{1,n}\|_F = 1$. Nov 20, 2019 at 20:37
• So how do I find such a $B$ ? Nov 20, 2019 at 20:41
• Let $E_{1,n}$ be the zero matrix except for the $1,n$ entry which is one. Compute $\phi(A+t E_{1,n})$. This will be a quadratic in $t$. Pick $t$ small enough to satisfy your above inequality. Nov 20, 2019 at 20:48