For Riemann Sums, it helps to note down all of the values of the function at the endpoints:
x = 0 ; xsin(x) = 0*0 = 0
x = pi/6 ; xsin(x) = (pi/6)*(1/2) = pi/12
x = pi/4 ; xsin(x) = (pi/4)*(sqrt(2)/2) = pi*sqrt(2)/8
x = pi/3 ; xsin(x) = (pi/3)*(sqrt(3)/2) = pi*sqrt(3)/6
x = pi/2 ; xsin(x) = (pi/2)*(1) = pi/2
You should also determine what the size of each partition is, since they may be unequal:
pi/6 - 0 = pi/6
pi/4 - pi/6 = 3pi/12 - 2pi/12 = pi/12
pi/3 - pi/4 = 4pi/12 - 3pi/12 = pi/12
pi/2 - pi/3 = 3pi/6 - 2pi/6 = pi/6
So then, for each part of the question, match up and multiply each partition width with the appropriate endpoint value, then sum it up:
(a) Left Endpoints
0 * pi/6 = 0
pi/12 * pi/12 = pi^2/144
pi*sqrt(2)/8 * pi/12 = pi^2*sqrt(2)/96
pi*sqrt(3)/6 * pi/6 = pi^2*sqrt(3)/36
Sum = 0 + pi^2/144 + pi^2*sqrt(2)/96 + pi^2*sqrt(3)/36 = pi^2*[1/144 + sqrt(2)/96 + sqrt(3)/36]
*Calculator* I ~ 0.68878
(b) Right Endpoints
pi/12 * pi/6 = pi^2/144
pi*sqrt(2)/8 * pi/12 = pi^2*sqrt(2)/96
pi*sqrt(3)/6 * pi/12 = pi^2*sqrt(3)/36
pi/2 * pi/6 = pi^2/12
Sum = pi^2/144 + pi^2*sqrt(2)/96 + pi^2*sqrt(3)/36 + pi^2/12 = pi^2*[1/144 + sqrt(2)/96 + sqrt(3)/36
+1/12]
*Calculator* I ~ 1.51125