<s>[INST] Using right-hand Riemann sum to evaluate the limit of $ \frac{n}{n^2+1}+ \cdots+\frac{n}{n^2+n^2}$ I'm asked to prove that $$\lim_{n \to \infty}\left(\frac{n}{n^2+1}+\frac{n}{n^2+4}+\frac{n}{n^2+9}+\cdots+\frac{n}{n^2+n^2}\right)=\frac{\pi}{4}$$ This looks like it can be solved with Riemann sums, so I proceed:
\begin{align*}
\lim_{n \to \infty}\left(\frac{n}{n^2+1}+\frac{n}{n^2+4}+\frac{n}{n^2+9}+\cdots+\frac{n}{n^2+n^2}\right)&=\lim_{n \to \infty} \sum_{k=1}^{n}\frac{n}{n^2+k^2}\\
&=\lim_{n \to \infty} \sum_{k=1}^{n}(\frac{1}{n})(\frac{n^2}{n^2+k^2})\\
&=\lim_{n \to \infty} \sum_{k=1}^{n}(\frac{1}{n})(\frac{1}{1+(k/n)^2})\\
&=\lim_{n \to \infty} \sum_{k=1}^{n}f(\frac{k}{n})(\frac{k-(k-1)}{n})\\
&=\int_{0}^{1}\frac{1}{1+x^2}dx=\frac{\pi}{4}
\end{align*}
where $f(x)=\frac{1}{1+x^2}$. Is this correct, are there any steps where I am not clear? 
 [/INST] 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.
</s>