problem in the above asked equation of S.Ramanujan !
Hello everyone,this is a result of an entry described by ramanujan,i first request you to see the photo i have attached.

MY ATTEMPTION
From LHS in entry 3 in photo i shift $\frac{\pi}{4}$ to right,and for the another term i have done the following simple step
$$\sum_{k=1}^{2n+1} \arctan(\frac{1}{n+k}) =\sum_{k=n+1}^{3n+1} \arctan(\frac{1}{k}) $$
MY PROBLEM
How the RHS of the above EQn is converted in the picture using taylor's theorem ?
HOW ? $$\sum_{k=n+1}^{3n+1} \arctan(\frac{1}{k})= \sum_{k=n+1}^{3n+1} [\frac{1}{k}+O(\frac{1}{k^3})]$$
AND in the next step RHS just converted i.e. $$\sum_{k=n+1}^{3n+1} \frac{1}{k} + O(\frac{1}{n^2})$$
please help me, i dont know what is this O(x) and how it is generated from taylor's theorem ? after that step i know how it is converted into riemann sum when limit tends to infinity i.e.
$$\sum_{k=n+1}^{3n+1} \frac{1}{k} =\sum_{k=1}^{2n+1} \frac{1}{n+k} = \sum_{k=1}^{2n} \frac{1}{n+k}+\frac{1}{3n}$$
now for limit tends to infinity $$\lim_{n\to\infty} \sum_{k=1}^{2n} \frac{1}{n+k} + \lim_{n\to\infty}\frac{1}{3n}= \lim_{n\to \infty} \frac{1}{n} \sum_{k=1}^{2n} \frac{1}{1+\frac{k}{n}}=\int_{0}^{2} \frac{dx}{x+1} = \log{3}$$
SORRY for mistakes, this is my first question.
We may consider that $\arctan z = \text{Im}\,\log(1+iz)$ and $$\arctan\left(\frac{10k}{(3k^2+2)(9k^2-1)}\right)= \text{Arg}\left[\left(1-\frac{i}{k}\right)\left(1+\frac{i}{3k}\right)\left(1-\frac{1-i}{3k}\right)\left(1+\frac{1+i}{3k}\right)\right]$$ where $-\frac{i}{k}+\frac{i}{3k}-\frac{1-i}{3k}+\frac{1+i}{3k}=0$ and by the Weierstrass product for the $\Gamma$ function $$ \prod_{k\geq 1}\left(1+\frac{z}{k}\right)e^{-z/k}=\frac{1}{\Gamma(z+1)e^{\gamma z}}, $$ such that $$ \sum_{k\geq 1}\arctan\left(\frac{10k}{(3k^2+2)(9k^2-1)}\right)=\text{Arg}\left[\frac{1}{\Gamma(1-i)\Gamma\left(1+i/3\right)\Gamma(1+(1+i)/3)\Gamma(1-(1-i)/3)}\right] $$ and by invoking the reflection and triplication formulas for the $\Gamma$ function this equals $$ \text{Arg}\left[\frac{\sinh\pi}{(2\pi) 3^{1/2-i}\frac{\pi}{3}\cdot\frac{1+i}{3} }\right]=\text{Arg}\left[e^{i\log 3} (1-i)\right]=\log 3-\frac{\pi}{4}$$ QED.