How do you do the midpoint Riemann sum part to find the length of the curve I believe I have the first two parts correct.

Answer:
[tex]\int_a^b(sinx-xcosx)dx[/tex][tex]\begin{gathered} a=0 \\ b=\pi \end{gathered}[/tex][tex]Length\text{ of the curve}\approx3.9981[/tex]Explanation:
Given the function;
[tex]\begin{gathered} y=sinx-xcosx\text{ from x = 0 to x = }\pi \\ \end{gathered}[/tex]So to find the area of the curve defined by the above, we have to compute;
[tex]\int_a^b(sinx-xcosx)\text{dx where a = 0 and b = }\pi[/tex]Let's go ahead and determine the length of the curve as seen below;
[tex]\begin{gathered} \int_0^{\pi}(sinx-xcosx)dx \\ =\int_0^{\pi}sinxdx-\int_0^{\pi}xcosxdx=[-cosx]_0^{\pi}-[xsinx+cosx]_0^{\pi} \\ =[-cos(\pi)-(-cos(0))]-[(\pi sin\pi+cos\pi)-(0sin0+cos0)] \\ =[-(-1)-(-1)]-[(\pi(0)+(-1))-[0+(1)] \\ =2-(-2) \\ =2+2 \\ =4 \end{gathered}[/tex]Given the below midpoint Riemann sum formula;
[tex]A_m=\sum_{i\mathop{=}1}^n\Delta xf(x_i)[/tex]where;
[tex]\begin{gathered} A=area\text{ under the curve} \\ \Delta x=width\text{ of each each rectangle} \\ f(x)=length\text{ of each rectangle} \\ n=number\text{ of rectangles = 4} \end{gathered}[/tex]Let's determine the width of each rectangle as seen below;
[tex]\begin{gathered} \Delta x=\frac{b-a}{n}=\frac{\pi-0}{4}=\frac{\pi}{4} \\ So\text{ the middle points will }\frac{\pi}{8},\frac{3\pi}{8},\frac{5\pi}{8},\frac{7\pi}{8} \end{gathered}[/tex]We can now go ahead and solve for A as seen below;
[tex]\begin{gathered} A_m=\Delta x[f(\frac{\pi}{8})+f(\frac{3\pi}{8})+f(\frac{5\pi}{8})+f(\frac{7\pi}{8})] \\ A_m=\frac{\pi}{4}(0.0199+0.4730+1.6753+2.9223) \\ A_m=0.7854(5.0905) \\ A_m=3.9981 \end{gathered}[/tex]So an approximate value of the length of the curve using the middle Riemann sum is 3.9981