TITLE: nth derivative of determinant wrt matrix
QUESTION [6 upvotes]: I'm working on an expression for the nth derivative of a (symmetric) matrix, i.e.
\begin{equation}\frac{\partial^{n} \det(A)}{\partial A^{n}}\end{equation}
Starting with \begin{equation}\frac{\partial \det(A)}{\partial A}=\det(A) A^{-1}\end{equation}
Then naturally the next derivative is 
\begin{equation}\frac{\partial^{2}\det(A)}{\partial A^{2}}=\frac{\partial}{\partial A}\left(\det(A)A^{-1}\right)=\det(A)A^{-2}-\det(A)A^{-2}=0\end{equation}
I doubt this is right, can someone point out my mistake? I'm actually working on an expression for the nth derivative of $\det(A)^{-1/2}$ but a general formula for the simple case would be fine.

REPLY [4 votes]: Tee-Jay, that you call a derivative is in fact a gradient.
Let $f\colon U\mapsto \det(U)$. We assume that $A$ is invertible. The derivative is a linear application:
$Df_A\colon H\mapsto \det(A)\operatorname*{trace}(HA^{-1})$. 
The second derivative is a symmetric bilinear form:
$$D^2f_A\colon(H,K)\mapsto \det(A)\operatorname*{trace}(KA^{-1})\operatorname*{trace}(HA^{-1})+\det(A)\operatorname*{trace}(H(-A^{-1}KA^{-1}))
\qquad\qquad\qquad\qquad\qquad\quad=\det(A)(\operatorname*{trace}(HA^{-1})\operatorname*{trace}(KA^{-1})-\operatorname*{trace}(HA^{-1}KA^{-1})).$$
In particular, the associated quadratic form is:
$$D^2f_A(H,H)=\det(A)((\operatorname*{trace}(HA^{-1}))^2-\operatorname*{trace}((HA^{-1})^2).$$
EDIT 1: let $(\lambda_i)$ be the spectrum of $HA^{-1}$, $(\sigma_i)$ be the elementary symmetric polynomials associated to the $(\lambda_i)$ and $S_k=\sum_i {\lambda_i}^k=\operatorname*{trace}((HA^{-1})^k)$. Then $$Df_A(H)=\det(A)\sigma_1,D^2f_A(H,H)=\det(A)2\sigma_2.$$ In fact we can generalize this result.
$\det(A+H)=\det(A)\det(I+HA^{-1})$ and we may assume that $A=I$ and $(\lambda_i)$ is the spectrum of $H$. Then, according to the Taylor formula, $$\det(I+H)=\Pi_i(1+\lambda_i)=1+\sum_{k=1}^n\sigma_k=1+\sum_{k=1}^n 1/k!D^kf_I(H,\cdots,H).$$ By identifying the terms of the same degree, we obtain:
$$D^kf_I(H,\cdots,H)=k!\sigma_k=k!P_k(S_1,\cdots,S_k)=k!P_k(\operatorname*{trace}(H),\cdots, \operatorname*{trace}(H^k)$$ where $P_k$ is the polynomial given by the Newton's identities, cf., http://en.wikipedia.org/wiki/Newton_identities
For instance, $$D^1f_I=S_1,D^2f_I={S_1}^2-S_2,D^3f_I={S_1}^3-3S_1S_2+2S_3,\\
D^4f_I={S_1}^4-6{S_1}^2S_2+3{S_2}^2+8S_1S_3-6S_4.$$
EDIT 2: Example. Let $A,H\in GL_n(\mathbb{C})\times M_n(\mathbb{C})$. $$\det(A+H)=\det(A)(1+S_1+1/2({S_1}^2-S_2)+1/6({S_1}^3-3S_1S_2+2S_3)+O(\lVert{H}\rVert^4))$$ where $S_k=\operatorname*{trace}((HA^{-1})^k)$.