# Derivative of a matrix

I want to know if this derivative is correct. I have derived this but not sure if this is correct. I think it is but just to confirm

F= A-(B/C)*D
where A,B,C and D are square matrices

dF/dx(partial derivative) = d(A-(B/C)*D)/dx

----- deriving the final result will be -----------

dA/dx - [(dB/dx - B*inv(C)*dC/dx)/C]*D - (B/C)*dD/dx

-
Do all 4 matrices have entries which are functions of $x$? Does $B/C$ mean $BC^{-1}$? –  Jason DeVito May 14 '12 at 18:25
Yes, the matrices are functions of x and it is B*inv(C) –  rajan sthapit May 14 '12 at 18:26

In general, if A and B are square matrices that depend on $x$, the multiplication rule applies: $$\frac{d(A B)}{dx} = \frac{dA}{dx} B + A \frac{dB}{dx}$$

Applying this, you result follows directly (but, please don't write $B/C$ instead of $B C^{-1}$)

$$\frac{d(A -B C^{-1} D)}{dx} = \frac{dA}{dx} - \frac{dB}{dx} C^{-1} D - B \frac{d \, C^{-1}}{dx}D - B C^{-1} \frac{dD}{dx}$$

What remains is to compute $\frac{d \, C^{-1}}{dx}$. But deriving $C C^{-1} = I$ we get

$$\frac{dC}{dx} C^{-1} + C\frac{d \, C^{-1}}{dx } = 0 \; \Rightarrow \; \frac{d \, C^{-1}}{dx} = - C^{-1}\frac{dC}{dx}C^{^-1}$$

which (check) is the generalization of $\frac{d (y^{-1})}{dx} = - \frac{1}{x^2}\frac{dy} {dx}$

Finally

$$\frac{d(A -B C^{-1} D)}{dx} = \frac{dA}{dx} - \frac{dB}{dx} C^{-1} D + B C^{-1}\frac{d \, C}{dx} C^{-1}D - B C^{-1} \frac{dD}{dx}$$

which, fixing notation, coincides with your result.

-
The above derivation is similar to mine except the signs. I think you forgot the - sign. Other than that it is similar to mine right? –  rajan sthapit May 14 '12 at 18:53
@rajansthapit: your result is (except for the bad notation) correct; perhaps your derivation is also correct –  leonbloy May 14 '12 at 18:56
But the signs are different aren't they? –  rajan sthapit May 14 '12 at 18:56
@rajansthapit: no they aren't (now) :-) (i have missed the initial minus) –  leonbloy May 14 '12 at 18:58