I was thinking about gravitational slingshots so I broke it down to a simple thought experiment: a ball being hit by a massive object. You have a ball of small mass m and a big moving object of large mass M moving at v = 10 m/s. The ball sees the wall approaching at 10 m/s. When the wall hits the ball the ball moves away from it at the same relative velocity, 10 m/s. Both frames should be the same if the ball moves to the wall or the wall move towards the ball. This means the ball has to be moving at 20 m/s in order to be moving away from the wall at the relative speed of 10 m/s. How does one derive this relationship mathematically.