Q:

Basic Matrix Equation Manipulation

Given
$$ f(X) = \frac{1}{2}X^TQX$$
Can anyone explain and show me step-by-step or point me to a good reference (or video), as to how $ \nabla f(X)$ is given by,
$$ \nabla f(X) = QX$$

A:

I presume $X$ is a $n$-dimensional vector and $Q$ is a $n \times n$ symmetric matrix.
Bare hands approach:
$$f(X) = \frac{1}{2} X^\top Q X = \frac{1}{2} \sum_{i=1}^n \sum_{j=1}^n Q_{ij} X_i X_j$$
Compute partial derivative directly (use symmetry of $Q$):
$$\frac{\partial}{\partial X_k} f(X) = \frac{1}{2}\sum_{i\ne k} Q_{ik} X_i + \frac{1}{2} \sum_{j\ne k} Q_{kj} X_j + 2Q_{kk} X_k = \sum_{j=1}^n Q_{kj} X_j.$$
If you then construct $\nabla f(X)$ as the vector of partial derivatives, you will get $QX$.

