My Digital Garden

JPNAS.NET / Digital Garden

🌳 EvergreenLast updated:

Integrals Without Fear

What an integral really is, explained without fear: cut the area into strips, multiply and add up. The odometer, the electricity bill and the rain gauge, how to read the scary symbol, Archimedes to Leibniz, and where engineers use them – with a car trip by hand, Archimedes' parabola and a beam in Python.

Open in the interactive Digital Garden

What You Need
Multiplication and addition – really, nothing more for the idea
To see it move: my Integral Explorer – a slider, some strips, and the answer getting closer
For Example 3: Python 3 with NumPy (pip install numpy)
Programs for calculating and plotting: my Math & Engineering Calculation resources

Jump to Examples

Mention integrals to most people and you can watch them switch off. For many, it's the moment at school where maths stopped making sense: a strange curly symbol, a list of rules to memorise, and no idea what any of it was for. I get it. But I think integrals have a bad reputation only because of how they are usually taught – rules first, meaning later, if ever.

So this note goes the other way round: meaning first. No proofs, no rules to memorise until the very end, and even there only as an "oh, that's where they come from". If you can multiply and add, you can understand an integral. You already use them every day; you just don't call them that.

You Already Integrate

  • The odometer in your car. The speedometer shows how fast you are going right now. The odometer adds up "speed × a tiny bit of time" over and over, and shows how far you have gone. That's an integral.
  • Your electricity bill. The power a house uses changes all day – a few hundred watts at night, a few kilowatts when the oven is on. The meter adds up "power × a tiny bit of time" and you pay for the kWh. An integral.
  • Rain. The weather station says 12 mm of rain fell today. It added up "how hard it was raining × time". An integral.
  • The area of a plot of land with a curved river as one border. Cut it into strips, measure each, add them up. An integral – and that is exactly how it was done long before anybody wrote the symbol.

In every case it's the same pattern: something that changes, multiplied by small pieces of something else, all added up. That's it. That's the whole idea.

The One Idea: Strips

Draw the changing thing as a curve: time along the bottom, speed up the side. If the speed were constant, the distance would be simply speed × time – the area of a rectangle. But the speed changes, so the area under the curve is not a rectangle.

So cut it into thin strips. Each strip is almost a rectangle. Its area is its width times its height – one multiplication. Add all the strips together and you have, almost exactly, the area under the curve. Cut thinner strips and the "almost" gets smaller. With infinitely many infinitely thin strips the answer is exact, and that exact answer is what mathematicians call the integral.

a b width dx f(x)
The area under the curve, cut into six strips. Each strip: width × height. Add them up – that's the integral. Thinner strips, better answer.

That's the part everybody should hear first, and it's best seen moving: open the Integral Explorer, press Play, and watch 1 strip become 100 while the sum creeps towards the exact value.

Reading the Scary Symbol

Now the symbol isn't scary any more, because every piece of it is just a word in the sentence "add up the strips":

  10
  ∫  v(t) dt
  0
PieceWhat it says
∫"add up" – it is a stretched letter S, for summa, the Latin word for sum
v(t)the height of each strip – here the speed at time t
dtthe width of each strip – a tiny piece of time
0 and 10where to start and where to stop adding – from second 0 to second 10

Read out loud: "add up speed times a tiny bit of time, from 0 to 10 seconds." Which is the distance. When you see an integral anywhere, try reading it like that – it almost always turns into a normal sentence.

And here is the trick I use most: the units. The unit of an integral is always the unit of the height times the unit of the width. Speed [m/s] × time [s] = distance [m]. Power [kW] × time [h] = energy [kWh]. Load [kN/m] × length [m] = force [kN]. Pressure [kN/m²] × area [m²] = force [kN]. If you know what is on the two axes, you know what the integral means before you calculate anything.

Who Came Up With This

The strips are much older than the symbol. Around 250 BC Archimedes found the area under a parabola by filling it with smaller and smaller triangles and showing where the sum must end up – the "method of exhaustion", invented a century earlier by Eudoxus. In 1635 the Italian Bonaventura Cavalieri described areas and volumes as made of infinitely many thin slices, and got sharply criticised for it, because nobody could say exactly what "infinitely thin" meant.

