Using integral definition to solve this integral I'm trying to solve this question using the definition of integral:

$$\int^5_2 (4-2x)dx$$

Definition of integral:
We define first the inferior and superior sum:
Let $f:[a,b]\to \mathbb R$ be a bounded function and $P=\{t_0,\ldots,t_n\}$ a partition of [a,b], so we define:
$$s(f;P)=\sum_{i=1}^nm_i(t_i-t_{i-1})$$
$$S(f;P)=\sum_{i=1}^nM_i(t_i-t_{i-1})$$
Where $m_i=\inf\{f(x);x\in [t_i,t_{i-1}]\}$ and $M_i=\sup\{f(x);x\in [t_i,t_{i-1}]\}$ and ().
No we define the inferior and superior integral:
Inferior integral: $\underline\int^b_a=\sup_P s(f;P)$
Superior integral: $\bar\int^b_a=\inf_P s(f;P)$
At last, we define the integral being the superior or inferior integral when they are the same.
My attempt
I know:
$s(f,P)=\sum_{i=1}^n(4-2t_i)(t_i-t_{i-1})$ (because the function is decreasing)
But I don't know how to take the supreme of this sum.
Thanks.
 A: The contributions from fellow users Mhenni Benghorbal and oks pave the way.
Using equidistant spacings one can perform the summation like this:
$$
\begin{align}
s(f,P') &= \sum_{i=1}^n(4-2t_i)(t_i-t_{i-1}) \\
&= \left(\sum_{i=1}^n 4 - 2 \left(a + \frac{b-a}{n} i \right) \right)\frac{b-a}{n} \\
&= \left(4n - 2 \left(a n + (b-a) \frac{n+1}{2} \right) \right) \frac{b-a}{n} \\
&= \left(4 - 2a - (b-a)\left(1+ \frac{1}{n}\right) \right) (b-a) \\
&= \left(4 - 2a - (b-a)\right) (b-a) - \frac{(b-a)^2}{n} \\
\Rightarrow \sup s(f, P') &= \left(4 - 2a - (b-a) \right) (b-a) \\
&=4(b-a) -(b+a)(b-a) \\
&=4(b-a) -(b^2 - a^2) 
\end{align}
$$
and
$$
\begin{align}
S(f,P') &= \sum_{i=1}^n(4-2t_{i-1})(t_i-t_{i-1}) \\
&= \left(\sum_{i=1}^n 4 - 2 \left(a + \frac{b-a}{n} (i-1) \right) \right)\frac{b-a}{n} \\
&= \left(4n - 2 \left(a n + (b-a) \frac{n-1}{2} \right) \right) \frac{b-a}{n} \\
&= \left(4 - 2a - (b-a)\left(1-\frac{1}{n}\right) \right) (b-a) \\
&= \left(4 - 2a - (b-a)\right) (b-a) + \frac{(b-a)^2}{n} \\
\Rightarrow \inf S(f,P') &= \left(4 - 2a - (b-a) \right) (b-a) \\
&=4(b-a) -(b^2 - a^2) 
\end{align}
$$
A: Hint: Since you know that $s(f,P)<S(f,P')$ for any two divisions $P,P'$, it is enough to find, for each $\epsilon$, such a division $P$ that $$-9-\epsilon < s(f,P)< S(f,P) < -9+\epsilon$$
A: It is always much easier to use the Mean Value Theorem on the function $g(x) = 4x - x^2$ ni every interval on the partition. That is for each $i$ there exists $c_i \in  [t_{i- 1}, t_i] $ such that 
$$ \dfrac{g(t_i) - g(t_{i-1})}{ t_i - t_{i- 1} } = g'(c_i) = (4 - 2x)|_{x = c_i} = 4 - 2c_i = f(c_i)$$
Now try to use the fact that $m_i \ge f(c_i) \ge M_i$ since $ t_{i-1} \le c_i \le t_i $ and the function $f$ is increasing.  
A: Hint: if you are integrating over an interval $[a,b]$ then

$$ \Delta t_i = t_i-t_{i-1} = \frac{b-a}{n}.  $$

Also, your function is a decreasing function then you should know what $m_i$ and $M_i$ are.
