My Digital Garden

JPNAS.NET / Digital Garden

🌳 EvergreenLast updated:

Integrals Without Fear

What an integral really is and what it is for in practice: cut the area into strips, multiply and add up. How much in total, what is the average, where is the middle – with the electricity bill, a rainwater tank, earthworks, a plot of land, water pressure on a pool wall and heating, plus Archimedes, Leibniz 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 9: 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.

What Are Integrals For?

In practice, an integral answers one of three kinds of questions – always about something that changes along the way:

The questionWhat the integral doesEveryday examples
How much altogether?adds up a rate that changesenergy from power, distance from speed, rain from rain intensity, volume from cross-sections, force from pressure
What is the average?the total divided by the lengthaverage temperature of a day, average speed of a trip, average load on a floor
Where is the middle?finds the point where everything balanceswhere water pressure pushes on a wall, the centre of gravity of a beam or a boat, the centroid of a cross-section

If the thing doesn't change, you don't need an integral – a single multiplication does it. 100 km/h for 2 hours is 200 km, 2 kW for 5 hours is 10 kWh. The integral is simply what you do when the speed, the power or the pressure keeps changing, so that no single number is right to multiply with. And that is almost always the case in real life.

A simple test I use: if the question says "how much in total" and the thing you know is a rate (per hour, per metre, per square metre), and that rate changes, it's an integral. The examples below are all of that kind, and each one follows the same pattern: the question, why plain multiplication gives the wrong answer, and how the strips solve it.

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. Take the power of a heat pump during one day: the hours along the bottom, the power up the side. If the power were constant, the energy would simply be power × time – the area of a rectangle. But the power goes up and down, 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)
A value that goes up and down – like power during a day or rain during a storm – and the area under it, cut into eight 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":

  b
  ∫  f(x) dx
  a
PieceWhat it says
∫"add up" – it is a stretched letter S, for summa, the Latin word for sum
f(x)the height of each strip – the value of the curve at that point
dxthe width of each strip – a tiny piece along the bottom
a and bwhere to start and where to stop adding

These are exactly the pieces of the picture above: the curve, the strip width and the two ends. Now a real case – the heat pump from Example 2, with the power P at time t, through one day:

  24 h
  ∫   P(t) dt
  0

Read out loud: "add up power times a tiny bit of time, from midnight to midnight." Which is the energy the heat pump used that day – 34.4 kWh, as Example 2 shows. 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 of a slice of a parabola – exactly 4/3 of a triangle drawn inside it – 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's odometer. It 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 From Practice

Each example starts with a real question. The numbers are invented but realistic, and every result was calculated twice – by hand with the strips, and in Python. You can repeat all of them with a calculator or a spreadsheet: one column for the readings, one for the strips, and a sum at the bottom.

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 measured values 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: What Did the Heat Pump Use Today?

The question. A smart plug or the heat pump's app shows the power every two hours on a cold winter day: 1.8, 2.0, 2.2, 1.9, 1.2, 0.6, 0.4, 0.5, 0.9, 1.6, 2.1, 2.0 and 1.8 kW (at midnight, 2:00, 4:00 … and midnight again). How many kWh did it use, and what did that cost?

Why not just multiply? Power × time works only when the power is constant. Take the highest reading, 2.2 kW × 24 h = 52.8 kWh, and you're about 50 % too high; take a random reading and you can be anywhere.

How. Each two-hour strip: the average of the readings at both ends × 2 h. For the first strip (1.8 + 2.0) / 2 × 2 = 3.8 kWh, then 4.2, 4.1, 3.1 and so on. Twelve strips added up:

energy = 34.4 kWh        at 0.20 € per kWh (use your own price) = 6.88 € for the day

That's exactly what the electricity meter does, only with a reading every fraction of a second. The same method gives you the energy of a solar panel from its power curve, or how much charge a phone used from the current: mA × h = mAh.

Example 3: How Big Should the Rainwater Tank Be?

The question. I want to collect rainwater from a roof with 120 m² of plan area. A typical summer storm, measured by my weather station every 10 minutes, has a rain intensity of 0, 6, 24, 48, 30, 12 and 0 mm/h. How much water comes off the roof in one such storm – and how much must the gutter carry at the worst moment?

Why not just multiply? The intensity changes all the time; at the peak it rains more than twice as hard as the average for the hour (48 against 20 mm/h). And the two questions need two different numbers: the tank needs the total, the gutter needs the peak.

How. Rain depth = the area under the intensity curve. Strips of 10 minutes = 1/6 of an hour, trapezoids:

rain depth   = (0+6)/2·⅙ + (6+24)/2·⅙ + (24+48)/2·⅙ + (48+30)/2·⅙ + (30+12)/2·⅙ + (12+0)/2·⅙
             = 20 mm
1 mm of rain on 1 m² = 1 litre
water        = 20 mm × 120 m² × 0.9 (part that really runs off) = 2 160 litres

peak flow    = 48 mm/h × 120 m² × 0.9 = 5 184 l/h = 1.44 l/s   → this is what the gutter must carry

So a 2 000–3 000 litre tank catches a whole storm like this. The integral gives the volume; the peak value gives the size of the pipe. Mixing them up is a classic mistake – a gutter sized for the average rain overflows in every real storm.

