Maximizing $\log(|A|)-\text{Tr}(AB)$ for pd and symmetric $A$ and $B$ 
Let $A$ and $B$ be two symmetric and positive definite matrices of the
  same size. Then the function $$ f(A)\equiv\log(\det(A))-\text{Tr}(AB)
 $$ is maximized uniquely by $A=B^{-1}$.

This is mentioned in passing in Hayashi (2000). Does anyone know a proof, please?
 A: $\dfrac{\partial f}{\partial A} = \dfrac{1}{\det(A)}\cdot\dfrac{\partial \det(A)}{\partial A} - \dfrac{\partial tr(AB)}{\partial A} = \dfrac{1}{\det(A)}\cdot \det(A) \cdot A^{-T} - B^{T}  = A^{-T}-B^{T}$.
Thus,
$\dfrac{\partial f}{\partial A} = 0 \Rightarrow A = B^{-1}.$ It is the only critical point.
$\dfrac{\partial^{2} f}{\partial A^2} = -(A^{-1}\otimes A^{-T})$, which is a negative definite hessian for any positive definite matrix A. Thus, $A = B^{-1}$ is a maximum point. 
A: Knowing the answer is supposed to be $B^{-1}$ may be a helpful clue.  Let $C = B^{1/2} A B^{1/2}$ (I do it this way so $C$ is symmetric and positive definite iff $A$ is).  Then $$f(A)  = - \log(\det B) + \log(\det(C)) - \text{Tr}(C)$$
Thus it suffices to prove that the unique maximum of $$g(C) = \log(\det(C)) - \text{Tr}(C)$$ for symmetric positive definite $C$ is at $C = I$.  If $C$ has
eigenvalues $\lambda_1, \ldots, \lambda_n$ (counted by multiplicity)  we have 
$$g(C) = \sum_{j=1}^n (\log(\lambda_i) - \lambda_i)$$
Now $\log(\lambda_i) - \lambda_i$ is maximized at $\lambda_i = 1$, so $g(C)$ is maximized when all $\lambda_i = 1$.  The only symmetric positive definite matrix with all eigenvalues $1$ is $I$.
