spacecraft were an amazing feat of engineering, science and management;
they sent back more information about the solar system than
any mission before or since.
This graph shows the boosts received in the slingshots
of Voyager2 (from JPL's Basics of Space Flight).
Voyager 2 leaves Earth at about 36 km/s relative to the sun. Climbing
out, it loses much of the initial velocity the launch
vehicle provided. Nearing Jupiter, its speed is
increased by the planet's gravity, and the spacecraft's
velocity exceeds solar system escape velocity. Voyager
departs Jupiter with more sun-relative velocity than it
had on arrival. The same is seen at Saturn and
Uranus. The Neptune flyby design put Voyager close by
Neptune's moon Triton rather than attain more speed.
(From JPL's Basics of Space Flight).