I have two curves ${\bf q}_0(t), {\bf q}_1(t)$. Each curve maps time $t$ to a unit quaternion. Construction of these curves is not important here, although we do have the respective time derivatives for the curves given by $\dot{\bf q}_0(t), \dot{\bf q}_1(t)$. My goal is to find a unit quaternion and its time derivate of the two curves blended by some parameter $p \in [0, 1]$. Using a slerp for the blended unit quaternion gives ${\bf q} = {\bf q}_0 ({\bf q}^*_0 {\bf q}_1)^p$, where ${\bf q}^*$ is the quaternion conjugate, and ${\bf q}^p = e^{p \log({\bf q})}$. For the sake of this discussion, assume $p$ is not time dependent. It will be in the final solution but for now let's not be bothered by that.
My question is how to compute the time derivative $\dot{\bf q}$. Intuitively, it appears to be something of the form $\dot{\bf q} = ((1 - p)\dot{\bf q}_0{\bf q}^*_0 + p\dot{\bf q}_1 {\bf q}^*_1) {\bf q}$, which is linearly interpolated angular velocities times blend result. This formula obviously is correct for $p = 0$ and for $p = 1$. I'm trying to find some mathematical backing for the general case.
Naively, taking $\dot{\bf q} = \dot{\bf q}_0({\bf q}^*_0 {\bf q}_1)^p + {\bf q}_0 p ({\bf q}^*_0 {\bf q}_1)^{p - 1} (\dot{\bf q}^*_0 {\bf q}_1 + {\bf q}^*_0 \dot{\bf q}_1)$ can't be correct in the general case, since the product operator does not commute.
I could use some help in finding the proper time derivative. In particular, I would like to know whether there is a general formula for $\frac{d}{dt}{\bf q}(t)^p$, for constant $p \in [0, 1]$. Perhaps someone with a grasp of Lie groups/algebras could shed some light on this. Thanks for your help.
You can write $\overline{q_0(t)}q_1(t)=\cos\theta(t)+\sin\theta(t)\,\mathbf{u}(t)$ where
$$ \theta(t)=\cos^{-1}\mathrm{Re}\big(\,\overline{q_0(t)}q_1(t)\big), \quad \mathbf{u}(t)=\frac{\mathrm{Im}\big(\,\overline{q_0(t)}q_1(t)\big)}{\|\mathrm{Im}\big(\,\overline{q_0(t)}q_1(t)\big)\|} $$
Then $(\overline{q_0}q_1)^p=\cos p\theta+\sin p\theta \,\mathbf{u}$, and you can differentiate from there. Of course you'll get possible continuity and ill-definedness issues whenever $q_1=\pm q_0$. I don't know what the context here is, but it might be possible to say $\overline{q_0}q_1=\exp(\mathbf{v})$ where $\mathbf{v}(t)$ is a 3D space curve (note $\mathbf{v}$ determines $\overline{q_0}q_1$ but not vice-versa, so in a sense $\mathbf{v}$ would be a more fundamental thing to know). If you go that route, you would still have to expand out $\exp(p\mathbf{v})$ with Euler's formula to differentiate, or else use the power series (and note the derivative of $\mathbf{v}(t)^n$ will have $n$ terms that are not "like" and don't combine).