In a gravity assist does the incoming velocity of a space craft effect how much speed it gains. For example say a rocket was approaching Jupiter for a gravity assist with speed v and another rocket was approaching with speed 2v. Would the incoming speeds (v and 2v) effect how much speed they are able to gain from Jupiter (for example, would the rocket at speed v gain more than the one at 2v because it spends more time around the planet and therefore has more time to gain more speed)?
I am looking for a proper quantitive relationship or proof of the effect of the velocity of a spacecraft going into an assist on the ability of the spacecraft to gain or lose speed. I am also curious what the effect on its ability to change direction (deflection angle) would be as well. If anyone can provide the proof or direct me somewhere where it is done it would be greatly appreciated.