Yes, everything you've written is correct. (except for that one weird chain of equations $x_{0+k} = f(0+k) = k^2$ which doesn't really make sense)
Although this problem is simple enough that what I suggest below may seems silly, sometimes doing such things help in complex problems.
It may be useful to define variables that more closely relate to the actual objects of the problem. Specifically, rather than picking out the $n+1$ points $x_k = k/n$, you might instead pick out the $n$ intervals
$$ I_k = \left[ \frac{k}{n}, \frac{k+1}{n} \right] $$
for $k = 0, \ldots, n-1$. Having a name for the intervals makes it simpler to reason about them.
Re: your edit: you're mostly okay. You've made one main error: you used the formula for $\sum_{k=0}^n k^2$, but the upper limit on the sum is only $n-1$.
It turns out, however, that error doesn't affect the end result.
The number of steps you need to write between
$$ \lim_{n \to \infty} ((1/n^3) \frac{n*(n+1)*(2n+1)}{6}) $$
(after correcting for your error) and
$$ 1/3 $$
depends on how much you want to show you know the steps between those two. In particular, if you are in a setting where those are "obvious", you can just skip all of the way. But if you are in a class where your professor is assessing your knowledge of that stuff and it can't just be assumed you know, then you need to show more steps!
Of course, if you are unsure of your steps, it's best to write them out. Not only does seeing your own work make it easier to spot errors or help to be confident it's correct, it would let your professor and others see how you do the work and suggest corrections and improvements.
(P.S. use \lim
instead of lim
when you write the math, and you'll get the better typesetting you see in my post)
We consider the function
\begin{align*}
&f:\mathbb{R}\rightarrow\mathbb{R}\\
&f(x)=\lfloor x+1\rfloor
\end{align*}
and the definite integral
\begin{align*}
\int_1^2 f(x) dx=\int_1^2 \lfloor x+1\rfloor dx
\end{align*}
To calculate lower and upper sums we take a partition $\mathcal{P}=\{x_0,x_1,\ldots,x_n\}$ of the interval $[1,2]$ with
$$1=x_0<x_1<\ldots<x_{n-1}<x_n=2$$
The lower sum $L(\mathcal{P})$ and upper sum $U(\mathcal{P})$ of $f$ with respect to the partition $\mathcal{P}$ are given as
\begin{align*}
L(\mathcal{P})&=\sum_{k=1}^nf(x_{k-1})(x_k-x_{k-1})=\sum_{k=1}^n\lfloor x_{k-1}+1\rfloor(x_k-x_{k-1})\\
U(\mathcal{P})&=\sum_{k=1}^nf(x_k)(x_k-x_{k-1})=\sum_{k=1}^n\lfloor x_k+1\rfloor(x_k-x_{k-1})\\
\end{align*}
We know the floor function $\lfloor x\rfloor$ fulfills
$$\lfloor x\rfloor \leq x < \lfloor x\rfloor+1$$
with points of discontinuity at the integers. Therefore
\begin{align*}
f(x)=\lfloor x+1\rfloor=
\begin{cases}
2&\qquad 1\leq x <2\\
3&\qquad x=2
\end{cases}
\end{align*}
It's often convenient to represent the floor function by Iverson brackets
\begin{align*}
\lfloor x\rfloor=\sum_{j\geq 0}[1\leq j \leq x]
\end{align*}
This way we get rid of the floor symbols $\lfloor$ and $\rfloor$ and can manipulate sums instead.
Let's calculate the lower sum $L(\mathcal{P})$:
\begin{align*}
L(\mathcal{P})&=\sum_{k=1}^n\lfloor x_{k-1}+1\rfloor(x_k-x_{k-1})\\
&=\sum_{k=1}^n\sum_{j\geq 0}[1 \leq j \leq x_{k-1}+1](x_k-x_{k-1})\tag{1}\\
&=\sum_{k=1}^n2(x_k-x_{k-1})\tag{2}\\
&=2x_n-2x_0\tag{3}\\
&=2
\end{align*}
Comment:
In (1) we observe, that $j$ takes always the values $1$ and $2$, since $1\leq x_{k-1}<2$ for $k=1,\ldots,n$ and so the inner sum is $2$.
In (2) we do a little telescoping, leaving only elements $x_0$ and $x_n$.
In (3) we only have to cope with the endpoints of the interval $[1,2]$.
And now the upper sum $U(\mathcal{P})$:
\begin{align*}
U(\mathcal{P})&=\sum_{k=1}^n\lfloor x_{k}+1\rfloor(x_k-x_{k-1})\\
&=\sum_{k=1}^n\sum_{j\geq 0}[1 \leq j \leq x_{k}+1](x_k-x_{k-1})\\
&=\sum_{k=1}^{n-1}\sum_{j\geq 0}[1 \leq j \leq x_{k}+1](x_k-x_{k-1})\\
&\qquad+\sum_{j\geq 0}[1 \leq j \leq x_{n}+1](x_n-x_{n-1})\tag{4}\\
&=\sum_{k=1}^{n-1}2(x_k-x_{k-1})+3(x_n-x_{n-1})\\
&=2x_{n-1}-2x_0+3x_n-3x_{n-1}\\
&=3x_n-x_{n-1}-2x_0\\
&=4-x_{n-1}
\end{align*}
Comment:
- In (4) we split the last summand with $k=n$, since the inner sum consists of three summands in that case.
Note: Since the mesh of the partition $\displaystyle{\max_{1\leq k \leq n}}|x_{k}-x_{k-1}|$ tends to zero with growing $n$, we see that
$$\lim_{n\rightarrow \infty}x_{n-1}=x_n=2$$
and therefore the upper sums tend to
$$\lim_{n\rightarrow\infty}(4-x_{n-1})=2$$
the same value as the lower sums.
Note: Since the value of an integral don't change, when we change the function value of $f$ at finite many points, we obtain
\begin{align*}
\int_1^2 f(x) dx=\int_1^2 \lfloor x+1\rfloor dx=2\int_1^2 dx=\left. 2x \right|_1^2=2
\end{align*}
Best Answer
Upper and lower sums can only be computed explicitly for special examples, like the example in question, or for an exponential function. For the example at hand do the following: Partition the interval $[1,2]$ into $N$ equal parts $I_k:=[x_{k-1},x_k]$ with $$x_k:=1+{k\over N}\qquad(0\leq k\leq N)\ .$$ Looking at the graph of $f$ it is then easy to set up the upper and lower sums with $\sum$ signs. In order to actually compute these sums you need formulas like $$\sum_{k=1}^N 1= N,\qquad \sum_{k=1}^N k={N(N+1)\over2}\ .$$