Any two antiderivatives of a function differ by a constant, so the integral from a to b is F(b) - F(a) for any antiderivative F. Read the derivative table backwards, and the running area 1/3 and the trip’s 32/3 metres each take one line.
Prove from the mean value theorem that two antiderivatives of a function on an interval differ by a constant.
State the second part of the fundamental theorem of calculus, that the integral from a to b is F(b) - F(a), and prove it from the first part.
Find antiderivatives of powers, 1/x, e^x, sin x and cos x by reading the derivative table backwards, and check each by differentiating.
Write an indefinite integral with its constant C, and use a starting value to fix C.
Evaluate definite integrals in one line and check them with scipy.integrate.quad.
In review. The maths and code on this page are checked by automated tests on every change, but an independent reader has not signed it off yet. Spot a mistake or a confusing step? Tell us.
The question
In M04.5.2 the area under \({x^2}\) from 0 to 1 took a formula for the sum of the first \(n\) squares, a proof by induction and a limit, and it came out as \({\tfrac13}\). Here is another route: \({x^3/3}\) has slope \({x^2}\), and \({\tfrac13 \cdot 1^3 - \tfrac13 \cdot 0^3 = \tfrac13}\). One line, same answer. Why does a function whose slope is \({x^2}\) know the area under \({x^2}\), and does every such function work?
From the last lesson
1. State part one of the fundamental theorem of calculus.
Show answer
If \(f\) is continuous on an interval containing \(a\), the area function \({A(x) = \int_a^x f(t)\,dt}\) has derivative \({A'(x) = f(x)}\) at every \(x\) of the interval.
2. Why has the area function of the step function no slope at 0?
Show answer
The step jumps at 0, so the theorem’s continuity condition fails there. Its area function is ReLU, with slope 0 from the left and 1 from the right.
Intuition
An antiderivative of \(f\) is any function whose slope is \(f\). The function \({x^2}\) has many: \({\tfrac13 x^3}\), \({\tfrac13 x^3 + 0.4}\), \({\tfrac13 x^3 - 0.4}\) and so on. Their graphs are one curve slid up and down.
M04.6.3-F1
Left: the area under \({x^2}\) from 0 to 1. Right: four antiderivatives of \({x^2}\), the same curve slid up and down. Every one rises by \({\tfrac13}\) between 0 and 1, the area on the left. The thick one is the area function from 0, which starts at height 0.
Sliding a curve up does not change how much it rises between two points. One member of the family is the area function from \(a\), and the last lesson showed it is an antiderivative. It starts at 0, so its rise from \(a\) to \(b\) is the area itself. Every other member rises by the same amount. So any antiderivative computes the area: take its value at the right end and subtract its value at the left end.
Build it up
Step 1. Zero slope means no change. Suppose \({G'(x) = 0}\) at every point of an interval, and take two points \({p < q}\) in it. The mean value theorem (M04.4.1) gives a point \(c\) between them where the slope equals the slope of the chord:
\[
\frac{G(q) - G(p)}{q - p} = G'(c) = 0 .
\]
So \({G(q) = G(p)}\). Any two points have the same value, so \(G\) is constant on the interval.
Step 2. Two antiderivatives differ by a constant. If \({F_1' = f}\) and \({F_2' = f}\) on an interval, then \({(F_1 - F_2)' = f - f = 0}\), so by Step 1 the difference \({F_1 - F_2}\) is a constant. This is why the curves on the right of the figure are slid copies of one another.
Step 3. Every antiderivative is the area function plus a constant. For a continuous \(f\), part one says that \({A(x) = \int_a^x f(t)\,dt}\) is an antiderivative. By Step 2, any other antiderivative \(F\) is \({F(x) = A(x) + C}\) for some constant \(C\).
Step 4. The constant cancels. Evaluate at \(b\) and at \(a\) and subtract:
And \({A(b) = \int_a^b f(t)\,dt}\). So the integral is the rise of any antiderivative.
Step 5. A starting value picks one curve. The trip’s speed is \({v(t) = 4t - t^2}\), and \({2t^2 - \tfrac13 t^3}\) has that slope, so every position the cart could have is \({s(t) = 2t^2 - \tfrac13 t^3 + C}\). Knowing where it started picks one: \({s(0) = 0}\) gives \({C = 0}\). Whatever the start, the cart covers \({\tfrac{32}{3}}\) metres in 4 seconds.
M04.6.3-F3
The trip’s distance in one line. Left: the area under the speed curve. Right: three positions with that speed, for carts started at 0, 3 and 6 metres. Each rises by \({\tfrac{32}{3}}\) metres, the area; the starting value \({s(0) = 0}\) picks the lowest.
The formal statement
NoteTheorem: the fundamental theorem of calculus, part two
Let \(f\) be continuous on \({[a, b]}\) and let \(F\) be any antiderivative of \(f\) there. Then
\[
\int_a^b f(x)\,dx = F(b) - F(a) .
\]
The right side is written \({\big[F(x)\big]_a^b}\).
Proof. Steps 3 and 4 above, which rest on part one and on Step 2. Step 2 in turn rests on the mean value theorem. \(\square\)
Two antiderivatives differ by a constant only on an interval: Step 1 needs every point between \(p\) and \(q\) to be in the domain. The third exercise shows what happens across a gap.
The derivative table, read backwards. Each rule of M04.3 turns round into an antiderivative. Check each one by differentiating the middle column.
\({f(x)}\)
an antiderivative
why
\({x^r}\), \({r \neq -1}\)
\({\frac{x^{r+1}}{r+1}}\)
power rule
\({1/x}\), \({x \neq 0}\)
\({\ln \abs{x}}\)
below
\({e^x}\)
\({e^x}\)
M04.3.2
\({\sin x}\)
\({-\cos x}\)
M04.3.2
\({\cos x}\)
\({\sin x}\)
M04.3.2
The power rule holds for every real exponent (M04.3.4), so the first row covers \({\sqrt{x}}\) and \({1/x^2}\) too. It fails only for \({r = -1}\), where it would divide by zero, and that gap is filled by the logarithm. For \({x > 0}\) the slope of \({\ln x}\) is \({1/x}\) (M04.3.4). For \({x < 0}\), \({\ln \abs{x} = \ln(-x)}\), and the chain rule gives its slope as \({\frac{1}{-x} \cdot (-1) = \frac1x}\).
Constant multiples and sums carry over, because they do for derivatives (M04.3.1): if \({F' = f}\) and \({G' = g}\), then \({(pF + qG)' = pf + qg}\) for any numbers \(p\) and \(q\).
The indefinite integral. The family of all antiderivatives of \(f\) on an interval is written
\[
\int f(x)\,dx = F(x) + C ,
\]
with no limits, where \(F\) is any one antiderivative and \(C\) stands for any constant. For example, on an interval that avoids 0,
and differentiating the right side gives back the integrand. A definite integral is a number; an indefinite integral is a family of functions.
Go deeper: the other proof of part two
OpenStax proves part two without part one. Cut \({[a, b]}\) into \(n\) equal strips of width \({\Delta x}\) at \({x_0 = a < x_1 < \dots < x_n = b}\). The total rise of \(F\) is the sum of its rises over the strips, because the inner values cancel in pairs:
On each strip the mean value theorem gives a point \({c_k}\) with \({F(x_k) - F(x_{k-1}) = f(c_k)\,\Delta x}\). So \({F(b) - F(a)}\) equals a Riemann sum of \(f\), with the points \({c_k}\) as its sample points, for every \(n\). For a continuous \(f\) the Riemann sums tend to the integral whatever the sample points (M04.5.2), while the left side does not change, so the two are equal. Lesson M04.6.4 meets the same cancelling sum on sampled data.
Worked example
Four integrals, one line each.
The running area: \({\tfrac13 x^3}\) has slope \({x^2}\), so
The area under one arch of \({\sin x}\) is the rise of \({-\cos x}\) from 0 to \(\pi\): from \({-1}\) up to 1, which is 2. A curved region with a whole-number area.
The logarithm: \({\ln x}\) has slope \({1/x}\) for \({x > 0}\), so \({\int_1^e \tfrac1x\,dx} = {\ln e - \ln 1} = {1 - 0} = 1\).
In each case the work is to find an antiderivative and check it by differentiating; the subtraction is the easy part.
Code
From scratch: each antiderivative is checked by a central difference (M04.2.4), the integral is taken as \({F(b) - F(a)}\), and a midpoint sum with ten thousand strips (M04.5.2) confirms it.
import mathdef slope(F, x, h=1e-5):return (F(x + h) - F(x - h)) / (2* h)def midpoint_sum(f, a, b, n=10_000): dx = (b - a) / nreturnsum(f(a + (k +0.5) * dx) for k inrange(n)) * dxcases = [ # (name, f, an antiderivative F, a, b) ("x^2", lambda x: x **2, lambda x: x **3/3, 0, 1), ("4t - t^2", lambda t: 4* t - t **2, lambda t: 2* t **2- t **3/3, 0, 4), ("sin x", math.sin, lambda x: -math.cos(x), 0, math.pi), ("1/x", lambda x: 1/ x, math.log, 1, math.e),]for name, f, F, a, b in cases: worst =max(abs(slope(F, x) - f(x)) for x in (a +0.3, (a + b) /2, b -0.3))print(f"{name:9s} F(b) - F(a) = {F(b) - F(a):.6f} sum = {midpoint_sum(f, a, b):.6f}"f" F' matches f: {worst <1e-6}")
x^2 F(b) - F(a) = 0.333333 sum = 0.333333 F' matches f: True
4t - t^2 F(b) - F(a) = 10.666667 sum = 10.666667 F' matches f: True
sin x F(b) - F(a) = 2.000000 sum = 2.000000 F' matches f: True
1/x F(b) - F(a) = 1.000000 sum = 1.000000 F' matches f: True
The library: scipy.integrate.quad integrates numerically and returns the value with an estimate of its error. It needs no antiderivative, so it is an independent check.
from scipy.integrate import quadfor name, f, F, a, b in cases: value, error = quad(f, a, b)print(f"{name:9s} quad = {value:.10f} (error estimate {error:.0e})")value, _ = quad(lambda x: 1/ x, -3, -1) # below zero: ln|x| is the antiderivativeprint(f"1/x from -3 to -1: quad = {value:.6f} ln|-1| - ln|-3| = {-math.log(3):.6f}")
The area accumulator in lesson M04.6.2 draws, in its lower panel, one particular antiderivative: the one that is 0 at the left end. For \({\cos t}\) from 0 it traces \({\sin x}\), and for the sigmoid it traces softplus less a constant. Drag the end to \(b\) and read the area from \(a\) to \(b\) as the height of that curve.
Pitfalls
M04.6.3-F4
Wrong beside right. \({-1/x}\) is an antiderivative of \({1/x^2}\), but \({1/x^2}\) is not continuous on \({[-1, 1]}\): it runs off to infinity at 0. Subtracting there gives \({-2}\), a negative area for a positive function. On \({[1, 2]}\) there is no break, and the answer \({\tfrac12}\) is right.
“If I have an antiderivative, \({F(b) - F(a)}\) is the integral.”
Part two promises this only when \(f\) is continuous on the whole of \({[a, b]}\). For \({1/x^2}\) on \({[-1, 1]}\), the recipe gives \({\big[-\tfrac1x\big]_{-1}^{1}} = {-1 - 1} = {-2}\), but every height is positive and the region near 0 is unbounded. Check for breaks before you subtract; areas that run to infinity are M04.7.3.
“The constant doesn’t matter, so I can leave it off.”
In \({F(b) - F(a)}\) it cancels, so any antiderivative will do. In an indefinite integral it is part of the answer: \({\int x^2\,dx}\) is the whole family \({\tfrac13 x^3 + C}\). And when a starting value is given, as with the cart, \(C\) must be found from it.
“An antiderivative of \({1/x}\) is \({\ln x}\), everywhere.”
\({\ln x}\) is undefined for \({x < 0}\). Use \({\ln\abs{x}}\), on one side of 0 at a time: \({\int_{-3}^{-1} \tfrac1x\,dx} = {\ln 1 - \ln 3} \approx {-1.0986}\), negative as it should be for a curve below the axis.
Check yourself
Recall
1. If \({F' = f}\) on an interval, what are all the antiderivatives of \(f\) there?
Show answer
\({F(x) + C}\), for any constant \(C\): two antiderivatives differ by a constant.
2. State part two of the fundamental theorem of calculus.
Show answer
If \(f\) is continuous on \({[a, b]}\) and \(F\) is any antiderivative of \(f\), then \({\int_a^b f(x)\,dx = F(b) - F(a)}\).
3. What is \({\int_0^2 x^3\,dx}\)?
Show answer
\({\big[\tfrac14 x^4\big]_0^2 = 4 - 0 = 4}\).
4. Give an antiderivative of \({\cos x}\), and one of \({1/x}\) for \({x < 0}\).
Show answer
\({\sin x}\), and \({\ln\abs{x} = \ln(-x)}\).
5. Why does the constant \(C\) not change \({F(b) - F(a)}\)?
Show answer
It appears in both terms and cancels: \({(F(b) + C) - (F(a) + C)} = {F(b) - F(a)}\).
Exercises
1.★ Find \({\int_1^4 \sqrt{x}\,dx}\).
Show solution
\({\sqrt{x} = x^{1/2}}\), so by the power rule backwards an antiderivative is \({x^{3/2}/(3/2) = \tfrac23 x^{3/2}}\). Then
2.★★ Find the function \(F\) with \({F'(x) = 3x^2 - \tfrac4x + e^x}\) for \({x > 0}\) and \({F(1) = e}\).
Show solution
From the indefinite integral above, \({F(x) = x^3 - 4\ln x + e^x + C}\) for \({x > 0}\). The starting value fixes \(C\): \({F(1) = 1 - 0 + e + C}\), and setting this equal to \(e\) gives \({C = -1}\). So \({F(x) = x^3 - 4\ln x + e^x - 1}\). Check: its slope is \({3x^2 - 4/x + e^x}\), and \({F(1) = e}\).
3.★★★ Let \({F(x) = \ln\abs{x}}\), and let \({G(x) = \ln\abs{x}}\) for \({x < 0}\) but \({G(x) = \ln\abs{x} + 1}\) for \({x > 0}\). Show that \({F' = G' = 1/x}\) at every \({x \neq 0}\), yet \({F - G}\) is not constant. Which step of the proof that antiderivatives differ by a constant fails?
Show solution
On each side of 0, \(G\) is \(F\) plus a constant (0 on the left, 1 on the right), so both have slope \({1/x}\) there, as shown for \({\ln\abs{x}}\) above. But \({F(-1) - G(-1) = 0}\) while \({F(1) - G(1) = -1}\), so \({F - G}\) is not one constant.
The failing step is Step 1. For \({p = -1}\) and \({q = 1}\), the mean value theorem needs the function to be defined, continuous and differentiable at every point between them, and 0 is missing. The domain \({x \neq 0}\) is two intervals, and on each one separately \({F - G}\) is constant.
Summary card
Any antiderivative computes an integral: \({\int_a^b f(x)\,dx = F(b) - F(a)}\).
M04.6.3-F1
Every antiderivative rises by the area.
Antiderivatives of \(f\) on an interval are \({F + C}\); zero slope means constant (mean value theorem).
Part two. For continuous \(f\), \({\int_a^b f(x)\,dx = \big[F(x)\big]_a^b}\).
Indefinite.\({\int f(x)\,dx = F(x) + C}\); a starting value fixes \(C\).
Check by differentiating, and with scipy.integrate.quad.
Sources and next steps
Sources. Each was opened and checked against this lesson on 12 November 2026.
Gilbert Strang and Edwin Herman, Calculus Volume 1 (OpenStax): Section 4.4, Theorem 4.6 (a zero derivative on an interval means a constant function) and Theorem 4.7 (equal derivatives mean a constant difference); Section 4.10, Theorem 4.14 (every antiderivative is \({F(x) + C}\)), the indefinite integral, and Table 4.13, including \({\int \tfrac1x\,dx = \ln\abs{x} + C}\); Section 5.3, Theorem 5.5, part 2, proved there by a telescoping sum and the mean value theorem.
David Jerison, MIT 18.01 Single Variable Calculus (Fall 2006): Lecture 19 notes, the first fundamental theorem \({\int_a^b f(x)\,dx = F(b) - F(a)}\) and the area 2 under one hump of \({\sin x}\); Lecture 20 notes, the proof of that theorem from the second one, by way of \({F - G}\) being constant.
Matt Boelkins, Active Calculus, Section 4.4: the theorem for any antiderivative \(F\) of a continuous \(f\), and the notation \({F(x)\big|_a^b}\).
SciPy documentation, scipy.integrate.quad (version 1.18): returns the integral and an estimate of its absolute error, using QUADPACK.