rect[x_] := If[Abs[x] < 1, 1, If[Abs[x] == 1, 0.5, 0]] Assuming[{n, m} \[Element] Integers, Limit[\!\( \*SubsuperscriptBox[\(\[Integral]\), \(-a\), \(a\)]rect[ \*FractionBox[\(\[Omega]\ T\), \(\[Pi]\)]] Exp[\(-\[ImaginaryI]\)\ \[Omega]\ \[Pi] \((n - m)\)] \[DifferentialD]\[Omega]\), a -> \[Infinity]]]