Assume $S_1$ and $S_2$ are two $n \times n$ (positive definite if that helps) matrices, $c_1$ and $c_2$ are two variables taking scalar form, and $u_1$ and $u_2$ are two $n \times 1$ vectors. In addition, $c_1+c_2=1$, but in the more general case of $m$ $S$'s, $u$'s, and $c$'s, the $c$'s also sum to 1.
What is the derivative of $(c_1 S_1+c_2 S_2)^{-1}(c_1 u_1+c_2 u_2)$ with respect to both $c_1$ and $c_2$?