$Q(\beta) = YY^t - 2\beta^t X^t Y + \beta^t X^t X \beta$
Where $X$ is a fixed matrix and $Y$ a fixed vector.
So out of curiosity I wanted to derive the derivative expression which has been given:
$$DQ(\beta) = -2X^tY + 2X^t X \beta$$
So I began with the strategy of finding $Q(a+h) - Q(a)$.
Doing all the algebra I arrive at:
$$-(Xh)^t - y^tXh + (Xa)^t Xh + (Xh)^t Xa + (Xh)^t Xh$$
Recall that $x^ty = x \cdot y$. Using that I get:
$$-(Xh) \cdot t - y \cdot Xh + (Xa) \cdot Xh + (Xh) \cdot Xa + (Xh) \cdot Xh$$