I have an objective $f(x) = \mathbf{c}^T(\mathbf{A}+x\mathbf{B})^{-1}\mathbf{d}$, where $\mathbf{A}, \mathbf{B}\in \mathbb{R}^{n\times n}$ are two known matrice, $\mathbf{c},\mathbf{d} \in \mathbb{R}^{n}$ are two known vectors, and $x$ is a scaler variable. I want to obtain the derivatives $\frac{df(d)}{dx}$, and I know that this derivatives can be moved in the the product, that is $$ \frac{df(x)}{dx} = \mathbf{c}^T \frac{(\mathbf{A}+x\mathbf{B})^{-1}}{x} \mathbf{d} $$ The key is to obtain the derivative matrix $\frac{(\mathbf{A}+x\mathbf{B})^{-1}}{x}$. However, I am stuck by the inverse term and do not know how to obtain the inner derivative matrix.
Can someone help with this derivatives? Thanks ahead.
I tried to solve this problem with the following. Let $\mathbf{H} = (\mathbf{A} + x\mathbf{B})^{-1}$, and we have $$ (\mathbf{A} + x\mathbf{B})\mathbf{H} = \mathbf{I}. $$ Take derivatives on the both sides of the above equation w.r.t $x$, we have $$ \mathbf{A}d\mathbf{H}+dx\mathbf{B}\mathbf{H}+x\mathbf{B}d\mathbf{H} = \mathbf{0} $$ $$ (\mathbf{A} + x\mathbf{B})d\mathbf{H}=-dx\mathbf{B}\mathbf{H} $$ $$ \frac{d\mathbf{H}}{dx} = -(\mathbf{A} + x\mathbf{B})^{-1}\mathbf{B}\mathbf{H} = -(\mathbf{A} + x\mathbf{B})^{-1}\mathbf{B}(\mathbf{A} + x\mathbf{B})^{-1} $$