Area under a curve subintervals For the graph $y=-x^2+10x+24$ for $(-1\le x \le 3)$
How many subintervals would I need to estimate the area to within 0.1 unit²
I ended up drawing a crazy graph and came up with 800, which is wrong... 

Using $n$ intervals of equal length $\frac{4}{n}$, an estimate of the area by upper rectangles is given by
$$A(n) = \sum_{k=1}^n f\left(-1+k \cdot \frac{4}{n}\right)\cdot \frac{4}{n}.$$
Since $f(x) = -x^2+10x+24$, we get
$$A(n) = \frac{4}{n} \sum_{k=1}^n \left[-\left(-1+k \cdot \frac{4}{n}\right)^2 + 10 \left(-1+k \cdot \frac{4}{n}\right) +24\right]$$
or simplified
$$A(n) = \frac{4}{n} \sum_{k=1}^n \left[- k^2 \cdot \frac{16}{n^2} + k \cdot \frac{48}{n}+13\right].$$
We want
$$\left|\int_{-1}^3 f(x) \, dx - A(n)\right| \leq 0.1.$$
Let us simplify the LHS before we solve for $n$. Using
$$\sum_{k=1}^n k = \frac{n(n+1)}{2}, \, \sum_{k=1}^n k^2 = \frac{n(n+1)(2n+1)}{6}$$
we can find 
$$A(n) = \frac{4}{n} \left( -\frac{8}{n} \frac{(n+1)(2n+1)}{3}  + 24(n+1) + 13n\right) = \frac{380n^2+192n-32}{3n^2}$$
and therefore $\int_{-1}^3 f(x) \, dx = \lim_{n \to \infty} A(n) = \frac{380}{3}$. Hence the inequality becomes
$$\left|\frac{380}{3} - \frac{380n^2+192n-32}{3n^2} \right|\leq 0.1$$
which eventually yields
$$n \geq 639.833,$$
so $n = 640$ should work.
You can check that $\frac{380}{3} = 126.666\dots$ and for $n = 640$ we get $A(n) \approx 126.76664$ whereas for $n = 639$ we have $A(n) \approx 126.76680$.
