Upper bound of the sum $\sum_{n=1}^\infty \tan^{-1}\left(\frac{x}{1-(x-n)^2}\right)$ as $x\to \infty$ I am stuck at finding a Big-O upper bound of the following sum as $x\to \infty$ $$\sum_{n=1}^\infty \tan^{-1}\left(\frac{x}{1-(x-n)^2}\right)$$
I tried: Since $$ \sum_{n=1}^\infty\tan^{-1}\left(\frac{x}{1-(x-n)^2}\right)=\sum_{n=1}^\infty O\left(\frac{x}{n^2}\right) $$
Now we have for $x_0>0$ and $M>0$ $$ \sum_{n=1}^\infty\tan^{-1}\left(\frac{x}{1-(x-n)^2}\right)=\left(M \sum_{n=1}^\infty \frac{1}{n^2}\right)x $$
Now since $\sum_{n=1}^\infty\frac{1}{n^2}$ converges so can we write the following ? $x\to \infty$ $$ \sum_{n=1}^\infty\tan^{-1}\left(\frac{x}{1-(x-n)^2}\right)=O(x) $$
Thnak you for your valuable time and comments.
 A: To get the leading asymptotics term, we can switch from summation to integration. As @Jack D'Aurizio mentioned, we are getting $O(1)$ term while evaluating  $S_2$, therefore we can only try to catch the leading term. As was shown above, the leading term is $O(\sqrt x)$.
Indeed, implementing the program, denoting for a while $x=N\to\infty$ and dropping the lower terms
$$-S(N)=-\sum_{n=1}^\infty \arctan\left(\frac{N}{1-(N-n)^2}\right)\sim-\int_0^\infty\arctan\frac{N}{1-(n-N)^2}dn$$
$$\sim\int_0^\infty\arctan\frac{N}{(n-N)^2}dn$$
We do not care about the accurate evaluation near $n=N$: as was mentioned, it gives only the contribution $\sim O(1)$.
Integrating by part,
$$-S(N)\sim\int_0^\infty\frac{2Nn(n-N)}{N^2+(n-N)^4}dn=2N^2\int_{-N}^\infty\frac{tdt}{N^2+t^4}+2N\int_{-N}^\infty\frac{t^2dt}{N^2+t^4}$$
Making some changes and dropping vanishing at $N\to0$ terms,
$$\sim N^2\int_{N^2}^\infty\frac{dx}{N^2+x^2}+2N\int_{-\infty}^\infty\frac{t^2}{N^2+t^4}dt-2N\int_N^\infty\frac{t^2}{N^2+t^4}dt$$
It is easy to see that only second term is divergent at $N\to\infty$, therefore
$$-S(N)\sim 2N\int_{-\infty}^\infty\frac{t^2}{N^2+t^4}dt=2\sqrt N\int_{-\infty}^\infty\frac{t^2}{1+t^4}dt=\sqrt N\int_0^1(1-t)^{-\frac{1}{4}}t^{-\frac{3}{4}}dt$$
$$\boxed{\,\,-S(x)\sim\sqrt x\, B\Big(\frac{1}{4};\frac{3}{4}\Big)=\sqrt 2\,\pi\,\sqrt x\quad\text{at}\,\,x\to\infty\,\,}$$
We can also check that at
$\displaystyle x=100\quad -S(100)=34.22;\,\,\sqrt 2\pi\,\sqrt {100}=44.43$
$\displaystyle x=300\quad -S(300)=76.07;\,\,\sqrt 2\pi\,\sqrt {300}=76.95$
$\displaystyle x=500\quad -S(500)=98.44;\,\,\sqrt 2\pi\,\sqrt {500}=99.34$
$\displaystyle x=1000\,\, -S(1000)=139.6;\,\,\sqrt 2\pi\,\sqrt {1000}=140.5$, etc.
A: Non-trivial question, since the behaviour of $f_n(x)=\arctan\left(\frac{x}{1-(x-n)^2}\right)$ is fairly complex. For any $n>1$

*

*$f_n(x)$ is negative and decreasing from $0$ to $-\frac{\pi}{2}$ on $(0,n-1)$

*$f_n(x)$ is positive and bounded by $\frac{\pi}{2}$ on $(n-1,n+1)$

*$f_n(x)$ is negative and increasing from $-\frac{\pi}{2}$ to $0$ on $(n+1,+\infty)$
Given some large $x\in\mathbb{R}^+$, let us break the sum $\sum_{n > 1} f_n(x)$ into three components:
$$ S_1=\sum_{n\leq x-1}f_n(x),\quad S_2=\sum_{x-1< n\leq x+1}f_n(x),\quad S_3=\sum_{n>x+1}f_n(x) $$
$S_2$ has at most three terms, each of them bounded by $\frac{\pi}{2}$ in absolute value, so $|S_2|=O(1)$.
About $S_1$: if $x\geq n+1$ we have $|f_n(x)|\leq\frac{\pi}{x-n}$, hence $S_1$ is bounded in absolute value by $\pi\log(x)+O(1)$.
The most critical estimation is the estimation of $S_3$. We may notice that
$$ -f_n(n-1-x)=\arctan\left(\frac{(n-1)-x}{x(x+2)}\right) $$
is bounded (quite crudely) by $\pi\left(1-\frac{x}{n-1}\right)^2$, such that $|f_n(x)|\leq \frac{\pi x^2}{(n-1)^2}$ and
$$ S_1+S_2+S_3 = O(x). $$
Of course an improved bound for $S_3$ would automatically lead to an improved bound for $S_1+S_2+S_3$.
Indeed for any $z\in\mathbb{R}^+$ we have $\arctan(z)\leq\min\left(\frac{\pi}{2},z\right)$, so
$$\begin{eqnarray*}\sum_{n > x+1}\arctan\left(\frac{x}{(x-n)^2-1}\right)&\leq& \sum_{n > x+1}\min\left(\frac{\pi}{2},\frac{x}{(n-x)^2-1}\right)\\&=&O(\sqrt{x})+x\sum_{n\geq x+\sqrt{x}+1}\frac{1}{(n-x)^2-1} \end{eqnarray*}$$
which proves that
$$\boxed{ \sum_{n\geq 1}\arctan\left(\frac{x}{1-(x-n)^2}\right)=O(\sqrt{x})\qquad\text{as }x\to +\infty.} $$
A: Strating from @Svyatoslav's answer, we can compute
$$S(N)\sim\int_0^\infty\arctan\Bigg[\frac{N}{1-(n-N)^2}\Bigg]dn$$ (have a look here for the antiderivative). At the upper bound, the result is $0$. Expanded as a series for large values of $N$, this gives , using $t=\pi  \sqrt{2N}$,
$$S(N)\sim t-1+\frac{\pi ^2}{t}+\frac{\pi ^4}{2 t^3}-\frac{16 \pi ^4}{15 t^4}-\frac{\pi ^6}{2
   t^5}+O\left(\frac{1}{t^6}\right)$$
Comparing for a few values on $N$
$$\left(
\begin{array}{ccc}
N & \text{approximation} & \text{solution} \\
 100 & 43.4288 & 38.2745 \\
 200 & 61.8319 & 61.9841 \\
 300 & 75.9530 & 76.0780 \\
 400 & 87.8577 & 87.9663 \\
 500 & 98.3459 & 98.4454 \\
 600 & 107.828 & 107.915 \\
 700 & 116.548 & 116.643 \\
 800 & 124.664 & 124.728 \\
 900 & 132.286 & 132.504 \\
 1000 & 139.496 & 138.660
\end{array}
\right)$$
