Find the limit of $\lim\limits_{n\to\infty}\frac{1}{n^2}\sum\limits_{k=1}^{n}k\arctan{\big(\frac{pk-p+1}{pn}\big)}$

I am required to find the limits of two "siblings" using the same idea, they are: $$\lim_{n\to\infty}\sin{\left(\frac{1}{pn+r}\right)}\sum_{k=1}^{n}\sin{\left(\frac{2pk-2p+r}{2pn}\right)}$$ with $$0 and $$\lim_{n\to\infty}\frac{1}{n^2}\sum_{k=1}^{n}k \arctan{\left(\frac{pk-p+1}{pn}\right)}$$ where $$p>1$$.

For the first I tried $$\sum_{k=1}^{n}sin(\frac{2pk+r}{2pn}-\frac{1}{n})=cos(\frac{1}{n})\sum_{k=1}^{n}sin(\frac{2pk+r}{2pn})-sin(\frac{1}{n})\sum_{k=1}^{n}cos(\frac{2pk+r}{2pn})$$ but I dont know how to find the limit using the ,,squeeze" theorem. Well, for the second I stumble upon the same problem as to the first: $$\lim\limits_{n\to\infty}\frac{1}{n}\sum\limits_{k=1}^{n}\frac{k}{n}\arctan{\left(\frac{k}{n}+\frac{p-1}{pn}\right)}$$. Is this converging to $$\int_{0}^{1}x\arctan{(x)}dx$$ as $$n\to\infty$$? Is this the key ideea?

• Try to use the same idea given for your previous question math.stackexchange.com/questions/3140464/… – Robert Z Mar 9 at 9:15
• I've tried but in this case I cant use fractions. I obtained an upper bound for the second sum but no lower one. – user651692 Mar 9 at 19:54

Hint. As regards the second sum, note that, $$0\leq \frac{k-1}{n}\leq \frac{pk-p+1}{pn}\leq \frac{k}{n}\leq 1,$$ for $$1\leq k\leq n$$ and $$p>1$$, and it follows that $$\frac{1}{n}\sum_{k=1}^{n}\frac{k}{n}\arctan{\big(\frac{k-1}{n}\big)}\leq \frac{1}{n^2}\sum_{k=1}^{n}k\arctan{\big(\frac{pk-p+1}{pn}\big)}\leq \frac{1}{n}\sum_{k=1}^{n}\frac{k}{n}\arctan{\big(\frac{k}{n}\big)}$$ The left side can be written as $$\frac{1}{n}\cdot\frac{1}{n}\sum_{k=0}^{n-1}\arctan{\big(\frac{k}{n}\big)}+ \frac{1}{n}\sum_{k=0}^{n-1}\frac{k}{n}\arctan{\big(\frac{k}{n}\big)}.$$ Use a similar approach for the first sum. Since $$0, we have that $$0\leq \frac{k-1}{n}\leq \frac{2pk-2p+r}{2pn}\leq \frac{k}{n}\leq 1$$ for $$1\leq k\leq n-1$$. Hence $$\sum_{k=1}^{n}\sin{\left(\frac{k-1}{n}\right)}\leq \sum_{k=1}^{n}\sin{\left(\frac{2pk-2p+r}{2pn}\right)}\leq \sum_{k=1}^{n}\sin{\left(\frac{k}{n}\right)}.$$ Can you take it from here?
• I obtained the result $\int_{0}^{1}xarctgxdx$ for the second sum but for the first this approach does not work. My ideea is to use $sin(x-y)=sinxcosy-sinycosx$. So, $\sum_{k=1}^{n}sin(\frac{2pk+r}{2pn}-\frac{1}{n})=cos(\frac{1}{n})\sum_{k=1}^{n}sin(\frac{2pk+r}{2pn})-sin(\frac{1}{n})\sum_{k=1}^{n}cos(\frac{2pk+r}{2pn})$. How can I continue from here? – user651692 Mar 10 at 6:25
• @JacobDenicula Are you able to find $\lim_{n\to\infty}\frac{1}{n}\sum_{k=1}^{n}\sin{\left(\frac{2pk-2p+r}{2pn}\right)}$? Note that $\sin$ is increasing in $[0,1]$. – Robert Z Mar 10 at 8:45
• I am unsure I can apply Riemann integration because I remain with an $\frac{r}{2pn}$. Does that reduce when $n$ goes to $\infty$? – user651692 Mar 10 at 8:55