<<MB/MB.m

(*   The integrand of the MB integral for the one-loop massless box diagram with  p1^2=p2^2=p3^2=p4^2=0                   *)

Box1[a1_,a2_,a3_,a4_] :=
((S^(2-a1-a2-a3-a4-ep-z)) (T^z) Gamma[a1+a2+a3+a4-2+ep+z]Gamma[a2+z] Gamma[a4+z] Gamma[2-a1-a2-a4-ep-z] Gamma[2-a2-a3-a4-ep-z] Gamma[-z] )/(Gamma[a1] Gamma[a2] Gamma[a3] Gamma[a4] Gamma[4-a1-a2-a3-a4-2 ep]);

(*  Notation: 
s=(p1+p2)^2=-S, t=(p1+p2)^2=-T;
I Pi^(d/2) is pulled out, as always  *)

(*   The box with the powers of the propagators equal to one *)

Box1[1,1,1,1]

B1=% /. {S->1,T->x}

B1Rules=MBoptimizedRules[B1,ep->0,{},{ep}]

B1cont=MBcontinue[B1,ep->0,B1Rules]

B1select=MBpreselect[B1cont,{ep,0,0}]

B1select=MBpreselect[B1cont,{ep,0,1}]

B1exp=MBexpand[B1select,E^(EulerGamma ep),{ep,0,1}]

res1=B1exp[[1]][[1]]

B1exp[[2]]

int1=B1exp[[2]][[1]]

Simplify[% //. { Gamma[-1-z]-> Gamma[-z] /(-1-z),Gamma[2+z] -> Gamma[1+z] (1+z) }]

%/. {((Gamma[-z])^3) ((Gamma[1+z])^3)-> -(π^3) ((Csc[π z])^3)}

(*  Now we take residues at z=0,1,2,.,..   *)

% /. z-> z+n

% /.{Csc[π (n+z)]->(-1)^n Csc[π z] }

% /. { (((-1))^(3 n)) ->(((-1))^n)}

-Residue[%,{z,0}]

Apart[%/. n->n-1,n]

res2=Sum[%,{n,1,Infinity}]

(*  Numerical check    *)

%/ep/. {x->0.76,ep-> 0.3}

NIntegrate[int1/ep/.{x->0.76,ep-> 0.3,z->-0.5+I*y1},{y1,-Infinity,Infinity}]/2/Pi

res1+res2

(*  This is our result (up to I Pi^(d/2) ) *)

(%/.x->T/S ) (S^(-2-ep))