Finding displacement given time with changing acceleration I'm doing a projectile motion physics assignment, and as part of it, I want an equation that gives the displacement of projectile. The equations that I know are
$$s = ut+\dfrac{1}{2}at^2 \quad \tag{displacement}$$  
$$F_{\text{drag}} = \dfrac{1}{2}ρv^2CA \quad \tag{force due to drag}$$ 
$$a = \dfrac{f}{m} = \dfrac{ρv^2CA}{2m} \quad \tag{acceleration due to force}$$ 
$$v = u + at \quad \tag{velocity at any one time}$$ 
The issue with this is that when I try to insert the velocity equation $v = u + at$ into the force equation, I then have to insert the acceleration equation into the velocity equation, so it ends up on an infinite loop.  Am I just using the wrong equations, or is there something I'm missing?
Please help!
 A: In one dimension, this problem can be solved analytically. The steps of the solution are given on the hyperphysics website
I will reproduce the key steps here (for the problem of horizontal motion with quadratic drag - solution given here). We will combine all the coefficients that contribute to drag into a single coefficient $c = \frac12 \rho A C_D$ for simplicity. Then we can write the differential equation for the velocity $v$ as
$$m \dot{v} = - c v^2$$
Integrating:
$$\int \frac{dv}{v^2} = -\frac{c}{m}\int dt\\
\frac{1}{v} = \frac{ct}{m} + C$$
at $t=0$, $v=v_0$ so $C = \frac{1}{v_0}$ . Putting $\frac{m}{c v_0}=\tau$ we can write
$$v(t) = \frac{v_0}{1+ \frac{t}{\tau}}$$
Now we integrate once more to get position:
$$x(t) = v_0 \tau \log(1 + \frac{t}{\tau}) + C$$
If we put $x(0)=0$, then obviously $C=0$.
An interesting thing you find here is that there is NO LIMIT on the range of x - as the object slows down, the drag decreases more quickly. In reality, at very low speeds the drag becomes linear and the object stops - but mathematically this object never stops.
Usually people solve this kind of problem using numerical integration. In the very simplest way, you would use Euler's method of integration: based on the velocity at one time, you compute the force, and thus acceleration, and thus new velocity, at a later time point. And instantaneous velocity times time step gives new distance.
In pseudo code:
x = 0
v = v_init
g = 9.81
m = mass
drag_factor = 123.45 // whatever 1/2 rho C_d A is calculated to be
time_step = 0.01
tmax = 5
xmax = 100
time = 0
while (true):
  f = -drag_factor * v * v // add m*g here if gravity plays
  a = f / m
  v = v + time_step * a
  x = x + v * time_step
  time += time_step
  if x > xmax || time > tmax:
    break

It is much better to use either leapfrog or Runge-Kutta integration (look it up) - those methods do not suffer from the same defects as this very simplistic approach (which is not properly accounting for the change in force / velocity during the time step, and will therefore give very different answers when you change time step). But these methods allow you to do more complex motion (for example, a projectile traveling around earth, with drag due to the atmosphere which changes with altitude, and ditto for gravity).
Just for kicks, I wrote a variation of the above that increases the time step as the acceleration slows down using time_step=abs(0.001 * v_0 / a), so that you can better appreciate the asymptotic behavior. Sure enough, this looks a lot like a logarithmic curve (plotted on the same scale, using the expression derived above):

The agreement between the numerical integration and the closed form solution should give you reasonable confidence that this is the solution you were looking for (although it sounds like you were hoping for something that had a finite value...)
