Where does the extra kinetic energy come from in a gravitational slingshot? I read in this answer in this site that the KE a free-falling ball acquires is not originated by the attracting body but that energy was actually stored in the ball when it had been lifted to the height it dropped from.
In this way, it was said, gravity is subject to the conservation of energy principle and cannot change the total energy of an object.
Consider now the maneuver known as a gravitational slingshot (also gravity assist) used by space probes such as the Voyager 2. A space probe approaches a planet with velocity $v$, slingshots around, and ends up with velocity $v+2U$, where $U$ is the velocity of the planet.
Consider the energy of the probe. Before, it was $E_i=\frac{1}{2} mv^2$ and after it is $E_f=\frac{1}{2} m(v+2U)^2$. It looks like $E_f$ is much bigger than $E_i$ - but where did the additional energy come from? 
Is this not a violation of the conservation of energy principle?
 A: Cory, here's a different way of thinking about gravity assists that may help:
First is my short answer for readers in a hurry:

What is really going on is a giant game of pool, with fast-moving planets acting as massive cue balls that impart some of their energy when they whack into tiny spacecraft. Since you can't bounce a spacecraft directly off the surface of a planet, it instead is steered to rebound smoothly off the immense virtual trampoline that gravity creates behind the planet. This field slows down and reverses the relative backward motion of a spacecraft to give a net powerful forward thrust (or bounce) as the spacecraft loops around in a U-shaped path behind the planet.
Next is my original, more story-style long answer:

Imagine a planet like Venus as a giant, perfectly elastic (bouncy) rubber ball, and your spacecraft as a particularly tough steel ball. Next, drop your steel ball spacecraft from space in such a way that it will hit the side of Venus that is facing forward in its orbit around the Sun.
The spacecraft will speed up as it falls towards the surface of Venus, but after it bounces — perfectly and without any loss of energy in this imaginary scenario — it will similarly slow down as the same gravity resists its departure. Just as with an elastic ball that at first speeds up when dropped and then slows down after bouncing on the floor, there is no net free "gravity energy" from the interaction.
But wait a second... there is another factor!
Because the spacecraft was dropped in front of the orbital path of Venus, the planet will be moving towards the satellite at tremendous speed when the bounce happens at the surface.
Venus thus acts like an incredibly fast, unimaginably massive cue ball, imparting a huge boost in velocity to the spacecraft when the two hit. This is a real increase in speed and energy that has nothing to do with the transient faster-then-slower speed change due to gravity.
And just as a cue ball slows down when it transfers impact energy to another ball, there is no free energy lunch here either: Venus slows down when it speeds up the spacecraft. It's just that its massive size makes the decrease in the orbital speed of Venus immeasurably small in comparison.
By now you probably see where I'm heading with this idea: If only there were a real way to bounce a spacecraft off of a planet that is moving quickly around the Sun, you could speed it up tremendously by playing what amounts to a gigantic interplanetary game of space pool.
The shots in this game of pool would be very tricky to set up, and a single shot might take years to complete. But look at the benefits!
Even if you start out with a relatively slow (and thus for space travel, cheap) spacecraft launch, a good sequence of whacks by planetary (or moon!) cue balls would eventually get your spacecraft moving so fast that you could send it right out of the solar system.
But of course, you can't really bounce spacecraft off of planets in a perfectly elastic and energy conserving fashion, can you?
Actually... yes, you can, by using gravity!
Imagine again that you have placed a relatively slow-moving spacecraft somewhere in front of the orbital path of Venus. But this time instead of aiming it towards the front of Venus, where any real spacecraft would just burn up, you aim it a bit to the side so that it will pass just behind Venus.
If you aim it close enough and at just right  angle, the gravity of Venus will snatch the spacecraft around into a U-shaped path. Venus won't capture it completely, but it can change its direction of motion by some large angle that can approach 180 degrees.
Now think about that. The spacecraft first moves towards the fast-approaching planet, interacts powerfully with it via gravity, and ends up moving in the opposite direction. If you look only at the start and end of the event, it looks just as if the spacecraft has bounced off of the planet!
And energetically speaking, that is exactly what happens in such events. Instead of storing the kinetic energy of the incoming spacecraft in crudely compressed matter (the rubber ball analogy), the gravity of Venus does all the needed conversions between kinetic and potential energy for you. As an added huge benefit, the gravitational version of a rebound works in a smooth, gentle fashion that permits even delicate spacecraft to survive the process.
Incidentally, it's worth noticing that the phrase "gravity assisted" is really referring only to the elastic bounce part of a larger, more interesting collision event.
The real game that is afoot is planetary pool, with the planets acting as hugely powerful cue balls that if used rightly can impart huge increases in speed to spacecraft passing near them. It is a tricky game that requires patience and phenomenal precision, but it is one that space agencies around the world have by now learned to use very well indeed.
A: Energy is in fact conserved, even in gravitational slingshots.
After the slingshot, the velocity of the spacecraft may indeed change, which means its kinetic energy will also change. If this happens, the energy increase (or decrease) will be made up by a commensurate decrease (or increase) in the kinetic energy of the planet. In plain English: The planet will slow down in proportion to how much the probe sped up (or slowed down) and the respective masses of the planet and probe.
The probe essentially "steals" energy from the planet - but because the amount of speed afforded to you by a given amount of energy is weighted by mass, stealing a tiny bit of velocity from a very massive planet can provide an enormous velocity for a very light probe.
Here's an example, fairly simple slingshot from the Wikipedia article which is linked to by the question:

