Derivative of a square matrix to a power
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.
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}$.