Derivative of the vector $\|y\|^2 \cdot x$

44 Views Asked by At

Let $x,y \in \mathbb{R}^n$ be two vectors of $n$ components.

I want do derivate the expression $\|y\|^2x$ with respect to $y$. This should be a matrix. Now, I know that the derivative of $\|y\|^2$ is $2y$, so I know the result should be a proper product of $2y$ and $x$ that results in a matrix. But is the answer the matrix $2yx^T$ or $2xy^T$? How do I know which order is correct?