Example 4: How Much Soil Do We Dig Out?

The question. A new access road cuts through a small hill. The surveyor gives me the area of the cut in cross-sections every 20 m: 0, 12.5, 18.0, 22.4, 15.6, 8.2 and 0 m². How many cubic metres of soil is that, and how many truckloads?

Why not just multiply? Volume = area × length works for a box. Here the hill is lower at both ends and highest in the middle – every cross-section is different.

How. This time the strips are slices of the hill, 20 m thick. The volume of each slice is the average of its two end areas × 20 m – surveyors call it the average end area method, and it's the trapezoidal rule again:

volume = 20 × [ (0+12.5)/2 + (12.5+18.0)/2 + (18.0+22.4)/2 + (22.4+15.6)/2 + (15.6+8.2)/2 + (8.2+0)/2 ]
       = 1 534 m³ of soil in the ground

dug soil takes about 25 % more space (it loosens):  1 534 × 1.25 ≈ 1 920 m³
trucks of 10 m³:  about 192 loads

A more precise method (Simpson's rule, which fits parabolas instead of straight lines through the points) gives 1 597 m³ – about 4 % more. That difference is the honest uncertainty of measuring every 20 m. If the money depends on it, measure more cross-sections.

Example 5: The Area of a Plot With a Curved Border

The question. A plot is 60 m along a straight road; on the other side the border is a stream that wanders. From the road I measure the distance to the stream every 10 m: 18, 22, 25, 24, 20, 16 and 15 m. How big is the plot?

Why not just multiply? The width changes. 60 m × the biggest width (25 m) gives 1 500 m², 60 m × the average of the two end widths gives only 990 m². Both are wrong – by about 20 %, in opposite directions.

How. Strips of 10 m from the road to the stream, trapezoids again:

area = 10 × [ (18+22)/2 + (22+25)/2 + (25+24)/2 + (24+20)/2 + (20+16)/2 + (16+15)/2 ]
     = 1 235 m²          (Simpson's rule: 1 237 m²)

This is how land was measured for centuries, long before GPS – with a chain, a straight line and offsets every few metres. Surveyors still use it, and so do CAD programs, only with thousands of points.

Example 6: How Hard Does the Water Push on the Pool Wall – and Where?

The question. A garden pool, 1.5 m of water. What is the total force on one metre of wall, and where does it act? The second question matters as much as the first: it decides the bending moment at the bottom of the wall, and that decides the reinforcement.

Why not just multiply? Water pressure grows with depth: zero at the surface, 9.81 kN/m³ × 1.5 m = 14.7 kN/m² at the bottom. Multiply the bottom pressure by the height and you get double the force. And the force doesn't act in the middle of the wall, because the lower part pushes harder.

How. Cut the wall into thin horizontal strips. Each strip at depth y below the surface: pressure 9.81 · y × its height dy. Add them up for the force; add up "force of the strip × its distance from the bottom" for the moment, and divide to get the point where the total force acts:

force    F = ∫ 9.81 · y dy  from 0 to 1.5 m  = 9.81 × 1.5² / 2 = 11.0 kN per metre of wall
moment   M = ∫ 9.81 · y · (1.5 − y) dy       = 5.5 kNm per metre, at the bottom of the wall
position   = M / F = 0.5 m above the bottom  = one third of the water depth

wrong ways:  14.7 kN/m² × 1.5 m = 22.1 kN      (twice too much)
             11.0 kN at mid-height → 8.3 kNm  (50 % too much)

The "one third of the height" is a rule every engineer knows by heart for water and soil pressure – and it comes straight from this integral. The same idea, "where does it balance", gives the centre of gravity of a boat, a crane or a cross-section.

Example 7: How Cold Was It, on Average – and What Does That Cost in Heating?

The question. My weather station measures the outside temperature every three hours: −4, −5, −6, −1, 4, 6, 2, −2 and −4 °C (from midnight to midnight). What was the average temperature, and roughly how much heat did the house need to stay at 20 °C?

Why not just multiply? There is nothing to multiply until we know the average – and the average of a changing value is itself an integral: the area under the curve divided by the length of time. The quick shortcuts are wrong: (highest + lowest) / 2 = 0.0 °C, and even the plain average of the nine readings, −1.1 °C, counts midnight twice.

How. Area under the temperature curve with 3-hour trapezoids, divided by 24 hours. Then the heat: a house loses heat in proportion to the difference between inside and outside. For a reasonably insulated house that is about 200 W for every degree of difference (the heat loss coefficient – an energy certificate or a heat-loss calculation gives yours).

average temperature = (area under the curve) / 24 h = −18 °C·h / 24 h = −0.75 °C
heat needed         = 200 W/K × (20 − (−0.75)) K × 24 h = 99.6 kWh of heat
with a heat pump (it gives about 3 kWh of heat per 1 kWh of electricity): ≈ 33 kWh

Which agrees nicely with Example 2, where the same heat pump on a cold day used 34.4 kWh. Engineers add up these daily differences over the whole heating season and call the result heating degree-days – the number that tells how cold a place is for heating, and the first step of every heating calculation.

Example 8: Archimedes' Parabola – How Good Are the 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 9: 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 9.
  • 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