Consider the function f(x)=-x+2, 0<=x<=1 on the interval [0,1]

1)Let Pn be the partition {0,1/n,2/n,...,1}.Calculate L(Pn) (the lower sum) and U(Pn) (the upper sum).

I know the formula for L(P) and U(P) but I don't really understand it and I'm having trouble applying it. I know it's the sum of m=(i-1)/n and M=(i/n) but I don't know how to adapt this to the formula.Can anyone help please?

2)Hence prove that f is Riemann Integrable on [0,1] and evaluate the integral?

Once I have U(P) and L(P) I find the limit as n tends to infinity and if the limits are equal the function is integrable?and the value of the integral is -1/2x^2+2x+c.

Can someone please correct me where I'm wrong and help me with the rest.

Thanks in advance.