Evaluating $\lim_{n\to\infty} \frac{1^{99} + 2^{99} + \cdots + n^{99}}{n^{100}}$ using integral 
Evaluate $\lim\limits_{n\to\infty} \dfrac{1^{99} + 2^{99} + \cdots + n^{99}}{n^{100}}$

This is the question I remembered from my high school textbook (I remembered it while reading about something related). Now I know how to do it using Faulhaber's formula (at least the first coefficient, which is required). But the textbook used this method which I didn't and don't understand. $$\lim\limits_{n\to\infty} \dfrac{1^{99} + 2^{99} + \cdots + n^{99}}{n^{100}} = \lim\limits_{n\to\infty}\dfrac{\large\int\limits_{0}^n x^{99} dx}{n^{100}} = \lim\limits_{n \to \infty}\dfrac{\dfrac{n^{100}}{100}}{n^{100}}= \dfrac{1}{100}$$
What I don't understand how is converting from sum to integral is justified (the textbook didn't justify) and when is it allowed to replace sum by integral?

See Euler-Maclaurin formula. In this case it looks like $$\sum\limits_{k=0}^nk^{99}=\int\limits_0^nx^{99}dx+\sum\limits_{i=1}^{\infty}\frac{B_i99!}{i!(100-i)!}n^{100-i}$$ Second summand is actually a polynomial of degree $99$, so it is $o(n^{100})$ and $$\lim\frac{\sum\limits_{k=0}^nk^{99}}{n^{100}}=\lim\frac{\int\limits_0^nx^{99}dx}{n^{100}}$$
