Convexity of a trace of matrices with respect to diagonal elements Can we prove that   $\mbox{trace}({\bf A} ({\bf P}+{\bf Q})^{-1} {\bf A}^T)$     is a jointly convex function of positive variables $[q_1,q_i,...,q_N]$,  where ${\bf Q}=\mbox{diag}(q_1,...,q_N)$, $q_i>0 , \forall i$, and  ${\bf P}$ is a positive definite matrix. 
 A: The epigraph of this function is
$$\mathop{\textrm{epi}} f(P,Q) = \left\{ (P,Q,z) \,\middle|\, P+Q\succ 0,~\mathop{\textrm{Tr}}(A(P+Q)^{-1}A^T)\leq z\right\}$$
This is equivalent to
$$\mathop{\textrm{epi}} f(P,Q) = \left\{ (P,Q,z) \,\middle|\, \exists Z ~~ P+Q\succ 0,~\begin{bmatrix} Z & A^T \\ A & P+Q \end{bmatrix} \succeq 0, ~ \mathop{\textrm{Tr}}(Z) \leq z \right\}$$
The epigraph is the intersection of linear matrix inequalities and a linear inequality, composed with the projection $(P,Q,Z,z)\rightarrow (P,Q,z)$, so it is convex.
A: Notice that the inverse of a symmetric positive definite matrix is convex (cf Is inverse matrix convex?) w.r.t. to the cone of symmetric positive semidefinite matrices $S^n_+$.
Edited Plain version:
For $t\in (0,1)$ and symmetric positive definite $X,\tilde X$ it follows
the matrix
$$ (1-t) X^{-1} + t\tilde X^{-1} - ((1-t) X + t \tilde X)^{-1} $$
is positive semidefinite.
In particular,
$$ A[(1-t) X^{-1} + t\tilde X^{-1} - ((1-t) X + t \tilde X)^{-1}]A^T $$
is positive semidefinite.
Thus,
$$ \operatorname{trace}(A[(1-t) X^{-1} + t\tilde X^{-1} - ((1-t) X + t \tilde X)^{-1}]A^T) \ge 0 $$
and
\begin{align} 
\operatorname{trace}(A((1-t) X + t \tilde X)^{-1}A^T) 
&\le \operatorname{trace}(A[(1-t) X^{-1} + t\tilde X^{-1}]A^T) \\
&= (1-t)\operatorname{trace}(AX^{-1}A^T) + t\operatorname{trace}(A\tilde X^{-1}A^T).
\end{align}
Thus, $X\mapsto \operatorname{trace}(AX^{-1}A^T)$ is convex. 
Since, $(P,Q)\mapsto P+Q$ is affine, $(P,Q)\mapsto \operatorname{trace}(A(P+Q)^{-1}A^T)$ is also convex.
Composition rule with generalized inequality and monotonicity version:
Notice that $\operatorname{trace}(AXA^T)$ is convex (in fact linear) and monotone increasing in $X$ w.r.t. $S^n_+$. Thus, the composition $(P,Q)\mapsto \operatorname{trace}(A(P+Q)^{-1}A^T)$ is convex.
