Explicitly finding the sum of $\arctan(1/(n^2+n+1))$

Solution 1:

This telescopes, using the fact that $\text{arctan}(u)-\text{arctan}(v) = \text{arctan}(\frac{u-v}{1+uv})$

Specifically take $u=n+1$ and $v=n$. Then $$\text{arctan}\left(\frac1{n^2+n+1}\right) = \text{arctan}(n+1)-\text{arctan}(n)$$

This gives $$\sum_{n=1}^{m}\arctan\left({\frac{1}{{n^2+n+1}}}\right) = \text{arctan}(m+1) - \pi/4$$

Solution 2:

By observation, $\tan^{-1}\frac{1}{n^2+n+1}=\cot^{-1}(n^2+n+1)=\cot^{-1}\frac{n(n+1)+1}{n+1-n}$ $=\cot^{-1}(n)-\cot^{-1}(n+1)$

$\sum_{n=1}^{m}\tan^{-1}\left({\frac{1}{{n^2+n+1}}}\right)$ $=\frac{\pi}{4}-\cot^{-1}(m+1)$ using this.