Inequality and integral I am working on a problem and I feel like I may not completely understand that concept which I think is real important that I do. 
The question is in regard to showing the validity of the following inequality
         $\int_0^{n}x^{q}dx$ $\le 1+2^{q}+..+n^{q} \le \int_0^{n+1}x^{q}dx$ for any positive integer n and any real q $\ge 0 $
One answer, similar to one suggested by the user Tryss on this site is as follows,
$$\int_0^n x^q dx = \sum_{k=1}^{n} \int_{k-1}^k x^q dx \leq \sum_{k=1}^{n} \int_{k-1}^k k^q dx  $$
Then
$$\int_0^n x^q dx \leq \sum_{k=1}^{n} k^q  = 1+ 2^q + \cdots n^q $$
And we have,
$$\int_0^{n+1} x^q dx = \sum_{k=0}^{n} \int_{k}^{k+1} x^q dx \geq \sum_{k=0}^{n} \int_{k}^{k+1} k^q dx  $$
i,e then,
$$\int_0^{n+1} x^q dx \geq \sum_{k=0}^{n} k^q  = 1+ 2^q + \cdots n^q $$
The next part of the question that I am mostly stumped on is to find $\lim_{n\to \infty}a_n$ where $a_n= 1/{n^{q+1}}+2^{q}/n^{q+1}+…+n^{q}/n^{q+1}$. I'm sure I need to use the result of the first part of the problem but I am not sure where to begin.
Here is where I am looking for help as well; I am feeling confused about the proposed solution above. I think my background is a little lacking on remembering the relation between the summation symbols and the integral symbol in general. I see clearly that we are increasing, but why choose the interval $[k,k-1]$ for example? is it just an arbitrary interval for which we can use the fact that we have an increasing so we can write $x^{q} \le k^{q}$
Then I am confused overall, about the geometric meaning and such. for example how is it true and what is the meaning of writing  $$\int_0^n x^q dx = \sum_{k=1}^{n} \int_{k-1}^k x^q dx \leq \sum_{k=1}^{n} \int_{k-1}^k k^q dx  $$ . How can I know/see/understand what this is saying is true? and vice versa for the other inequality.
So overall I am looking for any help on that, and with the limit. All is very greatly appreciated and I am trying to understand! Thanks a lot in advance to anyone who is willing to help.
 A: What you have in the first part of your problem is actually two inequalities.
The first one looks like a case of the more general
$$\int_0^n f(x)\, dx \leq f(1) + f(2) + \cdots f(n)$$
for an integer $n$ and a function $f$ that is increasing on the interval $[0,n]$.
The right-hand side of this inequality is a right-handed Riemann sum of the 
function $f$ over that interval.
The other inequality is a case of
$$ f(0) + f(1) + \cdots f(n+1) \leq \int_0^{n+1} f(x)\, dx$$
for an integer $n+1$ and a function $f$ that is increasing on the interval $[0,n+1]$.The left -hand side of this inequality is a left-handed Riemann sum of the 
function $f$ over that interval.
As a reminder, the left-handed and right-handed Riemann sums of an increasing function
look something like this:

I did not draw $f(x) = x^q$ here because I wanted the first rectangle in the sum to
be visible in both cases. But if you make that substitution, then $f(0) = 0$,
$f(1) = 1$, and in general $f(k) = k^q$.
Now consider this fact:
$$\int_0^n x^q\, dx = \sum_{k=1}^{n} \int_{k-1}^k x^q\, dx.$$
This is simply a consequence of the fact that you can compute an integral in two pieces:
$$\int_a^b f(x)\, dx = \int_a^c f(x)\, dx + \int_c^b f(x)\, dx.$$
Repeat this step $n-1$ times, using a different integer as the new bound of integration
each time, and you have a sum of $n$ integrals equal to the original.
The fact
$$\sum_{k=1}^{n} \int_{k-1}^k x^q\, dx \leq \sum_{k=1}^{n} \int_{k-1}^k k^q\, dx$$
for an increasing function $f$ is a consequence of the more general fact that
if $f(x) \leq g(x)$ when $a \leq x \leq b$, then 
$$\int_a^b f(x)\, dx \leq \int_a^b g(x)\, dx.$$
In this case you take $f(x) = x^q$ and $g(x) = k^q$.
Visually, you can look at the rectangles in the right-hand Riemann sum to see 
how this works in this particular case:
the area of the rectangle between $x = k-1$ and $x=k$ is $f(k)$, and it is
greater than the area under the curve $y=f(x)$ in that same interval.
For the second part of the question, notice that
$$a_n= \frac{1 + 2^q + \cdots + n^q}{n^{q+1}}.$$
The numerator indeed looks a lot like the middle part of the inequalities
from the first part of the problem. In fact you can use those inequalities to write
$$\frac{1}{n^{q+1}} \int_0^n x^q\, dx \leq \frac{1 + 2^q + \cdots + n^q}{n^{q+1}}
 \leq \frac{1}{n^{q+1}} \int_0^{n+1}x^{q}dx.$$
You can use the usual formula for $\int x^q\, dx$ to evaluate the definite 
integrals on both sides.
Does it look like the squeeze theorem applies to this problem then?
