Integrate[1/Sqrt[R^2 + (x1 - x2)^2], {x2, 0, l}, {x1, 0, l}, Assumptions -> {R > 0, l > 0, x1 >= 0, x2 >= 0}] //
FullSimplify // AbsoluteTiming
(* {45.2976, 2 R - 2 Sqrt[l^2 + R^2] + l Log[R] - l Log[-l + Sqrt[l^2 + R^2]] + 1/2 l Log[1 + (2 l (l + Sqrt[l^2 + R^2]))/R^2]}*)
$$-2 \sqrt{l^2+R^2}-l \log \left(\sqrt{l^2+R^2}-l\right)+\frac{1}{2} l \log \left(\frac{2 l
\left(\sqrt{l^2+R^2}+l\right)}{R^2}+1\right)+l \log (R)+2 R$$
Extended version for solving integral:
sol = Integrate[1/Sqrt[R^2 + (x1 - x2)^2], {x2, 0, l}, Assumptions -> {R > 0, l > 0, x1 > 0}]
(* 1/2 Log[-(((x1 + Sqrt[R^2 + x1^2]) (-l + x1 - Sqrt[
l^2 + R^2 - 2 l x1 + x1^2]))/((-x1 + Sqrt[R^2 + x1^2]) (-l +
x1 + Sqrt[l^2 + R^2 - 2 l x1 + x1^2])))] *)
sol2 = FullSimplify[sol, Assumptions -> {R > 0, l > 0, x1 >= 0}]
(* 1/2 (Log[l + Sqrt[R^2 + (l - x1)^2] - x1] -
Log[(-l + Sqrt[R^2 + (l - x1)^2] + x1) (-x1 + Sqrt[R^2 + x1^2])] +
Log[x1 + Sqrt[R^2 + x1^2]])*)
Integrate[sol2, {x1, 0, l}, Assumptions -> {R > 0, l > 0}]
(* 2 (R - Sqrt[l^2 + R^2] + l ArcTanh[l/Sqrt[l^2 + R^2]])*)
and we have:
Both solutions are correct.
Regards,MI