[Math] Derivative of angle between two vectors singularity!

linear algebratrigonometryvector analysis

I have been battling a problem of needing to know the derivative of the angle between two vectors, the vectors possibly being parallel at some points in time. I started off with:

$$\bf A \dot \bf B = \|A\|\|B\|\cos\theta \Rightarrow \theta=\arccos \left( \frac{\bf A \dot \bf B}{\|A\|\|B\|} \right)$$

Let's say that $\bf A$ and $\bf B$ are unit vectors for simplicity so:

$$
\theta=\arccos \left( \bf \hat A \dot \bf \hat B \right)
$$

To find the derivative of the angle $\theta$:

$$
\dot \theta = \frac{-1}{\sqrt{1-\left(\bf \hat A \dot \bf \hat B\right)^2}} \left[\bf \dot{\hat A}\dot \bf \hat B+\bf {\hat A}\dot \bf \dot{\hat B}\right]
$$

But, $\bf{\hat A} \dot \bf{\hat B}=$$1$ when $\bf \hat A \,\,\|\,\, \bf \hat B$ and the denominator of the expression for $\dot \theta$ becomes $0$. We hence get a division by $0$. Now I have tried other ways – by projecting $\bf{\hat B}$ onto $\bf{\hat A}$ and taking $\arctan$, by projecting $\bf{\hat B}$ onto a plane and forming a right-angle triangle and again taking $\arctan$. Every method I tried leads to the same singularity when $\bf \hat A \,\,\|\,\, \bf \hat B$.

Question: what method can I use such that I don't get a singularity for $\dot\theta$ when $\bf{\hat A}$ becomes parallel to $\bf{\hat B}$? Thank you!

Best Answer

You cannot get rid of the singularity. Note that in ${\mathbb R}^d$ with $d\geq3$ the angle between two vectors ${\bf a}$, ${\bf b}$ is nonoriented, implying that we always have $$\angle({\bf a},{\bf b})\in[0,\pi]\ .$$ Consider the following example in ${\mathbb R}^3$: $${\bf a}(t):=(1,0,0),\quad{\bf b}(t):=(\cos t,\sin t,0)\qquad(-1<t<1)\ .$$ Then $$\phi(t):=\angle\bigl({\bf a}(t),{\bf b}(t)\bigr)=|t|\ ,$$ and this is not differentiable at $t=0$.

Related Question