Sign up ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

If A is a not diagonal but symetric matrix and diag() is a function such that returns the diagonal, i.e. diag(A) is a matrix of zeros except on the diagonal. Im interested in the derivative of vec(diag(A)) with respect to x where A is a function of the vector x. So, how do I do This in the best way?

Thanks in advance!

share|cite|improve this question
Welcome to math.SE: since you are new, I wanted to let you know a few things about the site. In order to get the best possible answers, it is helpful if you say in what context you encountered the problem, and what your thoughts on it are; this will prevent people from telling you things you already know, and help them give their answers at the right level. If this is homework, please add the homework tag; people will still help, so don't worry. Please consider rewriting your post. – Did Dec 13 '12 at 19:35
You should clarify what "A is a function of the vector x" means. Some funcion in particular? Each component of the matrix is an indepent function of x? – leonbloy Dec 13 '12 at 19:40

1 Answer 1

The derivative of the $(i,i)$ entry of $\text{diag}(A)$ is the same as the derivative of the $(i,i)$ entry of $A$. The derivative of the $(i,j)$ entry of $\text{diag}(A)$ for $i \ne j$ is $0$.

share|cite|improve this answer
@ Robert. Interesting. So you are saying $\nabla diag(A)= diag(\nabla(A))$? – user25004 Jan 8 '13 at 2:58
Of course. The derivatives are element-wise operations. – Robert Israel Jan 9 '13 at 5:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.