[Math] Derivative of cross product wrt vector

derivativeslinear algebravectors

I have the following function: $f(\dot r, r)=(\dot r+\omega\times r)^2$ where $\omega$ is constant.
I need to find $\partial f/\partial r$, but I'm struggling to figure out how to derive $\omega\times r$, which I need to do in order to use the chain rule.

As far as I can tell, because $\omega$ is constant, $\partial /\partial r (\omega\times r)=\omega \times \partial r/\partial r=\omega \times I$, but this seems wrong – is the cross product of a vector and a matrix even defined, or am I missing something earlier in the calculation?

Thanks for the help!

Best Answer

You can express the cross product as a matrix multiplication by introducting the function $$\operatorname{skw}\colon \mathbb R^3 \to \mathbb R^{3\times 3}, \omega\mapsto\operatorname{skw}(\omega) = \begin{bmatrix}0&-\omega_3 &\omega_2\\\omega_3&0&-\omega_1\\-\omega_2&\omega_3&0\end{bmatrix},$$ that maps each 3D vector on a skew-symmetric matrix which encodes the cross product: $$ a\times b = \operatorname{skw}(a)\cdot b $$ and of course $$ \frac d{db}\bigl(\operatorname{skw}(a)\cdot b\bigr) = \operatorname{skw}(a). $$ In your terms this means $$ \frac d{d r}\omega\times r = \frac d{d r} \operatorname{skw}(\omega)\cdot r = \operatorname{skw}(\omega).$$


In the following section I have derived the function $f$ that you gave with respect to $r$:

You write (assuming the squared vector means dot-multiplying it by itself) $$f(r,\dot r) = (\dot r + \operatorname{skw}(\omega)\cdot r)^T\cdot(\dot r + \operatorname{skw}(\omega)\cdot r) $$ and finally get \begin{align} \frac\partial{\partial r} f(r,\dot r) &= 2(\dot r + \omega\times r)^T\cdot\operatorname{skw}(\omega) \\ &= 2 \bigl(\operatorname{skw}^T(\omega)\cdot(\dot r + \omega\times r)\bigr)^T \\ &= -2 \bigl(\operatorname{skw}(\omega)\cdot(\dot r + \omega\times r)\bigr)^T \\ &= -2 \bigl(\omega\times(\dot r + \omega\times r)\bigr)^T \\ \end{align} because $\operatorname{skw}$ is antisymmetric. Note that $\frac{\partial f}{\partial r}$ is, as usual, a 3D row vector. If you need the column vector, use $\nabla_rf$.

Related Question