How to evaluate a sum which contains limit variables? 
How to evaluate a sum which contains limit variables?

For example: $$\lim_{n\to\infty}\sum_{i=1}^n\frac{n-1}n\frac{1+i(n-1)}n $$
And would the result necessarily be rational, because each term appears to be the multiplication of two rational fractions? 
 A: Notice that in the sum, each piece has a common factor of $\frac{n-1}{n^2}$ which can be pulled out of the sum as per the distributive property since it does not depend on the index, $i$.
$$\lim\limits_{n\to\infty}\sum\limits_{i=1}^n \frac{n-1}{n}\frac{1+i(n-1)}{n} = \lim\limits_{n\to\infty}\left(\frac{n-1}{n^2}\left(\sum\limits_{i=1}^n 1+i(n-1)\right)\right)$$
Now, what is remains in the sum can be split into two seperate sums with the one on the right again having a common factor of $(n-1)$ present which can be brought outside.
$$=\lim\limits_{n\to\infty}\left(\frac{n-1}{n^2}\left(\sum\limits_{i=1}^n 1\right)+\frac{(n-1)^2}{n^2}\left(\sum\limits_{i=1}^ni\right)\right)$$
The left sum is equal to $n$ since there are $n$ occurences of adding $1$ together, and the right sum is the $n$th triangle number, given by $\frac{n(n+1)}{2}$
$$=\lim\limits_{n\to\infty}\left(\frac{n-1}{n^2}(n)+\frac{(n-1)^2}{n^2}\left(\frac{n(n+1)}{2}\right)\right)$$
Hopefully you can take it from here.
A: \begin{align}
S_n &= \frac{n-1}{n}\left(\frac{1}{n} n + \frac{n-1}{n} \frac{n(n+1)}{2}\right)\\
&= \frac{n-1}{n}\left( 1 + \frac{n^2-1}{2}\right)
\end{align}
This seems to go towards $\infty$.
A: The general approach to evaluating such limits of sums is as follows. Say we are considering
$$
\lim_{n\to\infty}\sum_{i=1}^{f(n)}g(n)\approx \lim_{n\to\infty}\int_0^{f(n)}g(x)\ dx.
$$
For any reasonable functions $f$ and $g$, you can make the $\approx$ rigorous by using Riemann sums for the integral. Then we use something called the characteristic function:
$$
\lim_{n\to\infty}\int_0^{f(n)}g(x)\ dx=\lim_{n\to\infty}\int_0^{\infty}\chi_{[0,f(n)]}g(x)\ dx.
$$
Say that $\lim_{n\to\infty}f(n)=L$. Then we can pass the limit inside the integral to obtain
$$
\lim_{n\to\infty}\sum_{i=1}^{f(n)}g(n)\approx \int_0^{\infty}\chi_{[0,L]}g(x)\ dx.
$$
Note that there are some more hypotheses on $g$ necessary in order to pass the limit inside. The resulting integral can be computed using integration by parts if necessary (for instance, if there isn't a closed form antiderivative for $g(x)$).
If you have other specific examples, I could provide a more concrete answer.
