Derivative of a diagonal matrix raised to an arbitrary power I have a matrix $(A^2)^k.$ I know that $A$ is a diagonal $n \times n$-matrix. I'm looking to take the derivative of this matrix with respect to $A$. 
$\frac{d}{dA} (A^2)^k = ???$
I'm not sure the chain rule applies here; if so does
$\frac{d}{dA} (A^2)^k = k(A^2)^{(k-1)}(2A)$
If the chain rule does apply, I guess I'm not sure how to simplify that - or if it can be simplified any further. 
I'm keeping the exponents separate because $A$ is not guaranteed to be positive. Also, $k$ does not need to be a whole number (I'm looking at $0.6$). Is there a better way of dealing with exponents? 
 A: If you transform the independent variable from a diagonal matrix to a vector
$$a={\rm diag}(A)$$
then you have a vector-valued function. 
Finding this gradient is much simpler, since it doesn't require any higher-order tensors.
$$\eqalign{
 f &= a^{2k} \cr
df &= 2k\,a^{2k-1}\circ da  = 2k\,A^{2k-1}\,da \cr
 \frac{\partial f}{\partial a} &= 2k\,A^{2k-1} \cr
}$$
A: This is not a true claim. Derivative of a scalar relative to matrix is a matrix. Derivative of a vector relative to a matrix is a three-dimensional array and derivative of a matrix relative to a matrix can be defined as a set of these three-dimensional array over the vectors which forming the matrix. So you considered a set of 3 dimensional arrays equal to a 2-dimensional matrix  which is not true. I think you should study more about vectors,matrixes and their derivative and dimensions.  
A: In the case of optimization problems over the matrixes with a constraint by suitable approaches they can be converted to a function of the trace of a matrix if your cost is a scalar and the derivative of the trace (which is a scalar) is defined and its rules has been prsented. See the book F.Lewis optimal control the chapter of designing linaer quadratic regulator by using output feedback. I think this can help you.   
