# How to solve/factor polynomials with coefficients that are dot products?

I need to solve the following equation:

$$4\left(\vec{a}\cdot\vec{a}\right)t^3+6\left(\vec{a}\cdot\vec{v}\right)t^2+\left(2\vec{v}\cdot\vec{v}+4\vec{a}\cdot\vec{s}\right)t+2\left(\vec{v}\cdot\vec{s}\right) = 0$$

for $t$, where $\vec{a}, \vec{v}, \vec{s}$ are known vectors. I managed to obtain the following factorization:

$$\left(2\vec{a}t^2+2\vec{v}t+2\vec{s}\right)\left(2\vec{a}t+\vec{v}\right) = 0$$

However, I run into a problem when actually finding $t$ using this factorization. For instance, one solution would be where the second factor is $0$:

$$t = \frac{-\vec{v}}{2\vec{a}}$$

But how would you divide two vectors? I have a similar problem when using the quadratic formula with the first factor. The factorization seems correct to me but clearly I am doing something wrong. Is there a way to factor the equation while preserving dot products or perhaps another method to resolve my issue? Thanks!

Also, for context, I am trying to solve the Closest Point of Approach problem with two bodies moving with constant acceleration rather than constant velocity, which is what most resources I have found assume. I can use a solver to find the necessary $t$ values but an analytical solution would be great for computational purposes.

I found a similar question asked here before but it does not look like anyone found an analytical solution. It's an old question and I am not sure how to contact the author to see if he found a solution. Here's a link: https://stackoverflow.com/questions/24244432/collision-detection-between-two-accelerating-spheres-with-no-initial-velocity

• Are your vectors $\vec{a},\vec{v},\vec{s}$ coplanar ? Nov 20, 2017 at 23:31
• Pay attention, a dot product $\vec{U} \cdot \vec{V}$ is zero if either $\vec{U}=0$ or $\vec{V}=0$ (particular cases) $\ \color{red}{O}\color{red}{R}: \ \ \vec{U} \perp \vec{V}$, the latter being the general case. Nov 21, 2017 at 0:01
• IMHO, unfortunately, your factorization does not provide a way to have an analytical solution better than to look directly for an analytical solution using Cardano's formulas for a third degree equation. Nov 21, 2017 at 0:13

Here is a clarification of your find-a-root problem, transforming it into a minimization problem that can be tackled with different, efficient tools (though not with analytical formulas), explaining what you call the (equivalent) "Closest point approach".

First of all, let it be clear that a dot product $\vec{U} \cdot \vec{V}$ is zero if

• either $\vec{U}=0$ or $\vec{V}=0$

• $\color{red}{O}\color{red}{R}: \ \ \vec{U} \perp \vec{V}$,

the latter being the general case.

Your equation deserves to be written in the following way :

$$\tag{1}2 \underbrace{\left(\vec{a}t^2+\vec{v}t+\vec{s}\right)}_{\vec{P(t)}} \cdot \underbrace{\left(2\vec{a}t+\vec{v}\right)}_{\vec{P'(t)}} = 0$$

where $\vec{P'(t)}$ is plainly the derivative of $\vec{P(t)}$ with respect to $t$.

But in (1), i.e., in $2 \vec{P(t)} \cdot \vec {P'(t)}=0$ we recognize the following differentiation :

$$\tag{2} \tfrac{d}{dt}\vec{\|P(t)\|^2} = 0$$

Thus (2), which expresses that a certain derivative is zero, is equivalent to find an extremum of function $\vec{\|P(t)\|^2}$ (in fact a minimum due to the convexity of the issue)

This function (of $t$) describes a curve, which is in fact a parabola (nothing surprizing for a move with constant acceleration!).

Thus our issue is to find the point of this curve that is closest to the origin.

If we assume that vectors $\vec{a},\vec{v},\vec{s}$ are coplanar, all the information is gathered in the figure below.

Consider the cyan circle as the limit position of a circle centered at the origin that has been inflated till it comes in contact with the parabola. The contact point corresponds to a particular value $t_0$ of $t$. The directing vector of the common tangent to the parabola and to the limit circle at this point is represented with a magenta color; in particular, it is orthogonal to the corresponding radius of the circle (the other magenta vector).

Edit : Why is parametric curve

$$\tag{3}\vec{P(t)}:=\vec{s}+t\vec{v}+t^2\vec{a}$$

a parabola ? Here is an explanation. First, let us define a new axes' origin $\Omega$ by setting $\vec{s}=\vec{0\Omega}$. It means that with respect to this new origin, (3) can be written $\vec{\tilde P(t)}=t\vec{v}+t^2\vec{a}$. Now, with this new origin $\Omega$, taking "slant axes" defined by $\vec{v}$ and $\vec{a}$ one gets equation $y=x^2$, the simplest possible equation for a parabola.

• You haven't answered my question about coplanarity of vectors $\vec{a},\vec{v},\vec{s}$. Besides, could you say if you have understood my solution or if some points are obscure ? (I have added some explanations at the end). Think that Math SE is done for promoting interactions between people. Nov 21, 2017 at 20:30
• Apologize for not responding earlier and thank you for the answer! Yes they are coplanar. The geometric intuition is great and something I did not see at all. But I mainly wish to find an analytic solution as I will be using a computer program to solve this equation for hundreds of vectors Nov 22, 2017 at 22:55
• For a computer, an iterative solution is a good alternative. Nov 23, 2017 at 16:25