  We calculate the two-loop corrections to heavy-quark pair production in the
gluon fusion channel which arise from diagrams involving a closed light-quark
loop. The calculation is carried out by keeping the exact dependence on the
heavy-quark mass. The analytic results are written in terms of logarithms,
classical polylogarithms Li_n (n=2,3,4), and genuine multiple polylogarithms
Li_{2,2}. The functional arguments are rational expressions of two independent
external invariants and they are chosen in such a way that the functions are
real in all the physical phase-space points. Through systematic changes in the
functional basis, we obtain expansions of the results in both the production
threshold and small mass limits.
