I'm reading CVXbook, p. 643. There is an example:
Why partial derivative contains trace?
If we consider the following composition:
$$ h(x) = (g \circ f)(x) $$ $$ Dh(x) = Dg(f(x))Df(x) $$ from $ (\log \det X)' = (X^{-1})^T $ we have $$ \dfrac{\partial{f(x)}}{\partial x_i} = (F^{-1})^TF_i $$
Why I'm wrong?

Purely from a dimensional point of view, $f: \mathbb{R}^n \to \mathbb{R}$, so $\nabla f$ is a linear map $\mathbb{R}^n \to \mathbb{R}$. Hence your answer can't be correct.
To get to the correct answer, it suffices to consider $\frac{d}{dx} \log\det{(Ax+B)}$, where $A,B$ are square and $F=Ax+B \succ 0$, since $f$ is of this form, although containing other variables that we hold constant. Now, for $h$ small, $$ \frac{1}{h\det{F}}(\det{(F+Ah)}-\det{F}) = \frac{1}{h}\left( \det{(I+F^{-1}Ah)}-1 \right) = \operatorname{tr}{(F^{-1}A)} + o(1), $$ because $\det{(I+F^{-1}Ah)} = h^n\det{(F^{-1}A - (-1/h)I)}$ is $h^n$ times the characteristic polynomial in $-1/h$, so the coefficient of $h$ is the negative of the coefficient of $t^{n-1}$ in the original. Hence $$ \frac{d}{dx} \log{\det{F}} = \frac{1}{\det{F}} \frac{d}{dx} \det{F} = \operatorname{tr}{(F^{-1}A)}. $$