Can we use product rule to take derivative of matrix with a vector

derivativeslinear algebra

We can take derivative of a product using product rule like this $$d/dx[f(x)g(x)] = f'(x)g(x) + f(x)g'(x)$$

But can we use product rule when taking a derivative of a product of matrix and a vector $a$, like this $$d/dx[Ma] = M'a + Ma'$$

And to make it more complicated taking derivating of matrix with vector sum of vector a and b: $$d/dx[M (a+b)] = M'(a+b) + M(a'+b')$$

Would these assumptions be correct?

Best Answer

If a matrix $M$ and a vector $a$ are both functions of some parameter $x$, then yes the product rule looks the same.

Let $M^i_j$ be the components of $M$, and $a^i$ be the components of $a$. Then the components of the vector $Ma$ are $$(Ma)^i = \sum_j M^i_j a^j = \sum_j M^i_j(x) a^j(x).$$ Now just differentiate to get that the coordinates of the product vector are $$\frac{d}{dx}(Ma)^i = \sum_j \left(\frac{d}{dx}M^i_j\right) a^j + M^i_j \left(\frac{d}{dx} a^j\right)$$ as a result of the usual product rule all of the functions $\{M^i_j,a^j\}$ of x.