Riemman Integral
Integral is the inverse operation to derivate. To integrate is in fact calculate an infinite sum and Geometrically for one variable functions, integration operation is the calculus of area located between the graph and the x-axis.
For example, take the function \(f(x)=sin x\)
Calculate integral on an interval [a, b] is like to make a (big) sum. In our example \(f(x)=sin x\) we have taken the interval [-3,-3] and some h>0. So, we have partitioned te interval in n+1 points $$a, a+h, a+2h, …, a+nh=b.$$
We call
$$x_{k}=a+kh \; \; \; \forall k: 0 \leq k\leq n$$
For each interval $$I_{k}=[x_{k},\; x_{k+1}] \; \; \; \forall k: 0 \leq k\leq n $$ we calculate the maximum of f over \(I_{k}\):
$$M_{k}=max \{f(x): x \in I_{k}\}$$
and the minimumof f over \(I_{k}\):
$$m_{k}=min \{f(x): x \in I_{k}\}$$.
Note important: continuity if f over [a, b] guarantees that both, maximum and minimum exists.
Then, we take two rectangles, both with some basis, \(I_{k}\), first one with height \(M_{k}\) and other one with height \(m_{k}\).
The area of fisrt rectangle is \(A_{k}\), and the area of second one is \(a_{k}\), in other words:
$$A_{k} = hM_{k}$$
$$a_{k} = hm_{k}$$
Finally, we take sum for both areas:
$$S_{n}(f) = \sum_{k=0}^{n} A_{k} = \sum_{k=0}^{n} hM_{k} $$
$$s_{n}(f) = \sum_{k=0}^{n} a_{k} = \sum_{k=0}^{n} hm_{k} $$
We call to first sum the
superior sums of f over [a, b], and
inferior sums to the second one.
Note that \(\forall n \in \mathbb{N} \) it is holds
$$s_{n}(f) \leq \int_{a}^{b}f(x)dx \leq S_{n}(f)$$
The idea now is to take the infimum of superior sums and supreme of inferior sums, so we have the integral definition.
Riemann Integral definition
Lets f a real variabled function.$$f:[a,b] \subset \mathbb{R} \rightarrow \mathbb{R}$$
f is integrable on interval [a, b] if infimum of superior sums is equal to supreme of inferior sums.
$$sup \{s_{n}(f) : n \in \mathbb{N}\} = inf \{S_{n}(f) : n \in \mathbb{N}\}$$
It is called integral of f over interval [a, b] denoted by
$$ \int_{a}^{b}f(x)dx $$
So:
$$sup \{s_{n}(f) : n \in \mathbb{N}\} = \int_{a}^{b}f(x)dx = inf \{S_{n}(f) : n \in \mathbb{N}\}$$
Note 1 It is not necessary to make any hipotesses to f (boundness, continuity, etc …). Integral can exists or not, after, we will proof conditions on f to integral exist or not.
Note 2 Boundness of f is not in fact any neccesary and nor sufficient condition for integral existence, as we will see in the example 2.
Example 1
Let
$$f(x)=\frac{1}{\sqrt x}$$
on interval \([0,1]\).
Note that
$$f(x)=\frac{1}{\sqrt x} = x^{\frac{-1}{2}}$$
so
$$ \int_{0}^{1}x^{\frac{-1}{2}}dx = \left.\begin{matrix}x^{\frac{1}{2}}\end{matrix}\right|_{0}^{1}. = 1.$$
(Yes yes, i know that before integral takes a constant, okay. But this is not important in this case, in fact you can suppose that it is there and its value = 0).
On this case, f is unbounded on [0,1] but integral exists.
Example 2
Let
$$f(x)=\left\{\begin{matrix} 1 & x \in \mathbb{Q}\\ 0 & x \notin \mathbb{Q} & \end{matrix}\right.$$
on interval \([0,1]\).
This function is not continuous at any \(x \in[0,1]\).
It is not difficult to show that 1 is the valule for all superior sums and 0 is the value for all inferior sums. So, integral cannot exists.
On this case, f is bounded on [0,1] but integral does not exists.
To finish let me show a theorem on existence of integral
Theorem
Lets
$$f:[a, b]\subset \mathbb{R} \rightarrow \mathbb{R}$$
A real variabled, picewise continuous and bounded function, then f is integrable on interval [a,b], ie exists the number
$$ \int_{a}^{b}f(x)dx $$
Note 1: Picewise continuous function means that function is continuous except any finite set of points into [a, b] interval.
Note 2: Boundary of f is not a neccesary condition as we have shown in the example 1 (remember the \(f(x)=\frac{1}{\sqrt x}\) function at [0,1] interval). Itself is not a sufficient condition too, as shown in example 2, but continuity is a sufficient condition when joined the conditions of theorem.
Corollary
Lets f
$$f:[a, b]\subset \mathbb{R} \rightarrow \mathbb{R}$$
A continuous function, then f is integrable on interval [a,b], ie exists the number
$$ \int_{a}^{b}f(x)dx $$