I seem to be completely lost with integration.
I have to integrate $f(x)=x^2$ on $x\in[0,a]$
What I have got so far: I partition the interval $[0,a]$ $$ 0 = x_0 < x_1 < \dots < x_{n-1} < x_n = a $$ So the subintervals are $ [x_{i}-x_{i-1}] $ long. I know that in Darboux integration, it is not necessary for the rectangles (the ones which approximate the function from below and above) to have equal width. Their height is either $$m_i = \inf_{x \in [x_{i-1},x_i]}f(x),$$ for the rectangles below or $$M_i=\sup_{x \in [x_{i-1},x_i]}f(x),$$ that is for the rectangles 'above'. So the lower Darboux sum is: $$ L(f,P)=\sum_{i}^{n}{m_i(x_{i}-x_{i-1})} $$ and the other one is: $$ U(f,P)=\sum_{i}^{n}{M_i(x_{i}-x_{i-1})}$$ I can see, from the graph of the function, that $m_i=x_{i-1}^2$ and $M_i=x_i^2$ so I can plug those in: $$ L(f,P)=\sum_{i}^{n}{x_{i-1}^2(x_{i}-x_{i-1})} $$ I could do the same with the upper one. But here I am stuck, don't I need to somehow define an $x_i$? A partition? But how do I do that without making all the subintervals of equal length? Integrating on $[0,1]$ is easier, because I can say that they are of equal length and it is $\frac{1}{n}$, so $n$ number of these equals $1$ and that is the 'right side' of the interval.
I think I am am missing something here. Could you please elaborate so that I can understand what this is all about?
Any polynomial is a continuous function: in particular, any polynomial is Riemann-integrable over a compact interval. Once we have Riemann integrability granted, we may just consider uniform partitions of the integration range, leading to $$ \int_{0}^{a}x^2\,dx =\lim_{n\to +\infty}\frac{a}{n}\sum_{k=1}^{n}\left(\frac{ak}{n}\right)^2 =a^3 \lim_{n\to +\infty}\frac{1}{n^3}\sum_{k=1}^{n}k^2.\tag{1}$$ Due to the Hockey-stick identity we have $$ \sum_{k=1}^{n}\binom{k}{2}=\binom{n+1}{3},\qquad \sum_{k=1}^{n}\binom{k}{1}=\binom{n+1}{2}\tag{2}$$ hence from $k^2 = 2\binom{k}{2}+\binom{k}{1}$ it follows that $$ \sum_{k=1}^{n}k^2 = \frac{n(n+1)(2n+1)}{6} \tag{3}$$ and by plugging in such identity into the RHS of $(1)$ we get:
$$ \int_{0}^{a}x^2\,dx = a^3 \lim_{n\to +\infty}\frac{n(n+1)(2n+1)}{6n^3}=\color{red}{\frac{a^3}{3}}.\tag{4}$$