Given $\alpha$ a scalar, $\mathbf{X}$ an $N_x \times 1$ vector that is a function of $\alpha$, $\mathbf{U}$ an $N_u \times 1$ vector that is a function of $\alpha$ and $\mathbf{X}$, and $\mathbf{C}$ an $N_u \times N_u$ matrix that is a function of $\alpha$, $\mathbf{X}$, and $\mathbf{U}$. I am trying to compute the total derivative of $\mathbb{F} = \mathbf{C} \mathbf{U}$ with respect to $\alpha$ using the chain rule:
$$\underbrace{\frac{d \mathbb{F}}{d \alpha}}_{N_u \times 1} = \underbrace{\frac{\partial \mathbb{F}}{\partial \alpha}}_{N_u \times 1} + \underbrace{\frac{\partial \mathbb{F}}{\partial \mathbf{X}}}_{N_u \times N_x} \underbrace{\frac{\partial \mathbf{X}}{\partial \alpha}}_{N_x \times 1} + \underbrace{\frac{\partial \mathbb{F}}{\partial \mathbf{U}}}_{N_u \times N_u} \underbrace{\frac{\partial \mathbf{U}}{\partial \alpha}}_{N_u \times 1},$$
The first term is straight forward. How can I compute the second term on the RHS and put it in the above form (i.e., put $\frac{\partial \mathbf{X}}{\partial \alpha}$ on the right)?
I figured out the following:
$$\underbrace{\frac{\partial \mathbb{F}}{\partial \mathbf{X}}}_{N_u \times N_x} \underbrace{\frac{\partial \mathbf{X}}{\partial \alpha}}_{N_x \times 1} = \underbrace{\frac{\partial \mathbf{C}}{\partial \mathbf{X}}}_{N_u \times N_u \times N_x} \underbrace{\frac{\partial \mathbf{X}}{\partial \alpha}}_{N_x \times 1} \underbrace{\mathbf{U}}_{N_u \times 1} + \underbrace{\mathbf{C}}_{N_u \times N_u} \underbrace{\frac{\partial \mathbf{U}}{\partial \mathbf{X}}}_{N_u \times N_x} \underbrace{\frac{\partial \mathbf{X}}{\partial \alpha}}_{N_x \times 1},$$
As you can see, confusion comes from the first term on the RHS in the above equation. I can't figure out how to perform the derivative of the matrix $\mathbf{C}$ with respect to $\mathbf{X}$ and how to put the size correctly so the multiplication is correct. Finally, in such case, is it possible to reorder the term to put $\frac{\partial \mathbf{X}}{\partial \alpha}$ on the right?
The context is optimization of fluid-structure interaction problems if any one is interested. Any help is highly appreciated.
$\def\p#1#2{\frac{\partial #1}{\partial #2}}$Let's use a convention where an uppercase Latin letter represents a matrix, lowercase Latin a vector, and lowercase Greek a scalar, i.e. make the following substitutions $$F\to f\quad U\to u\quad X\to x$$ Let's also avoid subscripted variable names, because we'll be using subscripts to denote components and summations $$N_u\to n\qquad N_x\to m$$ Now we're ready to convert the expressions $$\eqalign{ f &= Cu \\ \p{f}{x}\,\p{x}{\alpha} &= \p{C}{x}\,\p{x}{\alpha}\,u + C\,\p{u}{x}\,\p{x}{\alpha} \\ }$$ to index notation $$\eqalign{ f_i &= \sum_{j=1}^n C_{ij}u_j \\ \sum_{k=1}^m\left(\p{f_i}{x_k}\,\p{x_k}{\alpha}\right) &= \sum_{j=1}^n\sum_{k=1}^m\left( \p{C_{ij}}{x_k}\,\p{x_k}{\alpha}\,u_j + C_{ij}\,\p{u_j}{x_k}\,\p{x_k}{\alpha} \right) \\\\ }$$ So that's the brute-force method, but if you tell us the functions which define the $(C,u,x)$ variables, then there may be an easier solution to the problem.