Consider a partition P Consider a partition $P= \{ [0,\frac{2}{7}]\}, \{ [\frac{2}{7}, \frac{1}{2}\}], \{ [\frac{1}{2}, \frac{2}{3}]\}, \{ [\frac{2}{3}, \frac{5}{7}]\}, \{ [\frac{5}{7},1]\} $ of $[0,1].$. Compute $\overline{I}_P(f)$ and $\underline{I}_P(f)$ for $f(x)=(x-\frac{1}{2})^2$
Now I know that:
A partition $P $ of $I$: $P=\{J_k: 0 \leq k \leq N\}$
$ l(J_k)=x_{k+1}-x_k$, where l is the length.
$\overline{I}_P(f)= \sum_{k=0}^N sup_{x \in J_k}f(x) \cdot l(J_k)$ 
$\underline{I}_P(f)= \sum_{k=0}^N inf_{x \in J_k}f(x) \cdot l(J_k)$ 
With this information, I'm having a hard time starting this solution. I can't find examples on computation of partitions, and I really want to understand how to do it.  Can someone provide an example similar to this or help me step by step? 
 A: First, let us find the $l(J_k)$'s. 
\begin{align*}
l(J_1) &= 2/7-0=2/7 \\ 
l(J_2)&=1/2-2/7=3/14 \\
l(J_3) &= 2/3 - 1/2 = 1/6 \\
l(J_4)&=5/7-2/3=1/21 \\
l(J_5) &= 1 - 5/7 = 2/7 \\
\end{align*}
Then the suprememum's (Because this seems to be a computation problem, I will simply use Wolfram Alpha):
\begin{align*}
\sup_{x\in J_1} f(x) &= 1/4 \\
\sup_{x\in J_2} f(x) &= 9/196 \\
\sup_{x\in J_3} f(x) &= 1/36 \\
\sup_{x\in J_4} f(x) &= 9/196 \\
\sup_{x\in J_5} f(x) &= 1/4 \\
\end{align*}
And now the infimum's:
\begin{align*}
\inf_{x\in J_1} f(x) &= 9/196 \\
\inf_{x\in J_2} f(x) &= 0 \\
\inf_{x\in J_3} f(x) &= 0 \\
\inf_{x\in J_4} f(x) &= 1/36 \\
\inf_{x\in J_5} f(x) &= 9/196 \\
\end{align*}
Then, multiplying and summing, we get (put answers as decimals so its easy to check):
$$
\overline{I}_P (f) = \frac{1}{4}\frac{2}{7} + \frac{9}{196}\frac{3}{14} + \frac{1}{36}\frac{1}{6} + \frac{9}{196}\frac{1}{21} + \frac{1}{4}\frac{2}{7} = .1595... 
$$
and
$$
\underline{I}_P (f) = \frac{9}{196}\frac{2}{7} + 0\cdot\frac{3}{14} + 0\cdot\frac{1}{6} + \frac{1}{36}\frac{1}{21} + \frac{9}{196}\frac{2}{7} = .0276... 
$$
Disclaimer: I kind of did this quickly so it is very possible I made a mistake somewhere in my calculations. Please call me out if you think I did that.
