I have a rotation matrix $\boldsymbol R \in \mathbb{R}^{3\times 3} $ which is a function of a certain angle parameter $\alpha$.
The roll-pitch-yaw angles can be extracted from the matrix, through some trigonometric functions of its entries.
For instance, one of such angles $\phi$ is then a function of the matrix $\boldsymbol R$, i.e. $\phi = f\left( \boldsymbol R\right) $.
I have to compute the derivative of $\phi$ with respect to $\alpha$:
$$\frac{\mathrm d \phi \left( \alpha \right )}{\mathrm d \alpha} = \frac{\mathrm d f\left( \boldsymbol R \left( \alpha \right )\right) }{\mathrm d \alpha} $$
How can I compute this derivative?
The following chain rule $$\frac{\mathrm d \phi \left( \alpha \right )}{\mathrm d \alpha} = \frac{\mathrm d f\left( \boldsymbol R \left( \alpha \right )\right) }{\mathrm d \boldsymbol R \left( \alpha \right )} \frac{ \mathrm d \boldsymbol R \left( \alpha \right )}{\mathrm d \alpha}$$ cannot be applied, because both these derivatives are 3x3 matrices while the result is, of course, a scalar.
All I have is the expression of function $f$ and the derivative of the matrix with respect to the angle $$\frac{ \mathrm d \boldsymbol R \left( \alpha \right )}{\mathrm d \alpha} = \boldsymbol S\left(\boldsymbol \delta\right) \boldsymbol R \left( \alpha \right )$$ where $\boldsymbol S\left( \boldsymbol \delta \right) $ is a skew symmetric matrix associated to cross product: $$ \boldsymbol S\left(\boldsymbol \delta\right) \boldsymbol v = \boldsymbol \delta \times \boldsymbol v$$ and, of course, some information about the structure, like $ \boldsymbol R^{-1} = \boldsymbol R^{T}$ or $\det (\boldsymbol R) = 1 $
EDIT:
As I feared, and as Bill Wallis's comment confirmed, the derivative may be simple using the vectorization $$\boldsymbol r := \begin{pmatrix} \boldsymbol c_{1} \\ \boldsymbol c_{2} \\ \boldsymbol c_{3} \end{pmatrix} $$ where $$\boldsymbol R = \begin{pmatrix} \boldsymbol c_{1} &\boldsymbol c_{2} & \boldsymbol c_{3} \end{pmatrix} $$ so that the derivative is simply the dot product between two vectors which is equivalent to consider all the entries as separate functions:
$$\frac{\mathrm d \phi \left( \alpha \right )}{\mathrm d \alpha} = \sum_{i=1}^{3}\sum_{j=1}^{3}\frac{\mathrm d \phi }{\mathrm d r_{ij} } \frac{ \mathrm d r_{ij}}{\mathrm d \alpha}$$
In any case, I still wonder whether a reasonable chain rule for derivatives involving matrices could exist, because this solution does not allow to exploit the information I already have about the derivative of the matrix.
For typing convenience, let $$G=\frac{\partial\phi}{\partial R}$$ We also know that the differential of $R$ in terms of $\alpha$ is $$dR = SR\,d\alpha$$ Use these two pieces of information to find the differential of $\phi$ and then its gradient $$\eqalign{ d\phi &= G:dR \cr &= G:SR\,d\alpha \cr \frac{d\phi}{d\alpha} &= G:SR \cr }$$ where a colon is used to denote the trace/Frobenius product, i.e. $\,\,\,A\!:\!B={\rm tr}(A^TB)$