Is there an easy way to compute the jacobian of a normalized vector?

1.2k Views Asked by At

If $x \in \mathbb{R}^3$ I want to compute the jacobian of the following function

$$ f(x) = \frac{x}{\lVert x \rVert } $$

If I proceed I get a matrix whose elements are

$$ a_{ij} = \begin{cases} \frac{1}{\lVert x \rVert} - \frac{x_i^2}{\lVert x \rVert^3} & i = j \\ -\frac{x_i x_j}{\lVert x \rVert^3} &i \neq j \end{cases} $$

Is this the most compact form? The derivation is based on the product rule componentwise.

2

There are 2 best solutions below

2
On BEST ANSWER

Extending user8469759's comment (and shortening $\nu := f(x)$).

There's even a bit simpler form, namely \begin{equation} \frac{1}{\lVert x \rVert}\left(I - \nu \nu^T \right). \end{equation} This also has a geometric interpretation: the mapping $y \mapsto (I - \nu \nu^T) y$ is a projection to the normal plane of $\nu$, in other words, it removes the component in the direction of the normalized vector $\nu$.

1
On

I get the same result: $$ \begin{align} J_{ij} &= \partial_j \left( \frac{x}{\lVert x \rVert} \right)_i \\ &= \partial_j x_i \left(\sum_k x_k^2\right)^{-1/2} \\ &= \frac{\delta_{ij}}{\lVert x \rVert} + x_i \left(-\frac{1}{2}\right) \left(\sum_k x_k^2\right)^{-3/2}(2 x_k \delta_{kj}) \\ &= \frac{\delta_{ij}}{\lVert x \rVert} - \frac{x_i x_j}{\lVert x \rVert^3} \end{align} $$