29  Integral calculus

Accumulation

Your car’s speedometer shows 80 km/h. Two minutes later it shows 95 km/h. How far have you travelled? You cannot just multiply speed by time — the speed was changing the whole way. What you need is a way to add up all those instantaneous velocities over the interval. That is integration.

A water tank fills at a rate that varies with time — fast at first, slower as back-pressure builds. You want to know how much water is in the tank after an hour. You know the rate at each moment. You need the total.

These are the same problem. This chapter builds the tool.

29.1 What the notation is saying

The integral sign \(\int\) is an elongated S — it stands for sum. The \(dx\) at the end names the variable we are integrating with respect to. The expression

\[\int_a^b f(x)\,dx\]

reads: “the integral of \(f(x)\) with respect to \(x\), from \(a\) to \(b\).” Picture many thin rectangles, each with height \(f(x)\) and width \(\Delta x\) — we’ll shrink \(\Delta x\) to zero in the limit, so the strips get thinner and thinner until they fit exactly under the curve. The integral adds up the areas of all of them. The result is the total area between the curve \(y = f(x)\) and the \(x\)-axis, between \(x = a\) and \(x = b\).

That is the geometric picture. The computational meaning follows from Riemann sums.

29.1.1 Riemann sums

Partition the interval \([a, b]\) into \(n\) equal subintervals, each of width

\[\Delta x = \frac{b - a}{n}\]

Pick a sample point \(x_i\) in each subinterval — say the left endpoint, the right endpoint, or the midpoint. At each sample point, the rectangle has height \(f(x_i)\) and width \(\Delta x\). Sum all \(n\) rectangles:

\[\text{Area} \approx \sum_{i=1}^{n} f(x_i)\,\Delta x\]

This is a Riemann sum — you saw the idea of summing up many small terms in Volume 4, and the same question of what happens as the number of terms grows without bound applies here too. The definite integral is the limit of this sum as the rectangles get infinitely thin:

\[\int_a^b f(x)\,dx = \lim_{n \to \infty} \sum_{i=1}^{n} f(x_i)\,\Delta x\]

For well-behaved functions, this limit exists and is a single, precise number.

Interactive: Riemann sum builder. Adjust the number of rectangles and choose a sum type to see how the approximation converges to the exact value.

29.2 The Fundamental Theorem of Calculus

The Riemann sum definition is conceptually important but computationally brutal — you would need to take a limit every time you evaluate an integral. The Fundamental Theorem of Calculus (FTC) is the result that makes integration tractable. It has two parts.

29.2.1 Part 1 — Differentiation undoes integration

Define a function \(F\) by accumulating area from a fixed point \(a\):

\[F(x) = \int_a^x f(t)\,dt\]

Part 1 says: differentiate \(F\) and you get \(f\) back.

