Derivative of $L_2$ Norm function

229 Views Asked by At

I have an equation of the form $f(x) = ||x - x_0 ||^2$ where $x$ and $x_0$ is in $R^n$.

What I want to do is Taylor expand this about a point - lets call this $x_a$. I know that: $f(x)$ is approximated $f(x_a) + (\operatorname{grad}(f(x_a))*(x-x_a)$ which is equivalent to $||x_a - x_0 ||^2 + (\operatorname{grad}(f(x_a))*(x-x_a)$.

The problem I have, is that I'm very unsure of how to calculate what $\operatorname{grad}(f(x))$ is.

I'd appreciate any help. (If someone can fix all the notation up, I'd appreciate it too!)

1

There are 1 best solutions below

0
On BEST ANSWER

For typing convenience, drop the subscripted $x$ variables in favor of $$a=x_a,\qquad z=x_0$$ Expand the norm using the dot product and write the function as $$\eqalign{ f &= (x-z)\cdot(x-z) \\ }$$ and calculate its gradient $$\eqalign{ df &= 2(x-z)\cdot dx \\ g(x) \;=\; \frac{\partial f}{\partial x} &= 2(x-z) \\ }$$ Therefore at $x=a,\,$ the gradient is $\,g(a)=2(a-z)\,$ and the first-order Taylor expansion becomes $$\eqalign{ f(a+h) &\approx f(a) + g(a)\cdot h \\ &= f(a) + 2(a-z)\cdot h \\ }$$ where $0<\|h\|\ll 1\;$ (i.e. $\,h$ is very small).