Using right-hand Riemann sum to evaluate the limit of $ \frac{n}{n^2+1}+ \cdots+\frac{n}{n^2+n^2}$

Notice, we have $$\lim_{n\to \infty}\left(\frac{n}{n^2+1}+\frac{n}{n^2+4}+\frac{n}{n^2+9}+\dots +\frac{n}{n^2+n^2}\right)=\lim_{n\to \infty}\sum_{r=1}^{n}\frac{n}{n^2+r^2}$$

$$\lim_{n\to \infty}\sum_{r=1}^{n}\frac{n}{n^2+r^2}=\lim_{n\to \infty}\sum_{r=1}^{n}\frac{\frac{1}{n}}{1+\left(\frac{r}{n}\right)^2}$$ Let, $\frac{r}{n}=x\implies \lim_{n\to \infty}\frac{1}{n}=dx\to 0$

$$\text{upper limit of x}=\lim_{n\to \infty }\frac{n}{n}=1$$ $$\text{lower limit of x}=\lim_{n\to \infty }\frac{1}{n}=0$$ Hence, using integration with proper limits, we get

$$\lim_{n\to \infty}\sum_{r=1}^{n}\frac{\frac{1}{n}}{1+\left(\frac{r}{n}\right)^2}= \int_ {0}^{1}\frac{dx}{1+x^2}$$ $$=\left[\tan^{-1}(x)\right]_{0}^{1}$$ $$=\left[\tan^{-1}(1)-\tan^{-1}(0)\right]$$ $$=\left[\frac{\pi}{4}-0\right]=\frac{\pi}{4}$$


Yes, what you've written is correct.

I think your write-up would be cleaner if you explicitly mentioned the antiderivative $$ \int \frac{1}{1 + x^2} dx = \arctan x,$$ which makes it completely clear where $\frac{\pi}{4}$ comes from at the end.