# solve for time given distance, initial velocity, and acceleration

I've been having trouble sorting this one out. I need to compute the time it will take for a vehicle traveling along a straight line to reach a particular point. I have the initial velocity ($v_i$), acceleration ($a$), and distance ($dx$) to the point. I don't have the final velocity $v_f$ nor the time $t$ I've been trying to solve this equation for time ($t$) but that's where I'm stuck.

$$dx = v_it + {1\over2}at^2$$

-

## 2 Answers

You know everything except t in this equation. Therefore you should be able to re-arrange the equation into the form at^2 + bt + c = 0, the quadratic form. From there, you need to solve the quadratic (using the quadratic formula for example) to get two solutions for t. Since negative t does not make sense in this context, your answer will be the positive value for t.

-
Well, it's possible to get two positive solutions, in case $a$ and $dx$ have opposite signs. The desired answer is probably the smallest positive solution. – Rahul Dec 26 '12 at 16:39
In this case $dx$ and $v_i$ are positive but $a$ can be negative. – progrmr Dec 26 '12 at 21:49
It looks like there may also be the case where there is no real solution (where the discriminant < 0). I'll have to deal with that situation in the software also. Thanks! – progrmr Dec 26 '12 at 22:10

Use the Quadratic Formula. ${}{}{}{}{}{}{}{}{}$

-
Thanks for the link, that's a very helpful page. – progrmr Dec 26 '12 at 22:11