Integral over a curve

Move slider and the number represents the number of rectangles used to determine the integral under a curve between to points A an B. A and B can be moved as well.

1. What is the integral between the two intervals (-2, 4)? 2. What value of n will give the best approximation?