Then, almost at the same time, two people turned it into a method anybody could use. Isaac Newton worked it out in 1665–66, when Cambridge was closed because of the plague, but published very late. Gottfried Wilhelm Leibniz wrote the long S in his notes in 1675 and published from 1684. What followed was one of the ugliest fights in the history of science, about who stole from whom (most historians today say: nobody, they found it independently). Leibniz's notation won, because it is so practical – the dx really does behave like a tiny width – and we still use it.

For almost two centuries the method worked brilliantly even though nobody could say precisely why. In 1854 Bernhard Riemann finally defined the integral exactly as the limit of the sum of strips. The strips in the Explorer are called Riemann sums after him.

The Other Direction, and Where the School Rules Come From

Back to the car. The odometer is the integral of the speed: it adds speed up into distance. But you can also go the other way: if you only had the odometer, you could get the speed by looking how fast the number changes. That's a derivative – the speedometer. Integral and derivative are the same thing in two directions: adding up, and seeing how fast it changes.

This is called the fundamental theorem of calculus, and it is the reason for all the rules at school. If you can guess a function whose rate of change is your curve, you get the area without adding a single strip. For example, the rate of change of x³/3 is x², so the area under x² from 0 to 1 is 1³/3 − 0 = 1/3 – Archimedes' answer in one line. A few of these shortcuts:

CurveIts integral (the shortcut)Where you meet it
a constant cc · xconstant speed × time, uniform load × length
xx² / 2the area of a triangle; a load growing linearly
x²x³ / 3moment of a triangular load, second moment of area
xⁿxⁿ⁺¹ / (n + 1)the general rule behind the three above

That's it. This is the part school usually starts with – and without the strips, it's just magic formulas. With the strips, it's a clever shortcut for something you already understand. And when there is no shortcut (most real-world curves, measured data), we simply go back to the strips. That's what computers do.

Where Engineers Use Integrals

In structural engineering integrals are everywhere, mostly hidden inside the formulas we use:

  • Load → shear → moment → rotation → deflection. Each step is an integral of the one before. The shear force is the load added up from the support; the bending moment is the shear force added up; the deflection is the curvature added up twice. My Beam Calculator does exactly that with trapezoid strips – and the formulas in Structural Statics, like q·L²/8, are these integrals done once and for all.
  • Section properties. The area, the centroid and the second moment of area I = ∫ y² dA – add up every little piece of the section times its distance squared. That is why a tall beam is so much stiffer than a flat one (see my Section Properties tool).
  • Pressure into force. Water, soil or wind pressure on a wall, added up over its height.
  • Work and energy. Force × distance, power × time, the energy that a climbing rope absorbs in a fall.
  • The finite element method. Every element stiffness matrix in How the Finite Element Method Works is an integral over the element – done by the computer with a few cleverly chosen points.

Examples

Example 1: How Far Did the Car Go?

A car leaves a traffic light. Every 10 seconds I write down the speed (in m/s, so that the units work): 0, 8, 14, 17, 17, 11, 0. How far did it go in the minute?

Each strip is 10 s wide. For the height I take the average of the speed at both edges – a trapezoid – because the speed changes in between:

  0 – 10 s:  (0 + 8) / 2 · 10   =  40 m
 10 – 20 s:  (8 + 14) / 2 · 10  = 110 m
 20 – 30 s:  (14 + 17) / 2 · 10 = 155 m
 30 – 40 s:  (17 + 17) / 2 · 10 = 170 m
 40 – 50 s:  (17 + 11) / 2 · 10 = 140 m
 50 – 60 s:  (11 + 0) / 2 · 10  =  55 m
                          total = 670 m

That's an integral, done by hand, with real data and no formula for the curve at all. Engineers and scientists do this all the time with measurements – it's called the trapezoidal rule.

Example 2: Archimedes' Parabola, With Strips

The area under y = x² from 0 to 1. Cut it into n strips and take the height in different places:

