Assume I have set of matrix-vector equations that look like the following:
$$\begin{bmatrix} x_{i,w} \\ y_{i,w} \\ z_{i,w} \end{bmatrix} = a \left(\mathbf{^{w}T_{c}}\right)^{-1}\left(\mathbf{K}\right)^{-1} \begin{bmatrix} u_{i} \\ v_{i} \\ 1 \end{bmatrix}$$
where $0 < i \leq n$, $a$ is a positive constant, $\mathbf{^{w}T_{c}}^{-1}$ is a $4 \times 4$ matrix, and $\mathbf{K}$ is a $4 \times 3$ matrix.
For each vector $\begin{bmatrix} x_{i,w} & y_{i,w} & z_{i,w} \end{bmatrix}^\top$, I have a scalar valued function $f_i$:
$$ f_i\left(\begin{bmatrix} x_{i,w} \\ y_{i,w} \\ z_{i,w} \end{bmatrix}\right) = s_i$$
The sum of all scalar valued functions is a scalar
$$ S = \sum_{i = 1}^{n}f_i $$
I would like to compute each of the scalar derivatives $\frac{\partial s_i}{\partial \mathbf{^{w}T_{c}}^{-1}}$ with respect to the matrix $\mathbf{^{w}T_{c}}^{-1}$ as well as the total derivative $\frac{S}{\partial \mathbf{^{w}T_{c}}^{-1}}$.
I think this requires the use of the chain rule, and I think that the derivative should have the same shape of $\mathbf{^{w} T_{c}}^{-1}$ but I am not sure.