Derivative of a square matrix to a power Suppose I have a function $f(x) = A^n$ where $A$ is a square matrix, $x$ is a positive real scalar, and $n$ is a natural number.
I would like to calculate the derivative of $f$ with respect to $x$ (each entry in $A$ is a function of $x$).  
Is there a simple formula for this in general or do I need to know what $n$ is and use the product rule?
I found this, but I don't understand it (in particular I don't understand what $DS(A)$ or $S(A)$ means).
edit:
Each entry in $A$ is differentiable.
 A: In general, taking square matrices to integer powers is done by finding diagonal matrix $D$ and matrices $P$ and $P^{-1}$ such that $A=P^{-1}DP$.
This is because $A^n=P^{-1}D^nP$, and because $D$ is diagonal, one can simply raise each element of $D$ to the $n$ to get $D^n$. This way, we can relatively easily find a closed form for $A^n$.
If all entries of $A$ are differentiable, it should be easy to differentiate once you have this closed form of $A^n$.
This said, it may be very hard to find the eigenvalues of this function-valued matrix to find $P$ and $D$.
If $A$ be an $m\times m$ matrix: To find $P$ and $D$, first find $m$ linearly independent eigenvalues $\lambda_1, \lambda_2, \cdots, \lambda_m$ and corresponding eigenvectors $v_1, v_2, \cdots, v_m$. $P$ is the matrix $[v_1, v_2, \cdots, v_m]$ and $D=I\begin{bmatrix}\lambda_1\\\lambda_2\\\vdots\\\lambda_m\end{bmatrix}$.
A: There are two cases.
Case 1. $A$ is diagonalizable and you know explicitly $D$ diagonal, $P$ invertible  s.t. $A^n=PD^nP^{-1}$.
Then $(A^n)'=P'D^nP^{-1}+nPD^{n-1}D'P^{-1}-PD^nP^{-1}P'P^{-1}$.
Case 2. Otherwise
$(A^n)'=A'A^{n-1}+AA'A^{n-2}+\cdots+A^{n-1}A'$ (sum of $n$ matrices) where $A'=[{a_{i,j}}']$.
There are no simplifications.
