I need to calculate the antiderivative of $f(x)=2x$ using only Riemann sums.

I tried to create the sums so that the limit when $n$ tends to $\infty$ of: $$\lim_{n\to\infty}\sum\limits_{i=1}^nf(\xi_i^*)\Delta x$$

Will give me the answer, but I can't get rid of the variables $b$ and $a$ which exist in $Δx$ and $\xi_i^*$.

After solving I concluded that the limit is equal to $(b^2-a^2)$ but I doubt that this is the correct answer.

EDIT: Apparently this is the correct answer, so I should change the question to how $b^2-a^2$ is equivalent to the antiderivative $x^2$

I know it may seem trivial, but I would appreciate a complete understanding of the solution

EDIT#2: Just writing my solution, for anyone who wonders how to get there

$$\Delta x=\frac{b-a}{n}$$ $$\xi_i^* =a+\frac{(b-a)i}{n}$$ $$f(\xi_i^*)=2a+\frac{2(b-a)i}{n}$$ So $$\lim_{n\to\infty}\sum\limits_{i=1}^nf(\xi_i^*)\Delta x= \lim_{n\to\infty}\sum\limits_{i=1}^n\left[\left(2a+\frac{2(b-a)i}{n}\right)\frac{b-a}{n}\right]=$$ then $$\lim_{n\to\infty}\sum\limits_{i=1}^n\frac{2ab-2a^2}{n}+\lim_{n\to\infty}\sum\limits_{i=1}^n\frac{2(b-a)^2i}{n^2}=$$ $$2ab-2a^2 +\lim_{n\to\infty} \frac{2(b-a)^2}{n^2}\sum_{i=1}^n i=$$ $$2ab-2a^2 +\lim_{n\to\infty}\frac{2(b-a)^2}{n^2}\frac{n(n+1)}{2} = b^2-a^2$$

  • 3
    $\begingroup$ What is the motivation behind this exercise in self-flagellation? $\endgroup$ Aug 11, 2017 at 16:07
  • 1
    $\begingroup$ $b^2-a^2$ is the correct answer as you computed $\endgroup$
    – gt6989b
    Aug 11, 2017 at 16:07
  • $\begingroup$ But the antiderivative is $x^2$ how can i connect my answer to it? $\endgroup$ Aug 11, 2017 at 16:08
  • $\begingroup$ Hem, don't you see a connection between $x^2$ and $b^2-a^2$ ??? $\endgroup$
    – user65203
    Aug 11, 2017 at 16:14
  • $\begingroup$ You may want to brush up upon the difference between antiderivative, definite integral, and indefinite integral. An antiderivative for $f(x) = 2x$ is $F(x) = x^2$, because $F'(x)= f(x)$. Also $F(x) + c$ for any constant $c$ is also an antiderivative. You do not compute antiderivatives using Riemann sums; you compute definite integrals using Riemann sums for a little while until you learn the Fundamental Theorem of Calculus. $\endgroup$
    – James
    Aug 11, 2017 at 16:23

2 Answers 2


In general, if $F(x) = \int_0^x f(u)du$ then

$$\int_a^b f(u) du = F(b)-F(a).$$

In your case, you know that the indefinite integral of $2x$ is $x^2$:

$$F(x) = \int_0^x f(u) \, du\qquad\qquad \text{with } F(x)=x^2, \;\;f(u) = 2u$$

When you compute the Riemann sum of $f(u)$ between limit values $u=a$ and $u=b$, you find that the result is $b^2-a^2$. That's the definite integral $F(b)-F(a) = \int_a^b f(u)\,du$, exactly as you were hoping to find.


Riemann sums compute definite integrals. You have asked for an antiderivative, an indefinite integral, so there is more to this than just computing the sum. The fundamental theorem of calculus tells us two things. The second is that for an integrable function $f$, having antiderivative $F$, $$\int_a^b f(x) \,\mathrm{d}x = F(b) - F(a) \text{.}$$ Note that a given $f$ has infinitely many choices of $F$, all of which work. (The theorem is actually a little more specific about intervals of definition. All the functions we will encounter are sufficiently well behaved on the entire real line, so I have suppressed these details.)

You seem to have found that the definite integral $$\int_a^b 2x \,\mathrm{d}x = b^2 - a^2 \text{.}$$ Note that this is a function of $b$ minus a function of $a$ and both these functions are the "square my input" function, $F(x) = x^2$. So by comparing terms in this particular definite integral with the result in the fundamental theorem, we find an antiderivative. Since we have used a non-reductive step, we should check that our result is valid: $\frac{\mathrm{d}}{\mathrm{d}x} x^2 = 2x$, as desired.

But can we be a little more rigorous? Yes. The first part of the fundamental theorem tells us $$ F(x) = \int_a^x f(x) \,\mathrm{d}x \text{.}$$ (The notation here is awful. We have used "$x$" in both a bound and an unbound context. To not write intentionally ambiguous expressions, we should write instead $ F(x) = \int_a^x f(t) \,\mathrm{d}t $. But more than a century of convention of misusing $x$ in both places means you should get used to seeing and parsing such expressions.) But we've already done this calculation. We were just unfortunate in calling the variable $x$ by the name "$b$" previously. That is, $$F(x) = \int_a^x 2t \,\mathrm{d}t = x^2 - a^2 \text{.}$$ Note that we have recovered the $x^2$ as above, but have an additional "${}-a^2$". But $a$ is some constant. If we had chosen any other $a$, this would only translate the graph of $F$ vertically, which would change its derivative, $f$, not at all. So we are free to make any choice of $a$ and we will get one of the many antiderivatives of $f$. We could just as easily have written $F(x) = x^2 + C$ for $C = -a^2$. While $C = -a^2$ is always non-positive for real $a$, the expression $x^2 + C$ is a valid antiderivative of $f$ for any choice of $C$ from the reals. Consequently, a more general antiderivative of $f$ is the function $x^2 + C$.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .