Partial derivative of matrix functions with respect to a vector variable