\[F'(x) = f(x)\]

In words: the rate at which accumulated area grows at \(x\) is exactly \(f(x)\). If \(f(x)\) is large and positive, area accumulates quickly; if \(f(x)\) is zero, the accumulated area is momentarily flat; if \(f(x)\) is negative, the running total is decreasing. The integral of a rate is an accumulation function, and its derivative returns the original rate.

This is the theoretical bridge between differentiation and integration. They are inverse operations — like squaring and taking a square root — but with a subtlety: integration produces a family of antiderivatives differing by a constant. We’ll see why immediately.

29.2.2 Part 2 — Evaluating definite integrals

Part 2 is the computational workhorse. If \(F\) is any antiderivative of \(f\) (meaning \(F'(x) = f(x)\)), then:

\[\int_a^b f(x)\,dx = F(b) - F(a)\]

The shorthand \(\bigl[F(x)\bigr]_a^b\) means evaluate \(F\) at the top limit, subtract \(F\) at the bottom limit:

\[\bigl[F(x)\bigr]_a^b = F(b) - F(a)\]

In words: to evaluate a definite integral, find any antiderivative of the integrand, plug in the upper and lower limits, and subtract. You never need to sum up rectangles explicitly.

A quick example. Evaluate \(\displaystyle\int_0^3 2x\,dx\).

An antiderivative of \(2x\) is \(x^2\) (because the derivative of \(x^2\) is \(2x\)). Apply Part 2:

\[\int_0^3 2x\,dx = \bigl[x^2\bigr]_0^3 = 3^2 - 0^2 = 9\]

The area under the line \(y = 2x\) between \(x = 0\) and \(x = 3\) is exactly \(9\).

29.3 Integration rules

Building antiderivatives is the reverse of differentiation. Where differentiation had rules for breaking functions apart, integration has rules for putting them back together. These five cover most of first-year calculus.

1. Power rule (reversed)

\[\int x^n\,dx = \frac{x^{n+1}}{n+1} + C \qquad (n \neq -1)\]

Check it: differentiate \(\dfrac{x^{n+1}}{n+1}\) using the power rule and you recover \(x^n\).

2. Exponential

\[\int e^x\,dx = e^x + C\]

The exponential function is its own derivative, so it is also its own antiderivative.

3. Reciprocal

\[\int \frac{1}{x}\,dx = \ln|x| + C\]

The absolute value handles negative \(x\). The derivative of \(\ln|x|\) is \(1/x\) for all \(x \neq 0\).

4. Sine

\[\int \sin(x)\,dx = -\cos(x) + C\]

Check: the derivative of \(-\cos(x)\) is \(\sin(x)\).

5. Cosine

\[\int \cos(x)\,dx = \sin(x) + C\]

Check: the derivative of \(\sin(x)\) is \(\cos(x)\).

NoteWhy the constant of integration?

Every antiderivative of a function \(f\) differs from every other by a constant. If \(F'(x) = f(x)\), then \((F(x) + 7)' = f(x)\) too. And \((F(x) - 3)' = f(x)\). They all work.

Writing \(+C\) after an indefinite integral captures the entire family of valid antiderivatives at once. The \(+C\) is not optional decoration — omitting it loses real solutions. For example, if you are solving a differential equation and need to apply an initial condition, the value of \(C\) is determined by that condition. Dropping \(C\) before you apply the condition makes the problem unsolvable.

For definite integrals the constant cancels. When you compute \(F(b) - F(a)\), the \(+C\) appears in both terms and vanishes: \((F(b) + C) - (F(a) + C) = F(b) - F(a)\). The area between two limits is uniquely defined.

29.4 Integration by substitution

Substitution is the chain rule running in reverse. Recall that the chain rule for differentiation says:

\[\frac{d}{dx}\bigl[f(g(x))\bigr] = f'(g(x)) \cdot g'(x)\]

If you see a product where one factor looks like the derivative of what is inside a function, you can reverse this process.

The method, step by step:

  1. Identify a substitution \(u = g(x)\) — usually the “inside” function.
  2. Differentiate to find \(du = g'(x)\,dx\), then solve for \(dx\).
  3. Rewrite the entire integrand in terms of \(u\) and \(du\).
  4. Integrate with respect to \(u\).
  5. Substitute back to express the answer in terms of \(x\).

Worked example: Evaluate \(\displaystyle\int 2x\cos(x^2)\,dx\).

Step 1. The inside function is \(x^2\). Let \(u = x^2\).

Step 2. Differentiate: \(\dfrac{du}{dx} = 2x\), so \(du = 2x\,dx\).

Step 3. Notice that \(2x\,dx\) appears in the integrand. Substitute:

\[\int 2x\cos(x^2)\,dx = \int \cos(u)\,du\]

Step 4. Integrate using the cosine rule:

\[\int \cos(u)\,du = \sin(u) + C\]

Step 5. Substitute back \(u = x^2\):

\[\int 2x\cos(x^2)\,dx = \sin(x^2) + C\]

Check: Differentiate \(\sin(x^2)\) using the chain rule: \(\dfrac{d}{dx}\bigl[\sin(x^2)\bigr] = \cos(x^2) \cdot 2x = 2x\cos(x^2)\). Correct.

The substitution worked because the factor \(2x\) outside the cosine was exactly the derivative of \(x^2\) inside it. When that match exists, substitution unravels the integral cleanly.

Interactive: Area under a curve with sign. Move the sliders to set the limits \(a\) and \(b\). Positive area (above the axis) is shaded blue; negative area (below the axis) is shaded red. The integral value updates live.

29.5 Worked examples

29.5.1 Example 1 — Power rule and the FTC (computing / probability)

Problem. Find the indefinite integral \(\displaystyle\int (3x^2 - 4x + 1)\,dx\), then evaluate the definite integral from \(x = 0\) to \(x = 2\).

A probability density function for a random variable on \([0, 2]\) might have this polynomial form; the definite integral would give the total probability mass over that interval.

Indefinite integral. Apply the power rule term by term:

\[\int (3x^2 - 4x + 1)\,dx = \frac{3x^3}{3} - \frac{4x^2}{2} + x + C = x^3 - 2x^2 + x + C\]

Definite integral. Apply FTC Part 2 with \(F(x) = x^3 - 2x^2 + x\):

\[\int_0^2 (3x^2 - 4x + 1)\,dx = \bigl[x^3 - 2x^2 + x\bigr]_0^2\]

Evaluate at the upper limit:

\[F(2) = 2^3 - 2(2^2) + 2 = 8 - 8 + 2 = 2\]

Evaluate at the lower limit:

\[F(0) = 0 - 0 + 0 = 0\]

The definite integral equals \(F(2) - F(0) = 2 - 0 = 2\).


29.5.2 Example 2 — FTC Part 2 (science / measurement)

Problem. A radioactive tracer is administered to a patient and its concentration in the bloodstream decays in a way modelled by \(c(x) = x^{-1/2}\) (in appropriate units, for \(x > 0\)). Compute the total exposure — the area under the concentration curve — between \(x = 1\) and \(x = 4\).

\[\int_1^4 \frac{1}{\sqrt{x}}\,dx = \int_1^4 x^{-1/2}\,dx\]

Apply the power rule with \(n = -\tfrac{1}{2}\):

\[\int x^{-1/2}\,dx = \frac{x^{-1/2 + 1}}{-1/2 + 1} = \frac{x^{1/2}}{1/2} = 2\sqrt{x} + C\]

Apply the limits:

\[\bigl[2\sqrt{x}\bigr]_1^4 = 2\sqrt{4} - 2\sqrt{1} = 2(2) - 2(1) = 4 - 2 = 2\]

Total exposure over the interval is \(2\) (in the model’s units).


29.5.3 Example 3 — Substitution (engineering / signals)

Problem. In signal processing, an engineer needs to evaluate \(\displaystyle\int x\,e^{x^2}\,dx\) as part of computing the energy in a modulated waveform.

Let \(u = x^2\), so \(du = 2x\,dx\), which gives \(x\,dx = \dfrac{du}{2}\).

\[\int x\,e^{x^2}\,dx = \int e^u \cdot \frac{du}{2} = \frac{1}{2}\int e^u\,du = \frac{1}{2}e^u + C\]

Substitute back \(u = x^2\):

\[\int x\,e^{x^2}\,dx = \frac{1}{2}e^{x^2} + C\]

Check: Differentiate \(\tfrac{1}{2}e^{x^2}\) with the chain rule: \(\dfrac{d}{dx}\bigl[\tfrac{1}{2}e^{x^2}\bigr] = \tfrac{1}{2} \cdot e^{x^2} \cdot 2x = x\,e^{x^2}\). Correct.


29.5.4 Example 3b — Area between two curves

Problem. Find the area enclosed between \(f(x) = x + 3\) and \(g(x) = x^2 + 1\).

Step 1 — Find intersections:

\[x + 3 = x^2 + 1 \implies x^2 - x - 2 = 0 \implies (x-2)(x+1) = 0\]

Intersections at \(x = -1\) and \(x = 2\).

Step 2 — Identify which is on top: At \(x = 0\), \(f(0) = 3\) and \(g(0) = 1\), so \(f > g\) on \([-1, 2]\).

Step 3 — Integrate:

\[\int_{-1}^{2} \bigl[(x+3) - (x^2+1)\bigr]\,dx = \int_{-1}^{2} (2 + x - x^2)\,dx\]

\[= \left[2x + \frac{x^2}{2} - \frac{x^3}{3}\right]_{-1}^{2}\]

\[= \left(4 + 2 - \frac{8}{3}\right) - \left(-2 + \frac{1}{2} + \frac{1}{3}\right)\]

\[= \frac{10}{3} - \left(-\frac{7}{6}\right) = \frac{20}{6} + \frac{7}{6} = \frac{27}{6} = \frac{9}{2}\]

The enclosed area is \(\dfrac{9}{2}\).


29.5.5 Example 4 — Area between two curves (business / economic surplus)

Problem. In a competitive market, the demand curve is \(p_D(q) = 8 - q^2\) and the supply curve is \(p_S(q) = 2q\). Find the consumer surplus — the area between the demand curve and the equilibrium price, from zero to the equilibrium quantity.

Step 1. Find the equilibrium. Set \(p_D = p_S\):

\[8 - q^2 = 2q \implies q^2 + 2q - 8 = 0 \implies (q+4)(q-2) = 0\]

Equilibrium is at \(q^* = 2\) (taking the positive root), equilibrium price \(p^* = 4\).

Step 2. Consumer surplus is the area between the demand curve and the equilibrium price from \(q = 0\) to \(q = 2\):

\[\text{CS} = \int_0^2 \bigl[(8 - q^2) - 4\bigr]\,dq = \int_0^2 (4 - q^2)\,dq\]

Step 3. Evaluate:

\[\int_0^2 (4 - q^2)\,dq = \bigl[4q - \tfrac{q^3}{3}\bigr]_0^2 = \left(8 - \frac{8}{3}\right) - 0 = \frac{16}{3} \approx 5.33\]

Consumer surplus is \(\tfrac{16}{3}\) (in the model’s currency units per unit quantity). This is the aggregate benefit consumers receive by paying the equilibrium price rather than their maximum willingness to pay.

29.6 Where this goes

Multivariable calculus (Vol 7). A single integral accumulates a function over an interval — a one-dimensional slice. In two and three dimensions you can integrate over areas, volumes, and surfaces — the same idea of accumulation, applied to more variables. Those tools (Vol 7) are the language of electromagnetism, fluid dynamics, and heat flow.

Ordinary differential equations (Vol 7). A differential equation relates a function to its own derivatives. The simplest case — separable equations — is solved by moving all the \(y\)-terms to one side and all the \(x\)-terms to the other, then integrating both sides. Every technique in this chapter applies directly. The ability to integrate is the ability to solve differential equations.

29.7 Applications

  • Distance from velocity (physics). Integrate \(v(t)\) over a time interval to recover displacement. If \(v(t) = 9.8t\) (free fall from rest), then \(\int_0^T 9.8t\,dt = 4.9T^2\) — the familiar kinematic formula, derived by integration.

  • Work by a variable force (mechanics). Work is \(W = \int_a^b F(x)\,dx\) when force \(F\) varies with position \(x\). Compressing a spring, pumping water from a tank — both are definite integrals.

  • Consumer and producer surplus (economics). The area between a demand (or supply) curve and the equilibrium price is a definite integral. It measures welfare.

  • Probability from a density function (statistics). If \(f(x)\) is a probability density function, then \(P(a \leq X \leq b) = \int_a^b f(x)\,dx\). The cumulative distribution function is \(F(x) = \int_{-\infty}^x f(t)\,dt\) — literally the FTC in action.

  • Average value of a function. The average value of \(f\) over \([a,b]\) is \(\dfrac{1}{b-a}\int_a^b f(x)\,dx\) — the integral normalised by the length of the interval.


29.8 Exercises

Exercise 1. Find the indefinite integral:

\[\int \left(5x^4 - 3x^2 + 2\right)dx\]

Include the constant of integration in your answer.


Exercise 2. Evaluate the definite integral using the Fundamental Theorem of Calculus Part 2:

\[\int_1^9 \frac{3}{\sqrt{x}}\,dx\]


Exercise 3. Use \(u\)-substitution to evaluate:

\[\int 3x^2\sin(x^3)\,dx\]


Exercise 4. Find the area under the curve \(f(x) = x^2 + 2x\) between \(x = 0\) and \(x = 3\). Sketch the region (or describe it in words) before computing.


Exercise 5. Find the area enclosed between \(f(x) = 4 - x^2\) and \(g(x) = x + 2\).

Hint: find the intersection points first. The area between two curves is \(\int_a^b \bigl[f(x) - g(x)\bigr]dx\) when \(f(x) \geq g(x)\) on \([a, b]\).


Exercise 6 — Accumulation in context. A solar panel generates electricity at a rate of \(P(t) = 4\sin\!\left(\dfrac{\pi t}{12}\right)\) kilowatts, where \(t\) is hours after sunrise (\(0 \leq t \leq 12\)).

  1. Find the total energy (in kilowatt-hours) generated over the full 12-hour day: \(\displaystyle\int_0^{12} P(t)\,dt\).

  2. Interpret the result: what does the definite integral represent physically?

(Your answer will be in terms of \(\pi\) — that is expected.)