Convex Matrix function $f$ Let $g$ be the function the takes the sum of the squares of the elements in a $2\times 2$ matrix. And let $f$ be the function $$f(A) = g(A) + [\det(A)]^2.$$
Is it possible to find 2 matrices $A$ and $B$ such that $f(tA + (1-t)B) > tf(A) + (1-t)f(B)$? In other words, can we show that $f$ is not convex?
 A: Function is not convex! Take $A=\begin{bmatrix}
a & 0\\ 
 0& 0
\end{bmatrix}$ ,and   $B=\begin{bmatrix}
0 & 0\\ 
 0& a
\end{bmatrix}$ we'll show that for large enough $a$, convexity of $f$ fails for these two matrix. Note that $f(A) =f(B) = a^2$
$$f(tA+(1-t)B) = a^2t^2 + a^2 (1-t)^2+a^4t^2(1-t)^2$$ and, therefore for $t=\frac{1}{2}$ we have
$$f(\frac{1}{2}A+\frac{1}{2}B)-\frac{1}{2}f(A)- \frac{1}{2}f(B) = \frac{a^4}{16} - \frac{a^2}{2}$$ so for example for $a=10$ above is positive number which shows $f$ is NOT convex!  
A: We can prove the following partial converse. We consider a norm $||A||$ over $M_2$. Then, there is $\alpha$ s.t. $f$ is convex in the ball $B_{\alpha}=\{A,||A||<\alpha\}$.
Proof. Let $h(A)={\det(A)}^2$. Then $D^2f_A=D^2g_A+D^2h_A=2I_4+D^2h_A$ where the symmetric matrix $D^2h_A$ is a homogeneous polynomial of degree $2$ in the entries of $A$. The function
$\phi: A\rightarrow \inf (spectrum(D^2h_A))$ is continuous and consequently, there is $M>0$ s.t. $\phi > -M$ on $B_1$. Then it suffices to choose $\alpha=\sqrt{\dfrac{2}{M}}$. Indeed if $A\in B_{\alpha}$, then $\phi(A)> -2$ and the eigenvalues of $D^2f_A$ are $>0$, that is, $f$ is convex.
