Derivative of $(uA+C)^{-1}\mathbf{b}$ w.r.t. $u\in\mathbb{R}$

matricesmatrix equationsmatrix-calculusmultivariable-calculus

Given that $(uA+C)\mathbf{x}=\mathbf{b}$ where only $u\in \mathbb{R}$ and $\mathbf{x}\in\mathbb{R}^n$ are unknowns, and where $(uA+C)\in\mathbb{R}^{n\times n}$ is an invertible matrix, how can I determine $\frac{d\mathbf{x}}{du}$?

I rewrite the equation to $$\mathbf{x}=(uA+C)^{-1}\mathbf{b}$$

and wonder whether there is any way to find/simplify

$$\frac{d}{du}(uA+C)^{-1}\mathbf{b}$$

Background

In my particular case $(uA+C)\mathbf{x} = \mathbf{b}$ comes from

$$ \begin{bmatrix}
-x_1 & -y_1 & -1 & 0 & 0 & 0 & x_1x_1' & y_1x_1' & x_1' \\
0 & 0 & 0 & -x_1 & -y_1 & -1 & x_1y_1' & y_1y_1' & y_1' \\
-x_2 & -y_2 & -1 & 0 & 0 & 0 & x_2x_2' & y_2x_2' & x_2' \\
0 & 0 & 0 & -x_2 & -y_2 & -1 & x_2y_2' & y_2y_2' & y_2' \\
-x_3 & -y_3 & -1 & 0 & 0 & 0 & x_3x_3' & y_3x_3' & x_3' \\
0 & 0 & 0 & -x_3 & -y_3 & -1 & x_3y_3' & y_3y_3' & y_3' \\
-x_4 & -y_4 & -1 & 0 & 0 & 0 & x_4x_4' & y_4x_4' & x_4' \\
0 & 0 & 0 & -x_4 & -y_4 & -1 & x_4y_4' & y_4y_4' & y_4' \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\\
\end{bmatrix} \begin{bmatrix}h1 \\ h2 \\ h3 \\ h4 \\ h5 \\ h6 \\ h7 \\ h8 \\h9 \end{bmatrix} = \begin{bmatrix}0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\1 \end{bmatrix}$$

(which comes from here)

where $u$ is one of $x_1'$, $y_1'$, $x_2'$, $y_2'$, $x_3'$, $y_3'$, $x_4'$, $y_4'$. For example, for $u\equiv x_1'$ we have

$$ A = \begin{bmatrix}
0 & 0 & 0 & 0 & 0 & 0 & x_1 & y_1 & 1 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\end{bmatrix} $$

Edit

I vaguely remember a technique called implicit differentiation which I feel may be useful:

$$ \frac{d}{du}(uA+C)\mathbf{x}=\frac{d}{du}\mathbf{b} $$
$$ \frac{d}{du}uA\mathbf{x}+\frac{d}{du}C\mathbf{x}=\mathbf{0} $$
$$ A\frac{d}{du}u\mathbf{x}+C\frac{d\mathbf{x}}{du}=\mathbf{0} $$
$$ A(\mathbf{x}+u\frac{d\mathbf{x}}{du})+C\frac{d\mathbf{x}}{du}=\mathbf{0} $$
$$ A\mathbf{x}+(uA+C)\frac{d\mathbf{x}}{du}=\mathbf{0} $$
$$ \frac{d\mathbf{x}}{du}=-(uA+C)^{-1}A\mathbf{x} $$

… did I just solve it; is this correct?

Best Answer

Define $\,M=(C+uA)\,$ then the given equation becomes $\,Mx=b$

Differentiate the equation (with respect to $u)\,$ then solve for $\dot x=\left(\frac{dx}{du}\right)$ $$\eqalign{ \dot Mx + M\dot x = \dot b \\ Ax + M\dot x = 0 \\ \dot x = -M^{-1}Ax \\ }$$ This is indeed the implicit differentiation technique that you remembered.

Related Question