Find the gradient of the function

derivativesmultivariable-calculusreal-analysisvector analysis

How do I find the gradient of a function like this? $F: \mathbb{R}^n-\{0\} \rightarrow \mathbb{R}^n$. $F(x)=\frac{x}{||x||}$ Attempt I guess find the gradient each component $D_1\frac{x_1}{\sqrt{x_1^2+\dots +x_n^2}}=\frac{x_2^2+\dots+x_n^2}{(x_1^2+\dots+x_n^2)^{3/2}}$ $D_2\frac{x_1}{\sqrt{x_1^2+\dots +x_n^2}}=\frac{-x_1x_2}{(x_1^2+\dots+x_n^2)^{3/2}}$ ,$D_3\frac{x_1}{\sqrt{x_1^2+\dots +x_n^2}}=\frac{-x_1x_3}{(x_1^2+\dots+x_n^2)^{3/2}}$,$…$ The answer given to me was $\nabla F(x)=\frac{I}{||x||}-\frac{xx^T}{||x||^3}$

Best Answer

You can use the following product rule for a scalar function $f$ and a vector valued function $F$: $$ \nabla(fF) = \nabla f\otimes F + f\nabla F, $$ in order to compute your gradient without components (Here, $v\otimes w = vw^T$). In your case $f(x) = (x^Tx)^{-\frac12}$ and $F(x)=x$, hence you get $$\begin{aligned} \nabla(fF) & = -\frac{1}{2}(x^Tx)^{-\frac32}\cdot (2x)\otimes x+(x^Tx)^{-\frac12}\nabla x \\ & = -\frac{x\otimes x}{\|x\|^3}+\frac{\mathrm{id}}{\|x\|} \end{aligned}.$$