let A=arctan(1/2) --> tan A = 1/2
B=arctan(1/5) --> tan B = 1/5
C=arctan(1/8) --> tan C = 1/8
arctan(1/2) + arctan(1/5) + arctan(1/8) = D
=> A + B + C = D
=> A + (B + C) = D
=> tan( A + (B + C) ) = tan D
=> [tan A + tan (B+C)]/[1 - (tan A)(tan (B+C)] = tan D
=> [ 1/2 + E ]/[ 1 - (1/2)*E ] = tan D {let E = tan (B+C)}
===> E = tan (B+C)
= [tan B + tan C]/[1 - (tan B(tan C)]
= [1/5 + 1/8] / [1 - (1/5)(1/8)]
= [13/40] / [39/40]
= 1/3
=> [ 1/2 + 1/3 ]/[ 1 - (1/2)*(1/3) ] = tan D
=> [ 5/6 ] / [ 1 - (1/6) ] = tan D
=> 1 = tan D
=> D = arctan(1)
=> D = (pi/4)