Strips nHeight at the left edgeHeight at the right edgeHeight in the middleTrapezoid
40.218750.468750.328130.34375
100.285000.385000.332500.33500
1000.328350.338350.333330.33335
10000.332830.333830.333330.33333

All four columns walk towards 1/3 = 0.33333, Archimedes' answer. The left edge is always too small (the curve rises, so the left side of each strip is the lowest), the right edge always too big, and the true value is trapped between them. The middle and the trapezoid are much better: with only 10 strips they're already within half a percent. You can play with exactly this in the Explorer.

Example 3: A Beam, Added Up in Python

Now something with no simple formula in my head: a beam 6 m long with a load that grows from nothing to 15 kN/m – the way water or soil presses on a wall. The program cuts it into 600 strips and does exactly what we did by hand, just faster: total load, reactions, shear force, bending moment, each one an area under the previous one.

import numpy as np

# A simply supported beam, 6 m long, with a load that grows from 0 to 15 kN/m
# (like water or soil pressing on a wall) - no simple table formula needed
L, q_max = 6.0, 15.0
x = np.linspace(0, L, 601)                 # a point every centimetre
q = q_max * x / L                          # the load at every point [kN/m]

def area(y, x):
    """The area under y: cut into thin strips (trapezoids) and add them up."""
    return np.sum((y[1:] + y[:-1]) / 2 * np.diff(x))

def running_area(y, x):
    """The same, but the running total from the start to every point."""
    strips = (y[1:] + y[:-1]) / 2 * np.diff(x)
    return np.concatenate([[0.0], np.cumsum(strips)])

total = area(q, x)                         # whole load = area under q
RA = area(q * (L - x), x) / L              # moments about the right support - also an area
V = RA - running_area(q, x)                # shear = reaction minus the load so far
M = running_area(V, x)                     # moment = area under the shear force

i = np.argmax(M)
print(f"total load:       {total:.2f} kN   (triangle: 15 * 6 / 2 = 45)")
print(f"reactions:        A = {RA:.2f} kN, B = {total - RA:.2f} kN")
print(f"maximum moment:   {M[i]:.2f} kNm at x = {x[i]:.2f} m (where the shear force is 0)")
print(f"moment at B:      {abs(M[-1]):.3f} kNm (must be 0 - a check that it all adds up)")

Output:

total load:       45.00 kN   (triangle: 15 * 6 / 2 = 45)
reactions:        A = 15.00 kN, B = 30.00 kN
maximum moment:   34.64 kNm at x = 3.46 m (where the shear force is 0)
moment at B:      0.000 kNm (must be 0 - a check that it all adds up)

The textbook formula for this case is Mmax = q·L² / (9·√3) = 34.64 kNm at x = L/√3 = 3.46 m – the strips found it on their own. And the last line is my favourite check in any calculation: if the moment at the far support isn't zero, something doesn't add up – literally.

Why It Looks Scary – and a Few Tips

  • Draw it. Every integral is an area under a curve. A sketch on paper answers half the questions before you start.
  • Say it in words. "Add up ... times a tiny bit of ..., from ... to ...". If the sentence makes sense, you understand the integral.
  • Check the units. Height unit × width unit. If you expect metres and get m²/s, something is wrong.
  • Estimate first. A rectangle or a triangle around the curve gives you the right order of magnitude in ten seconds.
  • When stuck, use strips. A spreadsheet with a column of widths, a column of heights and one SUM is a perfectly respectable integral. So is Example 3.
  • The rules come last. They're shortcuts, not the idea. You can understand integrals perfectly well without remembering a single one.

A Few More Thoughts

I think it's a shame that so many people leave school believing they are "bad at maths" because of integrals, when the idea behind them is something a child can understand: cut it into pieces, measure each piece, add them up. The symbol is just a short way to write that sentence, and the rules are just shortcuts that clever people found over two thousand years, from Archimedes to Riemann.

Next time you look at the odometer, the electricity bill or the rain gauge, remember: that's an integral, and you understood it all along.

← All notes