# How do you calculate the displacement of an object moving with a changing acceleration? [duplicate]

Take an object a vertical distance $r$ above the surface of the earth of radius $R$.

The acceleration due to gravity at any $r$ is therefore: $a=\frac{GM}{(R+r)^2}$

Lets say the object falls from rest for $t$ seconds, how far does it fall in this time?

I assume calculus is necessary but get lost in the calculations.

$$a=\frac{dv}{dt}$$ so... $$dv=\frac{GM}{(R+r)^2}dt$$

Where do I go from here or am I even on the right track?

I guess I want an integral where: $$ds=\int_0^t something . dt$$

but I don't know how to get there.

The trick is to use the identity $$a=\frac{dv}{dt}=\frac{dv}{ds}\ \frac{ds}{dt}=v\ \frac{dv}{ds}.$$ You can identify s with your $R+r$. Substitute, separate variables and integrate, not forgetting the arbitrary constant. You'll find you have an energy equation – which you might have been able to write down as your starting point!
Having found v as a function of s, you can write $v=\frac{ds}{dt}$, separate variables again, and find s as a function of t.