Vectors and matrix as differential varaiables I have a function of matrix and vectors. I want to know how to calculate the derivative of this function with respect to the vectors.
 For examples: $a$ is a $2\times1$ vector. $M$ is a $2\times2$ matrix. The function reads $f=Ma$. Then how to calculate 


*

*$df/da$;

*$df/dM$ ?
 A: While I agree with the comments that $df/da$ is not awfully nice notation, I do not think that there are choices needed or one could call it "abuse of notation". I would would the question as follows: Take the vector spaces $M_2(\mathbb R)\cong\mathbb R^4$ and $\mathbb R^2$ and consider the function $f:M_2(\mathbb R)\times\mathbb R^2\to\mathbb R^2$ defined by $f(M,a):=Ma$. As a smooth function between finite dimensional vector spaces, this has a well defined derivative $Df:(M_2(\mathbb R)\times\mathbb R^2)\times(M_2(\mathbb R)\times\mathbb R^2)\to\mathbb R^2$, which is linear in the second variable. By restricting the second variable to one of the two factors, one obtains "partial derivatives" $D_1f:(M_2(\mathbb R)\times\mathbb R^2)\times M_2(\mathbb R)\to\mathbb R^2$ and $D_1f:(M_2(\mathbb R)\times\mathbb R^2)\times \mathbb R^2\to\mathbb R^2$, and it is quite reasonable to denote them by $\partial f/\partial M$ and $\partial f/\partial a$, respectively. 
The actual computation is very easy, since the action of matrices on vectors is a bilinear map. The derivative can be computed by as a directional derivative, i.e. $Df(M,a)(N,b)$ can be computed as the derivative at $t=0$ of the curve $f(M+tN,a+tb)=Ma+t(Mb+Na)+t^2Nb$, so $Df(M,a)(N,b)=Mb+Na$ or $D_1f(M,a)$ is the map $N\mapsto Na$ whereas $D_2f(M,a)$ is the map $b\mapsto Mb$. In sloppy notation you would say that $\partial f/\partial a=M$ (which is more reasonable) and $\partial f/\partial M=a$, where you have to understand that $a$ is viewed as a linear map from $M_2(\mathbb R)$ to $\mathbb R^2$. 
