Intuition The ONE core idea
Numerical integration means finding the area under a curve by covering it with simple shapes (straight-topped or bent-topped boxes) whose areas we already know how to compute. Everything on the parent page is just bookkeeping: where to sample the curve, what shape to use, and how much each sample counts in the final sum.
Before you can read a single formula on the parent note, you must own every symbol in it. Below, each piece is built from zero : plain words first, then a picture, then why the topic needs it . Read top to bottom — each item uses only things defined above it.
f ( x )
f is a ==rule that takes in a number x and gives back a number f ( x ) ==. Think of x as a position along the ground, and f ( x ) as the height of a hill directly above that spot.
Picture. Slide left–right along the horizontal axis (that's choosing x ); the curve tells you how tall the hill is right there.
Why the topic needs it. The whole game is measuring the area under this height curve. No height machine → nothing to measure.
Definition Limits of integration
a is the left edge (where we start measuring), b is the right edge (where we stop). The square brackets [ a , b ] mean "all the x values from a to b , ends included".
Picture. Two vertical fence-posts planted at x = a and x = b . We only care about the slice of hill between the fences.
Why the topic needs it. Area is meaningless without a region. [ a , b ] is that region on the ground.
Definition Reading the integral out loud
∫ a b f ( x ) d x
Read: "the area under f , from x = a to x = b ." The stretched-S ∫ is an old-fashioned S for Sum . The d x means "a sliver of width that is infinitely thin".
Picture. Fill the region between the fences and under the curve with paint. ∫ a b f d x is the amount of paint — the shaded area.
Why the topic needs it. This is the exact answer we are chasing. Every method on the parent page is an approximation of this one quantity.
Intuition Why "S for Sum"?
Imagine chopping the shaded region into vertical strips. Each strip is (height f ( x ) ) × (tiny width d x ) = a sliver of area. Add up all the slivers → total area. The integral is that "add up infinitely many infinitely-thin slivers" idea frozen into one symbol. This is exactly the Riemann sums picture.
We cannot handle infinitely many slivers, so we chop into a finite number of chunks.
Definition Number of subintervals
n
n is ==how many equal pieces we cut [ a , b ] into==. Bigger n = thinner pieces = better approximation, more work.
x i
The cut points where pieces meet:
x i = a + i h , i = 0 , 1 , 2 , … , n .
Here i is just a counter (0 for the first, 1 for the next, …). x 0 = a sits at the left fence, x n = b at the right fence.
Picture. A ruler laid from a to b , ticked at equal spacing h . Each tick is a node x i ; the number under the tick is its index i .
Common mistake Points vs pieces — the classic off-by-one
n pieces need n + 1 ticks. (Two posts hold one fence panel; three posts hold two panels.) That is why the parent's loop over interior nodes is range(1, n) — indices 1 through n − 1 .
Why the topic needs it. h is the width factor in every area formula; the x i are the only places we ever ask f for a height.
Definition Subscript notation
x i means "the i -th node". f ( x i ) (sometimes shortened to f i ) means "the height of the curve at that node". So f 0 = f ( x 0 ) = f ( a ) and f n = f ( x n ) = f ( b ) .
Picture. At each ruler tick, draw a vertical stick up to the curve. Its length is f i . These sticks are the only numbers the methods ever plug in.
Why the topic needs it. Both rules are recipes built purely from the numbers f 0 , f 1 , … , f n — nothing else.
Definition The summation symbol
∑ i = 1 n − 1 f ( x i ) = f ( x 1 ) + f ( x 2 ) + ⋯ + f ( x n − 1 ) .
The Greek capital sigma Σ means sum . The bottom (i = 1 ) says where the counter starts; the top (n − 1 ) says where it stops; the body (f ( x i ) ) is what to add each time.
Picture. A conveyor belt: it feeds i = 1 , 2 , … , n − 1 one at a time, each time dropping f ( x i ) into a running total.
Why the topic needs it. A trapezoidal or Simpson answer is a weighted sum ∑ i w i f ( x i ) . Sigma is the compact way to write "add up all the sampled heights."
A weight w i is a multiplier saying how many times a node's height counts in the total. Interior nodes are shared by neighbouring shapes, so they count more than the lonely endpoints.
Intuition Why weights exist at all
A node sitting on the boundary between two adjacent shapes belongs to both shapes. When you add the shapes' areas, that shared height gets added twice — a weight of 2 (trapezoid) or 2 /4 (Simpson). An endpoint touches only one shape, so it counts once. The entire difference between trapezoidal and Simpson's is which weights they use .
Picture. Colour every node by how many shapes lean on it: endpoints (one shape) one colour, shared interior nodes (two shapes) another.
Why the topic needs it. Mis-weighting endpoints is the parent note's "#1 silent bug." Understanding why weights differ makes that bug impossible.
Picture. Line = ruler edge. Parabola = a single smooth valley or hill. Cubic = a gentle S.
Why the topic needs it. Trapezoid fits a line (degree 1) to each slice; Simpson fits a parabola (degree 2) to each pair. "Exact for degree-1 / degree-3" on the parent note is a statement about which curves these shapes reproduce perfectly . See Polynomial interpolation and Newton-Cotes formulas .
Definition Order of error
O ( h 2 ) means "the error is roughly proportional to h 2 ". If you halve h , an O ( h 2 ) error drops to about a quarter ; an O ( h 4 ) error drops to about a sixteenth .
Picture. Two shrinking staircases: halving h steps the O ( h 2 ) error down one small stair, but sends the O ( h 4 ) error plunging four stairs. Same effort, Simpson wins.
Why the topic needs it. It explains the parent's punchline: Simpson beats trapezoid dramatically for the same number of samples. The powers themselves come from Taylor series .
≈
≈ means "close to, but not exactly" . We write ∫ a b f d x ≈ T n because the shapes only mimic the curve; they don't reproduce it perfectly (unless the curve happens to be a low-degree polynomial).
Why the topic needs it. Honesty. Every method is an estimate; ≈ keeps that front and centre.
Function f x height machine
Weights wi shared vs edge
Polynomial degree line vs parabola
Once every box above feels obvious, the parent page — the main topic — reads as pure bookkeeping.
Test yourself: read the left side, say the answer aloud, then reveal.
What does ∫ a b f ( x ) d x mean in plain words? The exact area under the curve f between x = a and x = b .
What is h and how is it computed? The width of each subinterval; h = ( b − a ) / n .
If n is the number of subintervals, how many nodes (points) are there? n + 1 .
What does the node formula x i = a + ih give you? The position of the i -th cut point along [ a , b ] .
Read ∑ i = 1 n − 1 f ( x i ) out loud. The sum of the curve's heights at every interior node from x 1 to x n − 1 .
Why do interior nodes get a bigger weight than endpoints? They are shared by two neighbouring shapes, so their height counts in both.
What shape (degree) does trapezoid fit per slice? Simpson per pair? Trapezoid: a straight line (degree 1). Simpson: a parabola (degree 2).
If you halve h , how much does an O ( h 2 ) error shrink? An O ( h 4 ) error? To about a quarter; to about a sixteenth.
What does ≈ signal in ∫ f d x ≈ T n ? The result is an approximation, not exact, unless f is a low-degree polynomial.
Why does the interior-node loop use range(1, n) not range(1, n+1)? Indices 1 to n − 1 are the interior nodes; x n is the endpoint, handled separately.