Derivative of l2 norm with chain rule If $X$ is a $n$ by $d$ matrix, $\alpha$ is a $n$ by $1$ vector, let $f(\alpha) = \left\Vert X^\top\alpha \right\Vert_2^2$, what is $\frac{df}{d\alpha}$

${df(\alpha)\over d\alpha}={d\|X^T\alpha\|_2^2\over d\alpha}={d\|X^T\alpha\|_2^2\over dX^T\alpha}{dX^T\alpha\over d\alpha}=2\alpha^TXX^T$
