Solution (source code)

= Solution

Take Jupiter's heliocentric <velocity> as $\mathbf V_J=13\hat{\mathbf x}\,\mathrm{km\,s^{-1}}$. <Conservation of energy> in the Jupiter frame makes the incoming and outgoing asymptotic <speeds> both $10\,\mathrm{km\,s^{-1}}$. For the $90^\circ$ encounter, an outgoing <velocity> in Jupiter's direction requires the incoming Jupiter-frame <velocity> to be perpendicular to it:
$$
\mathbf u_{\rm in}=\pm10\hat{\mathbf y}\,\mathrm{km\,s^{-1}},\qquad
\mathbf u_{\rm out}=10\hat{\mathbf x}\,\mathrm{km\,s^{-1}}.
$$
Use a <Galilean transformation> back to the Sun frame:
$$
\boxed{\mathbf v_{\rm in}=13\hat{\mathbf x}\pm10\hat{\mathbf y}\,\mathrm{km\,s^{-1}},\qquad
\mathbf v_{\rm out}=23\hat{\mathbf x}\,\mathrm{km\,s^{-1}}.}
$$
The heliocentric <speeds> are therefore
$$
\boxed{v_{\rm in}=\sqrt{13^2+10^2}\simeq16.4\,\mathrm{km\,s^{-1}},\qquad
v_{\rm out}=23.0\,\mathrm{km\,s^{-1}}.}
$$
The incoming direction makes an angle $\arctan(10/13)\simeq37.6^\circ$ with Jupiter's motion; its two signs describe mirror-image encounter planes. The <gravitational assist> transfers orbital <energy> from Jupiter to the spacecraft: the spacecraft's specific <kinetic energy> increases by $\tfrac12(23^2-16.4^2)\,\mathrm{km^2\,s^{-2}}$, or, using the unrounded squared incoming <speed>, exactly $130\,\mathrm{km^2\,s^{-2}}=1.30\times10^8\,\mathrm{J\,kg^{-1}}$. There is no gain in asymptotic <speed> in the Jupiter frame; the gain is a consequence of changing frames while the planet is moving.