Compute partial derivatives of a function I am working with this paper to identify the term structure of interest rate using the potential approach rather than one or tow factor models. Anyway I came to example 2 for $X_t$ which is stochastic define as $$dX_t=dW_t-B X_t \, dt$$ where $B$ is general $d \times d$ matrix and this $X_t$ has a multi-variant normal distribution. Then example 2 which is (exponential-quadratic example) give us the function 
$$f(x)= \exp \left( \frac{1}{2} (x-c)^T Q (x-c) \right)$$ where $c$ belongs to $\mathbb{R}^d$ and $Q$ is a $d \times d$ positive definite symmetric matrix. I want to find the first and second partial derivative of $f$ with respect to $x$ ?
I tried many times but I could not could any one guide me to the solution or help me by recommending books might help me distinguish the solution 
 A: I answered wrongly and noone noticed that it was absolutely wrong. This answer should be correct:
$$\frac{\partial f}{\partial x_i} = \frac{\partial}{\partial x_i}\left(\frac{1}{2} (x-c)^T Q (x-c) \right)\cdot\exp \left( \frac{1}{2} (x-c)^T Q (x-c) \right) = \frac{1}{2}\left(\frac{\partial}{\partial x_i}(x-c)^T Q (x-c) + (x-c)^T Q \frac{\partial}{\partial x_i}(x-c)\right)\cdot\exp \left( \frac{1}{2} (x-c)^T Q (x-c) \right) = \frac{1}{2}\left(e_i^T Q (x-c) + (x-c)^T Q e_i\right)\cdot\exp \left( \frac{1}{2} (x-c)^T Q (x-c) \right) = \frac{1}{2}\left(Q_{i\_} (x-c) + (x-c)^T Q_{\_i}\right)\cdot\exp \left( \frac{1}{2} (x-c)^T Q (x-c) \right)$$
$e_i$ stands for the i-th vector in Eucleidan basis.
$Q_{i\_}$ stands for i-th row of Q and $Q_{\_i}$ stands for i-th column of Q.
If $Q = Q^T$, it can be simplified to:
$$\frac{\partial f}{\partial x_i} = Q_{i\_} (x-c)\cdot\exp \left( \frac{1}{2} (x-c)^T Q (x-c) \right)$$
And now the second partial derivatives:
$$\frac{\partial^2 f}{\partial x_j x_i} = \frac{\partial}{\partial x_j}\left(Q_{i\_} (x-c)\right)\cdot Q_{j\_} (x-c)\cdot\exp \left( \frac{1}{2} (x-c)^T Q (x-c) \right) = \left(Q_{i\_} e_j\right)\cdot Q_{j\_} (x-c)\cdot\exp \left( \frac{1}{2} (x-c)^T Q (x-c) \right) = Q_{ij}\cdot Q_{j\_} (x-c)\cdot\exp \left( \frac{1}{2} (x-c)^T Q (x-c) \right)$$
