Detecting distance moved by accelerometer?
This is normally referred to as Dead Reckoning.  The processes of determining position using known values, such as acceleration.  

First we have to relate acceleration, velocity and position mathematically.  Velocity is the integral of acceleration with respect to time:



Similarly, position is the integral of velocity with respect to time:



Here is an explanation that should tie this all together.  However, it appears this explanation goes in the reverse order.  That is using derivatives of position to find velocity.  And derivatives of velocity to find acceleration.  Simply put, finding a derivative is the opposite process of finding an integral.

A final note, this all works well on paper.  In reality Dead Reckoning based only on acceleration does not work very well.  For instance, I believe most vehicle GPS systems tend to use steering and speed if Dead Reckoning is to be used for guidance.

Added later...

Found this web site where someone talks specifically about Dead Reckoning using an Arduino. He is simply using the deltas of filtered acceleration readings:

velocity(i) = velocity(i-1) + acceleration (i)
position(i) = position (i-1) + velocity (i) 


But goes on to say accumulated errors causes drift and positioning errors.