Me and a friend of mine have been trying to solve the following problem for about two weeks now but we keep getting stuck.
$$ f(\vec{H},\vec{\alpha}) = \sum_{i=1}^n (\hspace{3pt} ||\vec{a_i}||-(\hat{r_{a_i}} \cdot \vec{H} + \hat{r_{a_i}}\cdot(\vec{\alpha} \times \vec{r_i})) \hspace{3pt})^2$$
The idea is that you're given $\vec{a_i}$ as input which is data from an accelerometer. This data represents some combination of linear and rotational acceleration, $\vec{H}$ and $\vec{\alpha}$ respectively.
Our goal then is to estimate $\vec{H}$ and $\vec{\alpha}$ based on a given value for $\vec{a_i}$. To do this we try to minimize the square error between the given value and the estimated values. To this end, we've been trying to come up with the gradient of this function and we get the following
$$ \frac{\partial{f} }{\partial{\vec{H}}} = 2*[ ||\vec{a_{i}}||-(\hat{r_{a_{i}}} \cdot \vec{H} + \hat{r_{a_i}}\cdot(\vec{\alpha} \times \vec{r_i})) \hspace{3pt}] *\hat{-r_{a_i}}$$
Which we get by applying the chain rule. The problem is that when we try to get the second part of the gradient, $\frac{\partial{f} }{\partial{\vec{\alpha}}}$, we get stuck here
$$ \frac{\partial{f} }{\partial{\vec{\alpha}}} = 2*[ ||\vec{a_{i}}||-(\hat{r_{a_{i}}} \cdot \vec{H} + \hat{r_{a_i}}\cdot(\vec{\alpha} \times \vec{r_i})) \hspace{3pt}] *?$$
So again, applying the chain rule gets us that first term easy enough, but we just can't figure out $\textbf{how to compute $\frac{\partial{f} }{\partial{\vec{\alpha}}} (\alpha \times \hat{r_i})$}$. It's that cross product that's really tripping us up.
Everything in this problem is a known constant , besides $\vec{H}$ and $\vec{\alpha}$ which are both in $\mathbb{R^3}$ . Specifically, $\vec{r_i}$ is a position vector, while $\vec{r_{a_i}}$ is one of the standard 3D unit vectors.
I hope this makes sense and that it isn't overwhelming. I've tried to explain my issue as clearly as I can, but if you have any calrifying questions then please by all means go ahead and ask. Also, if there's a better way to format or ask this question let me know and I'll make the appropriate edits. We're really at the end of our rope here, so any help is greatly appreciated.
The simplest way is probably to note that $a\cdot (b \times c) = b \cdot (c\times a)$ which when used on the $\alpha$ term puts it into a similar form as the $H$ term (a scalar product between $\alpha$ and a vector).
You may look at e.g.: Cross product and Triple product