How to take derivative of \begin{align*} \dfrac{\partial\left[\operatorname{tr}(\boldsymbol{A}^2)\cdot\boldsymbol{A}^3\right]}{\partial\boldsymbol{A}}=\,? \end{align*} with respect to a matrix $\boldsymbol{A}$, where $\operatorname{tr}(\cdot)$ is the scalar function of the matrix, viz., the trace of the matrix.
I tried using the derivation formula below, but this formula doesn't seem to work.
\begin{align*} \dfrac{\partial\left[\underset{n\times\,n}{\boldsymbol{A}}(\boldsymbol{X})\cdot\underset{n\times\,n}{\boldsymbol{B}}(\boldsymbol{X})\right]}{\partial\boldsymbol{X}}=\dfrac{\partial\left[\underset{n\times\,n}{\boldsymbol{A}}(\boldsymbol{X})\right]}{\partial\boldsymbol{X}}\left[\boldsymbol{E}_{n}\otimes\underset{n\times\,n}{\boldsymbol{B}}(\boldsymbol{X})\right] +\left[\boldsymbol{E}_{n}\otimes\underset{n\times\,n}{\boldsymbol{A}}(\boldsymbol{X})\right]\dfrac{\partial\left[\underset{n\times\,n}{\boldsymbol{B}}(\boldsymbol{X})\right]}{\partial\boldsymbol{X}} \end{align*}