# Differentiating $t \mapsto$ $(P+$ $tQ)^{-1}$ at for an invertible matrix $P$ at $t=0$

Recently, I have been reading about differentiating matrix-valued functions. I read that when finding the directional derivative of an inverse matrix, it is easiest to do this with the identity matrix (i.e., differentiate $$AA^{-1}=I_n$$ and use an analogue of the product rule to rearrange for the derivative of the inverse of $$A$$). I have tried this on some examples from other problems that I have attempted, and want to know if my understanding here is correct.

Evaluate and simplify: $$\frac{d}{dt} \left( (P+tQ)^{-1} \right)$$ at $$t=0$$, where the matrix $$P$$ is invertible.

My understanding here would be to consider:

$$(P+tQ)(P+tQ)^{-1} = I_n$$

If we differentiate both sides of this, then the derivative of the identity matrix will be the zero matrix, and on the left hand side we apply the product rule. By rearrangement for the derivative of $$(P+tQ)^{-1}$$, I have got that this derivative is equal to:

$$\frac{-Q(P)^{-1}}{P}$$

Is this approach correct or can this be further simplified (or have I made a mistake up to this point?). I would be grateful for any feedback.

• I advise you to not use $/$ when the denominator is a matrix. Use the $\cdot^{-1}$ appropriately Commented Nov 7, 2022 at 10:48

Let us denote $$(P+tQ)^{-1}$$ by $$f(t).$$ Then we have

$$(P+tQ)f(t) = I_n.$$

Differentiation gives

$$Qf(t)+(P+tQ)f'(t),$$

thus

$$Q(P+tQ)^{-1}+(P+tQ)f'(t),$$

for $$t=0$$ this gives $$QP^{-1}+Pf'(0).$$ Left multiplication with $$P^{-1}$$ yields

$$P^{-1}QP^{-1}=-f'(0).$$

• Why not use $= 0$? Commented Nov 7, 2022 at 10:46

It is correct until " I have got that this derivative is equal to" but $$\frac{-Q(P)^{-1}}P$$ should be written $$-P^{-1}QP^{-1}$$ ($$\frac{\cdot}P$$ is ambiguous since the matrix product is not commutative).

More generally, as you probably know since you "have recently been reading about differentiating matrix valued functions": if $$t\mapsto A(t)$$ is differentiable at $$t_0$$ and if $$A(t_0)$$ is invertible, then$$\frac{d A^{-1}}{dt}(t_0)=-A^{-1}(t_0)\frac{d A}{dt}(t_0)A^{-1}(t_0).$$ Note that the differentiability of $$A^{-1}$$ needs to be proved before having the right to write $$A\cdot A^{-1}=I_n\Rightarrow A'A^{-1}+A(A^{-1})'=0.$$ Posts adressing this are Derivative of matrix inverse from the definition and differential inverse matrix.

• Just differentiate the product (as you did before) and use that now, you know the derivative of $(I_n+tH)^{-1}.$ Commented Nov 7, 2022 at 11:11
• No, I just mean $(CBA)'=C'BA+CBA'$ with $A=I_n+tH$ and $C=A^{-1}$, and then use that you know (from your initial post) that $C'=-A^{-1}A'A^{-1}.$ Commented Nov 7, 2022 at 11:22

Let $${\bf M} (t) := ( {\bf P} + t {\bf Q} )^{-1}$$. Hence,

\begin{aligned} {\bf M} (t + {\rm d} t) &= \left( ( {\bf P} + t {\bf Q} ) + {\rm d}t \, {\bf Q} \right)^{-1} \\ &= \left( ( {\bf P} + t {\bf Q} ) \left( {\bf I} + {\rm d}t \, {\bf M} (t) \, {\bf Q} \right) \right)^{-1} \\ &= \left( {\bf I} + {\rm d}t \, {\bf M} (t) \, {\bf Q} \right)^{-1} {\bf M} (t) \\ &= \left( {\bf I} - {\rm d}t \, {\bf M} (t) \, {\bf Q} \right) {\bf M} (t) = {\bf M} (t) - {\rm d}t \, {\bf M} (t) \, {\bf Q} \, {\bf M} (t)\end{aligned}

and, thus,

$${\dot{\bf M}} (t) = \color{blue}{- {\bf M} (t) \, {\bf Q} \, {\bf M} (t)}$$

Let $$\varepsilon > 0$$ such that $$\varepsilon^2 = 0$$. Hence,
$$( {\bf I} + \varepsilon {\bf A} ) ( {\bf I} - \varepsilon {\bf A} ) = {\bf I} - \varepsilon^2 {\bf A}^2 = {\bf I}$$
and, thus, $$( {\bf I} + \varepsilon {\bf A} )^{-1} = {\bf I} - \varepsilon {\bf A}$$.