I thought I had the process but I was off apparently. The equations are y=sin^2(pi x/4), y=cos^2(pi x/4) 0, greater or equal to x, greater or equal to 1)
You want four subintervals of the interval interval $\displaystyle [0,1]$, so they are each of length $\displaystyle 0.25$, and have mid points $\displaystyle 0.125, 0.375, 0.625, 0.875$, or:
$\displaystyle x_i=\frac{b-a}{n} \times (k+0.5), \ \ k=0,1,.., n-1$
are the interval mid points, where $\displaystyle a, b$ are the limits of integration, and $\displaystyle n$ is the number of subintervals.
Then:
$\displaystyle \int_a^b f(x)\ dx \approx \frac{b-a}{n}\sum_{k=0}^{n-1}f(x_i)$
or writing $\displaystyle h=(b-a)/n$
$\displaystyle x_i=h \times (k+0.5), \ \ k=0,1,.., n-1$
$\displaystyle \int_a^b f(x)\ dx \approx h\sum_{k=0}^{n-1}f(x_i)$
which is the sum of the function at the mid points of the intervals times the interval length
CB