If the probe was coming at $v$ and left with $v+2U$, while the planet was coming with $U$:


*

*Probe's energy has gone from $\frac{1}{2}mv^2$ to $\frac{1}{2}m(v+2U)^2 = \frac{1}{2}mv^2 + 2mU(v+U)$. So it has increased by $2mU(v+U)$.

*Planet's energy was $\frac{1}{2}MU^2$.

*Energy is conserved, therefore planet must have lost $2mU(v+U)$ of energy.

*New energy of planet is $E = \frac{1}{2}MU^2 - 2mU(v+U)$. New speed of the planet can be calculated by taking $\sqrt{\frac{2E}{m}}$ but the equation looks ugly, so I won't do it.


Two intuitions may help:


*

*Kinetic energy is a function of velocity, which is relative. Therefore, kinetic energy is also relative. If you were standing on the surface of the planet during a slingshot, the velocity and kinetic energy of the planet would look 0 to you before and after the slingshot - accordingly, you would observe the probe first coming towards your planet, bounding around, and departing with the same speed but perhaps different direction. Likewise if you were onboard the probe - in these two frames of reference, energy is concerned; therefore it must be conserved in all other inertial frames.

*If you zoom out very far, the slingshot looks like a collision. First two objects are moving towards each other, then they come very close briefly (because you are zoomed out, you can't really tell if they actually come into contact or just do a very tight orbit), and the small object "bounces off" as if it collided. All the velocities and so on seem to work out in a way consistent with collisions. Imagine you are standing by a railroad with a titanium ball. Just as a locomotive approaches you at 150 mph, you throw the ball gently at the locomotive (while being protected by adequate safety equipment!). Will the ball touch the locomotive coming at it at 150 mph, and then gently bounce back at you? No, the locomotive would kick it forward and turn it into a dangerous projectile going very fast. Where did the energy come from? Obviously the train slowed down by an imperceptible amount (if you rig up a machine to throw thousands of such balls at the train, it will eventually stop). The slingshot is just like a very big, heavy ball and a very small ball colliding with each other (without losing energy to friction or heat) - how energy is conserved in this collision is not mysterious.
A: Let's look at what happens if we put numbers into your equations to see if there actually is a violation of the conservation of energy.
Using numbers for Earth from wikipedia we have a velocity of $29.78*10^3\frac{m}{s}$ for orbital velocity and a mass of $5.972*10^{24}kg$. For say the Voyager 2 we have mass of about 730 kg and a speed of $80*10^3\frac{m}{s}$. The difference in KE before and after the fly by is:
$\frac{1}{2}*(730kg)*(80*10^3\frac{m}{s} + 2*29.78*10^3\frac{m}{s})^2-\frac{1}{2}*(730kg)*(80*10^3\frac{m}{s})^2 = 2.062*10^{12} J$
This is quite a bit of energy. But for a planet the size of earth this amount of energy has the following speed:
$2.062*10^{12} J=\frac{1}{2}*(5.972*10^{24}kg)*v^2$, $v=0.8$MICROMETERS/second
This is a back of the envelope type calculation but it does show that very small differences in velocity of a planet result in large amounts of energy. Due to these differences the equations reduce to the velocity of the planet remaining the same while gains in kinetic energy for the satellite result in a large gains in velocity. The system does in fact conserve energy but some differences are so small you do not need to consider them in a calculation.
A: Gravity assists don't change speed in the two body problem. An object approaching a lone gravitating body will enter and leave the vicinity of that body with exactly the same speed. All that a lone gravitating body can do is change the direction in which the object is heading.
The body that provides the assist needs to be moving with respect to the target system to realize a change in speed as well as direction. For example, an orbiting planet is moving with respect to the Sun. This means planets are perfect for affecting gravity assists in our solar system.
Finally, gravity assists occur fairly quickly. There is very little change in potential energy during a gravity assist. What changes, at least at first, is momentum. In a typical gravity assist where the vehicle's speed increases, the planet's momentum decreases a tiny bit. The vehicle steals a tiny, tiny portion of the planet's momentum. What constitutes a tiny, tiny portion of the planet's momentum can represent a huge change in momentum to the vehicle.
