# Solving an equation with vector coefficients

I want to solve $$(ct)^2 = d(t)\cdot d(t)$$ for $$t$$, where $$d(t) = \frac{1}{2}at^2 + vt + r$$

Where$$a, v$$, and $$r$$ are all 3-dimensional vectors in Cartesian coordinates. How can I do this?

• What is the variable that you want to solve for? – Henrik Schumacher Oct 8 '18 at 20:05
• (ct)^2 is a constant? – Ulrich Neumann Oct 8 '18 at 20:06
• t is the variable to solve for, c is the speed of light so a constant yes. – gct Oct 8 '18 at 20:16

If you define the three vectors explicitly as

A = {a1, a2, a3};
V = {v1, v2, v3};
R = {r1, r2, r3};


your equation evaluates to a polynom in t of order 4

eq = (c t)^2 == #.# &[1/2 A t^2 + V t + R] // Collect[#, t] &


which you might solve using MMA Solve[eq, t]

If you want preserve the invariant scalarproducts, the equation could be defined as follows

Clear[A, V, R]
(c t)^2 == {1/2 t^2, t, 1}.Outer[Dot, {A, V, R}, {A, V, R}].{1/2 t^2,t, 1}
(*c^2 t^2 ==1/2 t^2 A.R + R.R + 1/2 t^2 (1/2 t^2 A.A + R.A + t V.A) + t V.R+t (1/2 t^2 A.V + R.V + t V.V)*)


You can use TensorExpand. First, some assumptions, and your distance function:

\$Assumptions = (a|v|r) ∈ Vectors[3];

d[t_] := 1/2 a t^2 + v t + r


Then, use Solve on the tensor expanded equation:

Solve[
TensorExpand[d[t] . d[t] == (c t)^2],
t,
Quartics->False
]


{{t -> Root[ 4 r.r + 8 r.v #1 + (-4 c^2 + 4 a.r + 4 v.v) #1^2 + 4 a.v #1^3 + a.a #1^4 &, 1]}, {t -> Root[4 r.r + 8 r.v #1 + (-4 c^2 + 4 a.r + 4 v.v) #1^2 + 4 a.v #1^3 + a.a #1^4 &, 2]}, {t -> Root[4 r.r + 8 r.v #1 + (-4 c^2 + 4 a.r + 4 v.v) #1^2 + 4 a.v #1^3 + a.a #1^4 &, 3]}, {t -> Root[4 r.r + 8 r.v #1 + (-4 c^2 + 4 a.r + 4 v.v) #1^2 + 4 a.v #1^3 + a.a #1^4 &, 4]}}

Without the Quartics option, you get a mess of hard to understand radicals.