  We present an analytical calculation of the two-loop QCD corrections to the
electromagnetic form factor of heavy quarks. The two-loop contributions to the
form factor are reduced to linear combinations of master integrals, which are
computed through higher orders in the parameter of dimensional regularization
epsilon=(4-D)/2. Our result includes all terms of order epsilon at two loops
and extends the previous literature. We apply the exponentiation of the
heavy-quark form factor to derive new improved three-loop expansions in the
high-energy limit. We also discuss the implications for predictions of massive
n-parton amplitudes based on massless results in the limit, where the quark
mass is small compared to all kinematical invariants.
