Consider the function f(x) = -x^2/2 -8

In this problem you will calculate by using the definition

The summation inside the brackets is which is the Riemann sum where the sample points are chosen to be the right-hand endpoints of each sub-interval.

Calculate for on the interval and write your answer as a function of without any summation signs.

Okay, I can't seem to get the right answer for this one. Here's what I have done so far:

The distance in play here is from 0 to 4, so with n number of rectangles, each width should be 4/n. I replaced x with 4/n(i) and replaced dx with 4/n.

Since in this equation we have x^2, I end up with

-(4/n(i))^2 / 2 - 8 (4/n)

I can't use "i" in my answer so I substituted it with the special sum formula for i^2 which is n(n+1)(2n+1)/6

All together then, what I came to is

((-[(4^2/n^2)(n(n+1)(2n+1)/6)]/2) - 8 )(4/n)

sorry for all the parentheses.

I know that this answer is wrong but I have no idea where I went wrong.

Thank you for any help!!