Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For a function $$f(X)=\operatorname{tr}(X^TAX)+\|\operatorname{diag}(X^TX)-\alpha I\|_2,$$ where all entries are real and $\alpha$ is a real scalar, while $A$ is a p.s.d matrix and $X$ is a real rectangular matrix- I tried to compute the gradient w.r.t $X$.

Is my final solution correct?

Final solution:

$$\nabla f(X)=2AX + 4\operatorname{diag}(X^TX)[\operatorname{diag}(X^TX)-\alpha I]$$

share|cite|improve this question
The first term looks good, but the second is not. For one thing, where did the 4 come from? Furthermore, the derivative should be undefined when the norm is zero. No way that second term is correct. – Michael Grant Apr 15 '13 at 22:35
@MichaelGrant Can you put forth the derivative for the second term? – halms Apr 15 '13 at 22:59

Your Answer


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

Browse other questions tagged or ask your own question.