2
$\begingroup$

How to calculate the derivative of $F=\frac{e^{W}-1}{W}$ in $\omega$ where $W = [\omega]_\times$ and $\omega\in\mathbb{R}^3$?

I am aware of a solution (solution 1) and briefly show below, but I am not happy with it for its complexity and am looking for a possibly better solution (solution 2). Inspired by hans' brilliant answer to a related question of mine, how to derive the inverse of F, I am now working on solving it by applying the Sylvester interpolation. The problem lies in that the result derived in solution 2 doesn't agree with 1 which has been verified using c++. It will be greatly appreciated if you could take a look. Thanks in advance!

solution 1:

\begin{align*} \frac{\partial F}{\partial \omega_i}=& \frac{\partial \frac{e^{[\omega]_\times}-I}{[\omega]_\times}}{\partial \omega_i}=\frac{\partial (\mathbf{I}+\frac{1-\cos\theta}{\theta^2}[\omega]_\times+\frac{\theta-\sin\theta}{\theta^3}[\omega]^2_\times)}{\partial \omega_i}\\ =&\frac{\partial(\frac{1-\cos\theta}{\theta^2})}{\partial \omega_i}[\omega]_\times+ \frac{1-\cos\theta}{\theta^2}\frac{\partial [\omega]_\times}{\partial \omega_i} + \frac{\partial(\frac{\theta-\sin\theta}{\theta^3})}{\partial \omega_i}[\omega]^2_\times+ \frac{\theta-\sin\theta}{\theta^3}\frac{\partial [\omega]^2_\times}{\partial \omega_i}\\ =&(\frac{-2(1-\cos\theta)}{\theta^3}+\frac{\sin\theta}{\theta^2})\frac{\partial \theta}{\partial \omega_i}[\omega]_\times+(\frac{1-\cos\theta}{\theta^2})[e_i]_\times+(\frac{-3(\theta-\sin\theta)}{\theta^4}+\frac{1-\cos\theta}{\theta^3})\frac{\partial \theta}{\partial \omega_i}[\omega]^2_\times\\ &+\frac{\theta-\sin\theta}{\theta^3}(\mathbf{e}_i\mathbf{v}^\top+\mathbf{v}^\top\mathbf{e}_i-2\omega_i\mathbf{I})\\ =&(\frac{-2(1-\cos\theta)}{\theta^3}+\frac{\sin\theta}{\theta^2})\frac{\omega_i}{\theta}[\omega]_\times+(\frac{1-\cos\theta}{\theta^2})[e_i]_\times+(\frac{-3(\theta-\sin\theta)}{\theta^4}+\frac{1-\cos\theta}{\theta^3})\frac{\omega_i}{\theta}[\omega]^2_\times\\&+\frac{\theta-\sin\theta}{\theta^3}(\mathbf{e}_i\mathbf{v}^\top+\mathbf{v}^\top\mathbf{e}_i-2\omega_i\mathbf{I})\\ =&\frac{-2\theta+3\sin\theta-\theta\cos\theta}{\theta^4}\frac{\omega_i}{\theta}W^2+\frac{-2+2\cos\theta+\theta\sin\theta}{\theta^3}\frac{\omega_i}{\theta}W\\ &+(\frac{1-\cos\theta}{\theta^2})[e_i]_\times+\frac{\theta-\sin\theta}{\theta^3}(\mathbf{e}_i\mathbf{v}^\top+\mathbf{v}^\top\mathbf{e}_i-2\omega_i\mathbf{I}) \end{align*} where $I$ is an identity matrix, $e_i$ is the $i$-th column of $I$ and $\theta=||\omega||$

solution 2:

we want to calculate $\frac{\partial F}{\partial \omega_i}=\frac{\partial \frac{e^{[\omega]_\times}-I}{[\omega]_\times}}{\partial \omega_i}$, so I am thinking of solving $\frac{\partial f}{\partial \omega_i}$, where $f(z)=\frac{e^z-1}{z}$ so we have: \begin{align*} \frac{\partial f(z)}{\partial \omega_i}=&\frac{\partial \frac{e^z-1}{z}}{\partial \omega_i}\\ =& \frac{\partial \frac{1}{z}}{\partial \omega_i}(e^z-1) +\frac{1}{z}\frac{\partial (e^z-1)}{\partial \omega_i}\\ =& -\frac{1}{z^2}\frac{\partial z}{\partial \omega_i}(e^z-1) +\frac{1}{z}e^z\frac{\partial z}{\partial \omega_i}\\ =&\frac{1-e^z}{z^2}\frac{\partial z}{\partial \omega_i}+\frac{e^z}{z}\frac{\partial z}{\partial \omega_i}\\ =&\frac{1-e^z+ze^z}{z^2}\frac{\partial z}{\partial \omega_i} \end{align*} Because of Sylvester interpolation, we know that $\frac{\partial F}{\partial \omega_i}=a_2W^2+a_1W+a_0I$ and

\begin{align*} a_0=&\phi(0)\\ a_1=&\frac{\phi(i\theta)-\phi(-i\theta)}{i2\theta}\\ a_2=&\frac{2\phi(0)-\phi(i\theta)-\phi(-i\theta)}{2\theta^2} \end{align*} where $\phi(z)=\frac{\partial f(z)}{\partial \omega_i}$, we have \begin{align*} a_0=&\frac{1}{2}\\ a_1=&\frac{\sin\theta-\theta\cos\theta}{\theta^3}\\ a_2=&\frac{1}{4\theta^2}+\frac{1-\cos\theta-\theta\sin\theta}{\theta^4} \end{align*} However, they do not agree with solution 1. I also tried to derive in the following methods:

Replace $z$ with $W=[\omega]_\times$ then we have: \begin{align*} \frac{\partial F}{\partial \omega_i} =& -\frac{1}{W^2}\frac{\partial W}{\partial \omega_i}(e^W-I) +\frac{1}{W}e^W\frac{\partial W}{\partial \omega_i}\\ =&-\frac{1}{W^2}[e_i]_\times(I+\frac{\sin\theta}{\theta}W+\frac{1-\cos\theta}{\theta^2}W^2-I) +\frac{1}{W}(I+\frac{\sin\theta}{\theta}W+\frac{1-\cos\theta}{\theta^2}W^2)[e_i]_\times\\ =&-\frac{1}{W^2}[e_i]_\times\frac{\sin\theta}{\theta}W-\frac{1}{W^2}[e_i]_\times\frac{1-\cos\theta}{\theta^2}W^2+\frac{1}{W}[e_i]_\times+\frac{\sin\theta}{\theta}[e_i]_\times+\frac{1-\cos\theta}{\theta^2}W[e_i]_\times \end{align*}

but I can't reach the results of solution 1 either.

1 Answers 1

2

Solution #2 is completely misguided. Plugging a matrix argument into a scalar derivative is not the same as differentiating that function with respect to a matrix argument.

Consider a simple function to illustrate the point $$\eqalign{ f &= x^3 \cr df &= 3x^2\,dx \cr \cr }$$ And now the matrix version $$\eqalign{ F &= X^3 \cr dF &= dX\,X^2 + X\,dX\,X + X^2\,dX \cr &\neq 3X^2\,dX\cr \cr }$$ In the above, assume that $dz$ stands for the time derivative of $z$.