In this article we give the details on the analytic calculation of the master integrals for the planar double box integral relevant to top-pair production with a closed top loop. We show that these integrals can be computed systematically to all order in the dimensional regularisation parameter ε. This is done by transforming the system of differential equations into a form linear in ε, where the ε 0 -part is a strictly lower triangular matrix. Explicit results in terms of iterated integrals are presented for the terms relevant to NNLO calculations. number of block sector master integrals master integrals kinematic propagators basis I basis J dependence 2 1 9 I 1001000 J 1 − 3 2 14 I 0111000 J 2 s 3 28 I 0011100 , I 0021100 J 3 , J 4 s 4 49 I 1000110 J 5 s 5 73 I 1001001 , I 200100123 = 4 G (1, 0, 0, 1; x) + 4 G (0, 1, 0, 1; x) + 4 G (0, 0, 1, 1; x) − 8 G (0, 0, 0, 1; x) +10 G (0, 0, −1, 0; x) − 4 G (0, −1, 0, 0; x) + 4 G (0, −1, 0, 1; x) + 4 G (0, −1, 1, 0; x) −6 G (0, 1, 0, 0; x) − 4 G (0, 0, 1, 0; x) + 4 G (0, 1, 1, 0; x) + 4 G (0, 1, −1, 0; x) +12 G (1, 0, 0, 0; x) − 24 G (1, 0, −1, 0; x) − 4 G (1, 0, 1, 0; x) + 2 ζ 2 G (0, 1; x) −4 ζ 2 G (1, 0; x) + 12 ζ 3 G (0; x) − 24 ζ 3 G (1; x) + 9 ζ 4 , J (0) 32 = 0, J (1) 32 = 0, J (2) 3237 = 0, J (1) 37 = 0, J (2) 37 = 0, J (3) 37 = 0, J (4) 37 = −6 G (0, 0, 0, 0; x) + 6 G (0, 0, 0, 1; x) + 4 G (0, 0, 1, 0; x) + 2 G (0, 1, 0, 0; x) −4 ζ 2 G (0, 0; x) , J (0) 40 = 0, J (1) 40 = 0, J (2) 40 = 0, J (3) 40 = 0, J (4) 40 = −G (0, 0, 0, 0; x) − 8 G (0, 0, −1, 0; x) + 6 G (0, 0, 0, 1; x) + 4 G (0, 1, 0, 0; x) −4 ζ 2 G (0, 0; x) − 2 ζ 3 G (0; x) − 3 ζ 4 . (190) 9.2.2 Integrals, which are expressed in the variable x ′ The integrals J 12 − J 13 are most naturally expressed in terms of harmonic polylogarithms in the variable x ′ . J (0) 12 = 0, J (1) 12 = 0, J (2) 12= G 0, 0; x ′ − 2 G 0, −1; x ′ + ζ 2 ,