Assuming[Element[n, Integer], Integrate[(2/T) A Cos[2 Pi n x/T], {x, -W/2, W/2}]]