I would like some hints on how to derive the following function with respect to the matrix $X$:
$$ f(X)=\left\| y - \sum_k (h_k X^k)x \right\|_2^2$$
where $X$ is a matrix, $x$ and $y$ are two given vectors and $h_k$ is a (given) scalar coefficient that weights the matrix. This is the composition of a convex function (the norm) with a non affine function. I want to linearize the function with respect to X, so I would like to compute the derivative. Some hints?