# Derivative of a vector valued function

Let $f(\vec{x})=|\vec{x}|^2 \vec{x}$ be a function from $\mathbb{R}^n$ to $\mathbb{R}^n$. How does one differentiate such a function? I want to use the "abstract definition" and consider the $|\cdot|^2$ to be the dot product, and look at the sums of the squares of the components, but this seems unwieldy. What's the right approach here?

-

Suppose you want to calculate $grad f(\vec{a})$. Use the "Taylor expansion",
$f(\vec{a} + \vec{h}) = \langle \vec{a} + \vec{h}, \vec{a} + \vec{h} \rangle (\vec{a} + \vec{h}) = \| \vec{a} \|^2 \vec{a} + \langle \vec{a}, \vec{a} \rangle \vec{h} + 2 \langle \vec{a}, \vec{h} \rangle \vec{a} + O(\| \vec{h} \|^2) = f(\vec{a}) + \langle \vec{a}, \vec{a} \rangle \vec{h} + 2 \langle \vec{a}, \vec{h} \rangle \vec{a} + O(\| \vec{h} \|^2)$
The derivative means the linear term, thus in this case, it is the linear transformation that sends $\vec{h}$ to $\|\vec{a} \|^2 \vec{h} + 2 \langle \vec{a}, \vec{h} \rangle \vec{a}$.