I've been trying to compute the following integral related to a different problem here and give it a more pliable form. I converged after some complex analysis related computation to the following form
$$C_n=\int_{-\beta}^{\beta}dx\cot(\frac{x}{2})\sin(\frac{\pi nx}{\beta})=2\beta ((-1)^n+\frac{2n}{\pi\lambda^2}\phi_n)$$
where $\lambda=\frac{\beta}{\pi}$ and $|\beta|<\pi$ and $$\phi_n=\sum_{m=1}^{\infty}\frac{\sin(\lambda\pi m)}{m(m+\frac{n}{\lambda})}$$
which I know can be written in terms of the Lerch transcedent. The complex analysis calculation was done strictly speaking under the assumption that $n>0$, but it is obvious that $C_n=-C_{-n}$ and I thought that the expression for the coefficient should satisfy this constraint but $\phi_n$ does not seem to obey the correct constraint.
Question:
1) Is the above formula correct?
a) If yes, what gives in the naive contradiction above?
b) If no, what is the correct form for this integral and a way to find it?
I have worked on this for a bit and I don't seem to figure out what's amiss.
I do not know how much this could help you.
Start with $x=iy$ and $\frac{\pi n} \beta=k $ $$\int\cot \left(\frac{x}{2}\right) \sin (k x)\,dx=i \int\coth \left(\frac{y}{2}\right) \sinh (k y)\,dy$$ $$2\int\coth \left(\frac{y}{2}\right) \sinh (k y)\,dy=B_{e^y}(1-k,0)+B_{e^y}(-k,0)-B_{e^y}(k,0)-B_{e^y}(k+1,0)$$ which makes the definite integral $$2\int_{-a}^a\coth \left(\frac{y}{2}\right) \sin (k y)\,dy$$ to be $$\Big[B_{e^{-a}}(k,0)+B_{e^{-a}}(k+1,0)+B_{e^a}(1-k,0)+B_{e^a}(-k,0)\Big]-$$ $$\Big[B_{e^a}(k,0)+B_{e^a}(k+1,0)+B_{e^{-a}}(1-k,0)+B_{e^{-a}}(-k,0)\Big]$$