Acutually, I have a function that : $$\operatorname{tr}(\mathbf{M}(\mathbf{B}\otimes\mathbf{A}))$$ where $M$ and $B$ are constant matrix while $A$ is my variable.
I want to have this : $$d \operatorname{tr}(\mathbf{M}(\mathbf{B}\otimes\mathbf{A})) = \operatorname{tr}(\mathbf{G}d\mathbf{A})$$
So, How to solve $\mathbf{G}$?
Let's write your function in terms of the Frobenius (:) Inner Product and take its differential
\begin{equation} \begin{split} F &= \text{Tr}(M(B \otimes A)) \\ & = M^T:(B \otimes A) \\ \implies dF & = dM^T:(B \otimes A) + M^T:(dB \otimes A + B \otimes dA)\\ & = M^T:(B \otimes dA)\\ \end{split} \end{equation}
Here we need the Kronecker factorization of $M^T$
$$M^T = \sum_{j=1}^{r}C_j \otimes D_j$$
were $C_j, D_j$ matrices are shaped like $B$ and $A$ respectively.
We need also to apply the following property
$$(X \otimes Y):(Z \otimes W) = (X:Z)(Y:W)$$
Then
\begin{equation} \begin{split} dF & = \sum_{j=1}^{r}(C_j \otimes D_j):(B \otimes dA)\\ & = \sum_{j=1}^{r}(C_j : B)(D_j : dA)\\ & = \sum_{j=1}^{r}\text{Tr}(B^TC_j)D_j : dA\\ \frac{dF}{dA} & = \sum_{j=1}^{r}\text{Tr}(B^TC_j)D_j\\ \end{split} \end{equation}