How to get distance when acceleration is not constant?

There are three cases here:

  1. The acceleration is a function of time $a(t)$. Then the velocity is $$v(t)=v_c+\int a(t)\,{\rm d}t \tag{1}$$ and the position as a function of time $$x(t)= x_c + \int v(t)\,{\rm d}t \tag{2}$$ The distance is calculated from $x(t)$.

  2. The acceleration is function of position $a(x)$. Then the velocity as a function of position is $$ \frac{1}{2}v(x)^2 = w_c + \int a(x)\,{\rm d}x \tag{3}$$ and the time as a function of position $$ t(x) = t_c + \int \frac{1}{v(x)}\,{\rm d}x \tag{4}$$ which needs to be back-solved for $x(t)$.

  3. Lastly, the acceleration is a function of velocity $a(v)$. Then the time as a function of velocity us $$ t(v) = t_c + \int \frac{1}{a(v)}\,{\rm d}v \tag{5}$$ and the position as a function of velocity is $$ x(v) = x_c + \int \frac{v}{a(v)}\,{\rm d}v \tag{6}$$ which need to be back-solved for $x(v(t))$

Where $x_c$, $v_c$, $t_c$ and $w_c$ are integration constants of appropriate units

Example 1

$ a(t) = -100 \sin(10 t)$, with $x(0)=0$ and $v(0)=10$ $$ v(t) = \int -100\sin(10 t)\,{\rm d}t = 10\,\cos(10 t) $$ $$ x(t) = \int 10\cos(10 t)\,{\rm d}t= \sin(10 t)$$

Example 2

$ a(x) = -100 x$, with $x(0)=0$ and $v(0)=10$ $$ \frac{1}{2}v(x)^2 = \int -100 x {\rm d}x = 50 (1-x^2) $$ $$ v(x) = 10 \sqrt{\left(1-x^2\right)} $$ $$ t(x) = \int \frac{1}{10 \sqrt{\left(1-x^2\right)}}\,{\rm d}x = \frac{\sin^{-1}(x)}{10} $$ $$ x(t) = \sin(10 t) $$

Example 3

$ a(v) = 100 - 5 v $, with $x(0)=0$ and $v(0)=10$ $$t(v) = \int \frac{1}{100 - 5 v}\,{\rm d}v = -\frac{1}{5}\ln{ \left( \frac{20-v}{10} \right) } $$ $$x(v) = \int \frac{v}{100 - 5 v}\,{\rm d}v = 2-\frac{v}{5}-4 \ln{\left(\frac{20-v}{10}\right)} $$ with solution $v(t) = 20-10 \hat{e}^{-5 t}$ and $x(v(t)) = 2 \hat{e}^{-5 t}+20 t-2 $


Technically, the equation

$$d = \frac{\mathrm{d}x}{\mathrm{d}t}t + \frac{\mathrm{d}^2x}{\mathrm{d}t^2}\frac{t^2}{2}$$

is not right. Instead, for constant acceleration, you need

$$d = \left(\left.\frac{\mathrm{d}x}{\mathrm{d}t}\right|_0\right) t + \left(\left.\frac{\mathrm{d}^2x}{\mathrm{d}t^2}\right|_0\right) \frac{t^2}{2}$$

In other words, a quantity like $\mathrm{d}x/\mathrm{d}t$ changes in time, but you want to use the initial velocity only. I think this is what you probably intended to begin with, though.

If you wanted to solve the problem purely kinematically, then you could try to expand the position in a Taylor series as you wrote in your answer. However, this only works if the function is equal to its Taylor series. For simple functions like exponentials and trig functions this is true, but for a person driving a car it is not. If a function equals its Taylor series everywhere, then if you observe its position over any finite interval of time, no matter how short, you can completely determine what the car will do in the future. This is not realistic.

Instead, you will want some way of determining either the velocity or the acceleration as a function of time or position. In physics, it is common to be able to determine the acceleration as a function of position. The reason is that acceleration comes from the equation $$F=ma$$ so that if you can determine the forces present, you know the acceleration, and higher-order derivatives are not necessary.

If you know the velocity as a function of time, you can simply integrate it to find the displacement. $$d(t) = \int_{t_0}^t v(t') \mathrm{d}t'$$

If you know the acceleration as a function of time, you can integrate that too, although this situation is less common.

$$d(t) = v_0(t - t_0) + t\int_{t_0}^t a(t')\mathrm{d}t' - \int_{t_0}^t t'a(t')\mathrm{d}t'$$

I found this expression by looking for something whose derivative with respect to time was the velocity

$$v(t) = v_0 + \int_{t_0}^t a(t')\mathrm{d}t'$$

If you know the velocity as a function of position, you have the differential equation

$$\frac{\mathrm{d}x}{\mathrm{d}t} = v(x)$$

which you can solve by separation of variables.

If you know the acceleration as a function of position, you have the differential equation

$$\frac{\mathrm{d}^2x}{\mathrm{d}t^2} = a(x)$$

which is not always easy to solve. In more realistic scenarios, the acceleration will depend not only on the object's own position, but also on the positions of the things it's interacting with. This gives coupled differential equations, which can be simplified in a special cases, but frequently can only be solved numerically.


You can keep on adding higher order derivatives until they become vanishingly small. A convenient point of entry to this topic would be the Wikipedia article Jerk (physics).

Bear in mind that when you're in a car, jerk is only of relevance during the time when the accelerator pedal is actually moving, to a first-order approximation.

Update: It seems a question with a great deal of relevance to yours was posed a few hours ago on math.se - What is an example of an application of a higher order derivative ($y^{(n)}$, $n≥4$)?. Arturo's answer expands on higher derivatives in kinematics (jounce!), whilst Greg's answer includes a source of jerk in driving I didn't consider (steering).