Skip to content
Tutorials Center
My learning

Topics

Lesson 18 of 68 ยท Integrals

The Fundamental Theorem of Calculus

Learn both parts of the Fundamental Theorem of Calculus: antiderivatives, evaluating definite integrals, net change, sympy integrate() and checks.

You now have two big ideas that look unrelated. The derivative measures an instantaneous rate; the integral adds up tiny pieces. The Fundamental Theorem of Calculus (FTC) says they are inverse operations. It turns the long, painful limit of Riemann sums into a quick subtraction, and it is the reason calculus works as a practical tool.

Before it, finding the area under x**2 meant summing rectangles by hand. After it, you find a function whose derivative is x**2 and plug in two numbers.

Antiderivatives

An antiderivative of f is a function F with F'(x) = f(x). If F is one antiderivative, so is F + C for any constant C, because constants vanish when differentiated. The family of all antiderivatives is the indefinite integral:

integral of f(x) dx = F(x) + C

Reverse the derivative rules from Differentiation Rules to build a table:

f(x) Antiderivative
x**n (n not -1) x**(n+1)/(n+1)
1/x ln(abs(x))
e**x e**x
cos(x) sin(x)
sin(x) -cos(x)
1/(1+x**2) arctan(x)

Part 1: accumulation functions are antiderivatives

Define a function that accumulates area up to a moving endpoint:

A(x) = integral from a to x of f(t) dt

FTC, part 1 says that if f is continuous, then A'(x) = f(x). The rate at which the accumulated area grows equals the height of the curve at the edge. That makes sense: nudging x forward by a small h adds a thin sliver of area, about f(x) * h wide.

flowchart LR
    F["f(x)"] -->|"integrate"| A["A(x) = area so far"]
    A -->|"differentiate"| F

Differentiation and integration undo each other.

Part 2: evaluating definite integrals

FTC, part 2 says that if F is any antiderivative of f, then

integral from a to b of f(x) dx = F(b) - F(a)

This is the workhorse. The constant C cancels in the subtraction, so you may drop it. People write the evaluation as [F(x)] from a to b.

For example, the integral of x**2 from 0 to 3: an antiderivative is x**3/3, so the answer is 27/3 - 0 = 9, matching the Riemann sums in The Integral as Accumulated Change.

Python FTC part 2 versus Riemann sums

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Using sympy

sympy.integrate finds antiderivatives symbolically. With limits, integrate(f, (x, a, b)) evaluates the definite integral exactly. Note that sympy leaves out the + C.

Python Symbolic integration

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The last answer is pi/4, an exact result that no table of decimals would reveal.

Verify by differentiating

An antiderivative is easy to check: differentiate it and see whether you recover the integrand. This habit catches nearly every algebra slip in integration, and it needs no answer key.

Python Check an antiderivative

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A result of 0 proves the candidate right. The nonzero leftover for the wrong guess shows exactly how it fails.

Net change

Since the integral of a rate gives total change, FTC part 2 can be read as: the net change in a quantity equals the integral of its rate of change.

F(b) - F(a) = integral from a to b of F'(x) dx

If a particle has velocity v(t) = t**2 - 4*t + 3 (in m/s), its displacement over [0, 4] is the integral of v, but its distance travelled is the integral of |v|. Where the velocity is negative the particle moves backwards, so displacement subtracts that motion while distance adds it.

Python Displacement versus distance

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The particle ends 4/3 metres from where it started, yet it travelled 4 metres in total. Always check where the integrand changes sign before reading an integral as a distance.

Differentiating an integral: the Leibniz rule

Part 1 of the theorem says d/dx of (integral from a to x of f(t) dt) = f(x). Real problems have messier integrals: variable limits at both ends, or an integrand that itself contains x. The Leibniz rule (also called the Newton-Leibniz rule or differentiation under the integral sign) handles all of them.

Variable limits. If the limits are functions a(x) and b(x), then

d/dx of (integral from a(x) to b(x) of f(t) dt) = f(b(x)) * b'(x) - f(a(x)) * a'(x).

It is Part 1 plus the chain rule: each limit contributes its integrand value times how fast the limit moves, with a minus sign at the lower limit.

An integrand that depends on x. If f(x, t) depends on both variables and the limits are constants, you may differentiate inside the integral:

d/dx of (integral from a to b of f(x, t) dt) = integral from a to b of (partial f / partial x)(x, t) dt.

Both together:

d/dx of (integral from a(x) to b(x) of f(x, t) dt) = f(x, b) b' - f(x, a) a' + integral from a(x) to b(x) of (partial f / partial x) dt.

This lets you differentiate integrals that have no closed form, and it is a powerful trick for evaluating hard integrals: insert a parameter, differentiate, solve the easier problem, and integrate back.

Python Check the Leibniz rule symbolically and numerically

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The rule requires the integrand and its x-derivative to be well-behaved (continuous on the region). For improper integrals you must check that the integral of the derivative still converges, otherwise swapping d/dx and the integral is invalid.

Common slips

  • Forgetting + C in an indefinite integral. Definite integrals do not need it.
  • Mixing up the limits: F(b) - F(a), never the reverse.
  • Using FTC across a discontinuity. If f blows up inside [a, b], such as 1/x**2 on [-1, 1], the theorem does not apply directly. See Improper Integrals and Convergence.
  • Treating area as always positive. The integral is signed.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does part 1 of the FTC say about A(x), the integral of f(t) from a to x?

    The derivative of the accumulated area equals the height of the curve at the moving endpoint.
  2. 2. What is the integral of 2x from 1 to 3?

    An antiderivative is x2. Then 32 - 1**2 = 9 - 1 = 8.
  3. 3. Why can you drop the constant C when evaluating a definite integral?

    Both F(b) and F(a) contain the same C, so subtracting removes it.
  4. 4. A velocity changes sign on [0, 4]. How do you get total distance travelled?

    Displacement is the integral of v and lets backward motion cancel forward motion. Distance needs the integral of |v|.

Summary

  • An antiderivative F of f satisfies F' = f; all antiderivatives differ by a constant.
  • FTC part 1: the derivative of integral from a to x of f(t) dt is f(x).
  • FTC part 2: integral from a to b of f(x) dx = F(b) - F(a).
  • sympy.integrate finds antiderivatives and exact definite integrals; differentiate the result to verify any answer.
  • The integral of a rate is net change; use |rate| for total distance or total absolute change.

Next: Integration Techniques.