This post is a long-form response to Brad’s post on Mastodon.
Brad: “We just started on integral ca…” – Brisbane Social
Hi Brad,
You’ve come very close to describing the Riemann Sum, but there is a flaw in your attempt that makes your version blowup.
If , and , then , so that which is undefined.
I think that you have tried to mix together definite and indefinite integrals, into their anti-derivative. I will try to explain by going right back to the basics starting with the fundamental theorem, that way we won’t miss anything.
To integrate using the fundamental theorem in the context of your post you just work backwards from the derivative, since the indefinite integral is just the anti-derivative.
If , and we want to find how the line changes over a small distance , then we need to look at the difference between the points , and :
That difference won’t give us a fixed point with respect to , so, we will take the average to find the midpoint:
Now that we have the midpoint, we want to know how close we can get that midpoint to our point of interest at , so we let to get as close to as possible without touching :
That’s now the familiar form of the fundamental theorem of calculus. Let’s see what happens to your function :
In practice, we set to as many decimal places as our precision requires, but in general disappears at the limit, so:
When is sufficiently close to :
This makes sense, since:
- the derivative is defined as the slope of the tangent line, and
- the function is linear.
Here, we’ve gone from the function to the derivative, but you want to go from the derivative to the function:
Let’s reverse the logic. If the derivative gives the slope of the tangent line, and we are certain that our function is linear, then:
Then we can say:
This helps to explain why we include the constant of integration which comes next. We can’t always assume that our function is linear, so let’s see what happens to the side of so we can see how the curve changes with respect to . We do this by finding a midpoint between and . Let’s setup our point :
The above part seems redundant since we’re multiplying by , but is a scaling factor we use to set our precision; .
But we’re not looking for , we’re looking for so let’s look at on either side of :
We’re back to our original form, so:
Now the trick here is that there are an infinite number of curves whose derivative is 2, for example:

This is why we need to add the constant of integration , so that we can project the integral onto any function from our original derivative:
Where .
The above is called the indefinite integral, because it applies to all . What you were attempting in your original post, was a definite integral that applies between two points and . This is where things blew up, because you were applying the logic of two defined points, with the theorem that applies to all points.
So, let’s work through a case where we want to find the area under the curve between and .

We can work this out manually; there is a triangle on top of a rectangle. The area of the rectangle is plus, the area of the triangle . So, the area under between and is . We are aiming for an approximation that converges to 3.
What you described in your original post is a Riemann Sum. We can estimate the area under the curve by finding the area of the rectangle with the area ; where is the height of the rectangle and the width of the rectangle. For the rectangle bounded by and (shown in pink) we have the plot:

We observe that the area of the pink rectangle is 4, but we also observe the we have overstated the desired area in red. Let’s reduce the overstatement of the pink area by splitting it into two rectangles, (i.e. halve ) so that and :

Now we add together those two rectangles . We can see that we’re now closer to our known area of 3.
You can see where this is going, if we continue to reduce , then we’ll have an infinite number of infinitely thin rectangles, and our approximated area converges to our actual area.
And here we have derived the integral of from first principles using a Riemann Sum.