Putting the FUN Into the Fundamental Theorem of Calculus

Written by

in

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 i→xhi \to \frac{x}{h}, and h→0h \to 0, then i→∞i \to \infty, so that f(ih)h=f(∞0)0f(ih)h = f(\infty 0) 0 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 f(x)=2xf(x) = 2x, and we want to find how the line changes over a small distance hh, then we need to look at the difference between the points (x+h)(x + h), and xx:

f(x+h)−f(x)\begin{equation} f(x + h) – f(x) \end{equation}

That difference won’t give us a fixed point with respect to xx, so, we will take the average to find the midpoint:

f(x+h)−f(x)h\frac{f(x + h) – f(x)}{h}

Now that we have the midpoint, we want to know how close we can get that midpoint to our point of interest at xx, so we let h→0h \to 0 to get as close to xx as possible without touching xx:

f′(x)=limh→0⁡f(x+h)−f(x)hf'(x) = \lim_{h \to 0} \frac{f(x + h) – f(x)}{h}

That’s now the familiar form of the fundamental theorem of calculus. Let’s see what happens to your function f(x)=2xf(x) = 2x:

f′(x)=limh→0⁡2(x+h)−2xh=limh→0⁡2x+2h−2xh\begin{split} f'(x) &= \lim_{h \to 0} \frac{2(x + h) – 2x}{h} \\ &= \lim_{h \to 0} \frac{2x + 2h – 2x}{h} \\ \end{split}

In practice, we set hh to as many decimal places as our precision requires, but in general hh disappears at the limit, so:

When hh is sufficiently close to 00:

f′(x)=2f'(x) = 2

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:

f(x)=∫f′(x)f(x) = \int{f'(x)}

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:

f(x)=mx+cf′(x)=m\begin{split}f(x)&=mx+c\\f'(x)&=m\\\end{split}

Then we can say:

f′(x)=2f(x)=2x+c\begin{split} f'(x) &= 2 \\ f(x) &= 2x + c \end{split}

This helps to explain why we include cc 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 f(x)f(x) so we can see how the curve changes with respect to xx. We do this by finding a midpoint between xx and (x+h)(x+h). Let’s setup our point hh:

f′(x)=limh→0⁡2hhf'(x) = \lim_{h \to 0} \frac{2h}{h}

The above part seems redundant since we’re multiplying by 11, but hh is a scaling factor we use to set our precision; hh=11=0.10.1=0.010.01=1\frac{h}{h} = \frac{1}{1} = \frac{0.1}{0.1} = \frac{0.01}{0.01} = 1.

But we’re not looking for f(h)f(h), we’re looking for f(x)f(x) so let’s look at xx on either side of hh:

f′(x)=limh→0⁡2x+2h−2xh=limh→0⁡2(x+h)−2xh\begin{split} f'(x) &= \lim_{h \to 0} \frac{2x + 2h – 2x}{h} \\ &= \lim_{h \to 0} \frac{2(x + h) – 2x}{h} \end{split}

We’re back to our original form, so:

f(x)=2xf(x) = 2x

Now the trick here is that there are an infinite number of curves whose derivative is 2, for example:

f(x)=2xf′(x)=2\begin{split} f(x) &= 2x \\ f'(x) &= 2 \end{split}
f(x)=2x+2f′(x)=2\begin{split} f(x) &= 2x + 2 \\ f'(x) &= 2 \end{split}
f(x)=2x+4f′(x)=2\begin{split} f(x) &= 2x + 4\\ f'(x) &= 2 \end{split}

This is why we need to add the constant of integration cc, so that we can project the integral onto any function from our original derivative:

f(x)=2x+1f′(x)=2F(x)=∫2=2x+c\begin{split} f(x) &= 2x + 1 \\ f'(x) &= 2 \\ F(x) &= \int 2 = 2x + c \end{split}

Where c∈ℝc \in \mathbb{R}.

The above is called the indefinite integral, because it applies to all xx. What you were attempting in your original post, was a definite integral that applies between two points x=ax = a and x=bx = b. 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 x=1x=1 and x=2x=2.

We can work this out manually; there is a triangle on top of a rectangle. The area of the rectangle is 2×1=22 \times 1 = 2 plus, the area of the triangle 2×12=1\frac{2 \times 1}{2} = 1. So, the area under f(x)=2xf(x) = 2x between x=1x = 1 and x=2x = 2 is 2+1=32 + 1 = 3. 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 f(x)δxf(x) \delta x; where f(x)f(x) is the height of the rectangle and δx\delta x the width of the rectangle. For the rectangle bounded by f(x)=f(2)=2×2=4f(x) = f(2) = 2 \times 2 = 4 and δx=x1−x0=2−1=1\delta x = x_{1} – x_{0} = 2 – 1 = 1 (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 δx\delta x) so that f(x1)=f(2)=2×2=4,δx=0.5f(x_{1}) = f(2) = 2 \times 2 = 4, \delta x = 0.5 and f(x0)=f(1.5)=2×1.5=3,δx=0.5f(x_{0}) = f(1.5) = 2 \times 1.5 = 3, \delta x = 0.5:

Now we add together those two rectangles f(x1)δx+f(x0)δx=4×0.5+3×0.5=2+1.5=3.5f(x_{1}) \delta x + f(x_{0}) \delta x = 4 \times 0.5 + 3 \times 0.5 = 2 + 1.5 = 3.5. 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 δx→0\delta x \to 0, then we’ll have an infinite number of infinitely thin rectangles, and our approximated area converges to our actual area.

F(x)=limδx→0⁡∑i=1∞f(xi)δx=∫abf(x)δx+cF(x) = \lim_{\delta x \to 0} \sum_{i = 1}^{\infty} f(x_{i}) \delta x = \int_{a}^{b} f(x) \delta x + c

And here we have derived the integral of f(x)f(x) from first principles using a Riemann Sum.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *