Confusion about the Riemann Integral I'm a bit confused by the definition of the Riemann intergral and I think I don't quite get it yet. In class we definet the Riemann integral as followed:

Let $f:[a,b]\rightarrow \mathbb R$ be a bounded function. Consider a partition $P = \{x_1,...,x_n\}$ of the interval $[a,b]$. We define $$m_i:=\inf\{f(x)\mid x \in (x_{i-1},x_{i})\}\quad\text{ and }\quad M_i:=\sup\{f(x)\mid x \in (x_{i-1},x_{i})\}$$
  for $i \in \{1,...,n\}$. Then $$s(f,P):=\sum_{i=1}^{n}m_i(x_i-x_{i-1})$$ is called the lower sum of $f$ with respect to $P$ and accordingly $$S(f,P):=\sum_{i=1}^{n}M_i(x_i-x_{i-1})$$ is called the upper sum of $f$ with respect to $P$. The function $f$ is called Riemann integrable if $$\sup\{s(f,P)\mid P \ \mathrm{partition}\ \mathrm{of}\ [a,b]\} =  \inf\{S(f,P)\mid P \ \mathrm{partition}\ \mathrm{of}\ [a,b]\}$$ and the value of the infimum/supremum is called the integral of $f$ over $[a,b]$. 

From what I understand that is the Darboux definition of the integral. We went straight to proving the Riemann criterion of integrability and that every continuous/monotonic function is Riemann integrable. 
However, on the internet I found the concept of a Riemann sum where one cuts $[a,b]$ into partitions of length $\frac {b-a}{n}$ lets $n\rightarrow \infty$. For example $$\int_a^b x^2 \ dx =\sum_{i=1}^{\infty} \frac {b-a}{n}\left(\frac {b-a}{n}i+a\right)^2 $$
Question:
Why, in this case, can I just consider an arbitrary partition of $[a,b]$? Are there functions which can't be integrated using "uniform" partitions? 
I guess my confusion comes from the different definitions of the integral (Darboux vs Riemann). Could somebody explain how these two notions are related?
 A: You are right . But a particular partition is chosen only in those cases where we know that the function is integrable. when we know that the function is integrable the choice of partition is immaterial. In those cases our focus is upon the value of the integral thats why we choose a partition of our convinience .. 
A: This is a nice question. The idea to allow "arbitrary" partions is to give us the freedom to "break" the interval as we see fit. For example,imagine trying to show that a function that is $1$ at some irrational numbers and $0$ everywhere else is integrable. It is much more convenient to "break" the interval at the places where the continuouity breaks rather than just at "uniform" points.
A: A bounded function $f: [a,b] \rightarrow R$ is Rie int iff for every $\epsilon$ > $0$, there exists a partition $P$ of $[a,b]$ such that $U(f;P) - L(f;P) < \epsilon$. Using this, it's easy to prove that $f$ is Rie int iff there exists a succession $(P_{n})$ of partitions of $[a,b]$ such that $\lim{U(f;P_{n})} = \lim{L(f;P_{n})} = L$ and, in this case, $L = \int_{a}^{b} f$.
