<s>[INST] Limits of finite sums I know that: $$\int_0^1 1 - x^2 dx = \frac{2}{3}$$
And that represents the area below the curve, delimited by the lines $x= 0$ and $x = 1$
But $$\int_0^1 1 - x^2 dx = \lim_{n \to \infty} \left( 1 - \frac{2n^3 + 3n^2 +n}{6n^3} \right) $$
And this limit is obtained by calculating an approximation of the inferior sum using $n$ rectangles of width $\Delta x = (1 - 0)/n$ and than making $n \to \infty$
The sum is:
$$\left[ f \left( \frac{1}{n} \right) \right] \left( \frac{1}{n} \right) + \left[ f \left( \frac{2}{n} \right) \right] \left( \frac{1}{n} \right) + \dots \left[ f \left( \frac{k}{n} \right) \right] \left( \frac{1}{n} \right) + \dots
\left[ f \left( \frac{n}{n} \right) \right] \left( \frac{1}{n} \right) =$$
$$ = \sum_{k = 1}^n f \left( \frac{k}{n} \right) \left( \frac{1}{n} \right) = \sum_{k = 1}^n \left( 1 - \left( \frac{k}{n} \right)^2 \right) \left( \frac{1}{n} \right)$$
A) Determine the superior sum.
I thought that:
$$ \sum_{k = 0}^n f \left( \frac{k - 1}{n} \right) \left( \frac{1}{n} \right)  $$
Could represent this, am I correct?
B) I've tried to generalize the inferior sum for the interval $[a,b]$, and I found it:
$$\sum_{k = 1}^n f \left( \frac{k(b - a)}{n} \right) \left( \frac{b - a}{n} \right) $$ 
But when I calculate the sum as $n \to \infty$, it's not equal to $\int_a^b 1 - x^2 dx $.
Is this a correct sum or I'm doing something wrong?
 [/INST] You're not quite summing it right. If, for example, we use $a=2, b=3$ in:
$$\sum_{k = 1}^n f \left( \dfrac{k(b - a)}{n} \right) \left( \dfrac{b - a}{n}\right)$$
the function in the sum runs from $\dfrac1n$ to $1$.
Instead use:
$$\sum_{k = 1}^n f \left( a+\dfrac{k(b - a)}{n} \right) \left( \dfrac{b - a}{n}\right)$$
Your superior sum looks fine.
</s>