Use Abel-Plana formula to calculate an integral $\int_0^\infty \frac{\arctan(t)}{e^{2\pi t}-1} dt $ I have asked a related problem here:
$$I=\int_0^\infty \frac{\arctan(t)}{e^{2\pi t}-1} dt $$
But I want to use the Abel-Plana formula to calculate above integral. The Abel-Plana formula says:
$$\sum_{n=0}^\infty f(n)=\int_0^\infty f(x)dx+\frac{1}{2}f(0)+i\int_0^\infty \frac{f(it)-f(-it)}{e^{2\pi t}-1}dt$$
This formula requires:
$$|f(z)|\le \frac{C}{|z|^{1+\epsilon}}$$
to guarantee both $\sum_{n=0}^\infty f(n)$ and $\int_0^\infty f(x)dx$ converge.
Can I use it if $\sum_{n=0}^\infty f(n)$ and $\int_0^\infty f(x)dx$ diverge, but $\lim_{N\rightarrow \infty} \left( \sum_{n=0}^N f(n) -\int_0^N f(x)dx\right) $ exists?
Here is my attempt:
$$I=\int_0^\infty \frac{\arctan(t)}{e^{2\pi t}-1} dt ~~~~~~\text{let}~~~f(z)=\frac{\ln(1+z)}{2}$$
$$f(it)-f(-it)=\frac{\ln(1+it)}{2}-\frac{\ln(1-it)}{2}=\mathrm{artanh}(it)=i\cdot \arctan(t)$$
plug into the Abel-Plana formula:
$$\sum_{n=0}^\infty \frac{\ln(1+n)}{2}=\int_0^\infty \frac{\ln(1+x)}{2}dx+0-\int_0^\infty \frac{\arctan(t)}{e^{2\pi t}-1}dt$$
$$I=\int_0^\infty \frac{\arctan(t)}{e^{2\pi t}-1}dt=\lim_{N\rightarrow \infty} \left( \int_0^N \frac{\ln(1+x)}{2}dx-\sum_{n=0}^N \frac{\ln(1+n)}{2}  \right) $$
$$I=\frac{1}{2}\lim_{N\rightarrow \infty} \left( ~~(N+1)\ln(N+1)-N- \ln[(N+1)!] ~~\right) $$
let $n=N+1$ and apply Stirling's formula:
$$I=\frac{1}{2}\lim_{n\rightarrow \infty} \left( ~~n\ln(n)-n+1- \ln\left[\sqrt{2\pi n} \left(\frac{n}{e}\right)^n \right] ~~\right) $$
expand and cancel the terms:
$$I=\frac{1}{2}\lim_{n\rightarrow \infty} \left( 1-\frac{1}{2}\ln(2\pi)-\frac{1}{2}\ln(n)\right)$$
Surely this limit diverges. The correct result is without the last term $-\frac{1}{2}\ln(n)$
Update: I put the solution in the answer box below.
 A: Thank you to @Gary for mentioning this term I missed. And here is the full solution.
Use Euler-Maclaurin formula (The last two terms in the second line of $~\text{Eq}.(2.10.2)$ vanish for $f(z)=\frac{1}{2}\ln(1+z),~$when $N\rightarrow\infty$) :
$$\sum_{n=a}^N f(n)=\int_a^N f(x)dx+\frac{1}{2}f(a)+\frac{1}{2}f(N)+i\int_0^\infty \frac{f(it)-f(-it)}{e^{2\pi t}-1}dt$$
Take $~a=0$,
$$I=\int_0^\infty \frac{\arctan(t)}{e^{2\pi t}-1} dt ~~~~~~~~~~~~~~~~\text{let}~~~f(z)=\frac{\ln(1+z)}{2}$$
$$f(it)-f(-it)=\frac{\ln(1+it)}{2}-\frac{\ln(1-it)}{2}=\mathrm{artanh}(it)=i\cdot \arctan(t)$$
Plug into the formula:
$$\sum_{n=0}^N \frac{\ln(1+n)}{2}=\int_0^N \frac{\ln(1+x)}{2}dx+0+\frac{1}{2}\cdot\frac{\ln(1+N)}{2}-\int_0^\infty \frac{\arctan(t)}{e^{2\pi t}-1}dt$$
$$I=\int_0^\infty \frac{\arctan(t)}{e^{2\pi t}-1}dt=\lim_{N\rightarrow \infty} \left( \int_0^N \frac{\ln(1+x)}{2}dx+\frac{\ln(1+N)}{4}-\sum_{n=0}^N \frac{\ln(1+n)}{2}  \right) $$
$$I=\frac{1}{2}\lim_{N\rightarrow \infty} \left( ~(N+1)\ln(N+1)-N+\frac{1}{2}\cdot\ln(1+N)- \ln[(N+1)!] ~\right) $$
let $n=N+1$ and apply Stirling's formula:
$$I=\frac{1}{2}\lim_{n\rightarrow \infty} \left( ~n\ln(n)-n+1+\frac{1}{2}\cdot\ln(n)- \ln\left[\sqrt{2\pi n} \left(\frac{n}{e}\right)^n \right] ~\right) $$
Expand and cancel terms:
$$I=\frac{1}{2}\lim_{n\rightarrow \infty} \left( 1-\frac{1}{2}\cdot\ln(2\pi)\right)$$
So we get the result:
$$\int_0^\infty \frac{\arctan(t)}{e^{2\pi t}-1} dt =\frac{1}{2}-\frac{1}{4}\cdot\ln(2\pi)$$
