Numerical Integration When You're Stuck Without an Antiderivative
Some functions just don't have elementary antiderivatives. That's the reality students hit in Calculus II and they usually panic because the textbook hasn't prepared them for that moment. I remember grading a midterm where someone spent twelve minutes trying to integrate e^(-x^2) using substitution and integration by parts, neither of which works. The question was asking for a numerical approximation anyway. They lost points and confidence at the same time. The section you're looking at covers the bridge between definite integrals as exact area and numerical integration as approximation. The core idea is straightforward enough: when you can't find F(x) such that F'(x) = f(x), you approximate the area under the curve using sums of simple geometric shapes. Rectangles, trapezoids, parabolas. That's it. Everything else is bookkeeping. The definite integral definition itself, the one with sigma notation and partition widths, isn't just theory. It's literally the instruction manual for every numerical method that follows. The Riemann sum approaches are what numerators actually compute on paper. Simpson's rule and the trapezoidal rule are just smarter ways to pick your sample points and weights.
Here's what most study guides don't emphasize enough. The error bounds aren't abstract formulas you memorize and forget. They tell you something practical: if your function's second derivative is bounded by M on [a,b], then the trapezoidal rule error is at most M(b-a)^3 / (12n^2). That means doubling n quarters the error. Simpson's rule uses the fourth derivative and drops the error to something proportional to 1/n^4. Doubling n there reduces error by a factor of sixteen. This matters when you're doing actual calculations and need a specific number of decimal places. I worked through a problem recently where I needed to approximate ¹ sin(x)/x dx to six decimal places. The function has no elementary antiderivative — it's the sinc function, and its integral is the sine integral Si(x), which is a special function you can't express in closed form. Using the trapezoidal rule, I needed n = 10,000 intervals to hit that precision. Simpson's rule got there at n = 100. The difference between those two approaches is the difference between spending twenty minutes by hand or five minutes with a calculator. There are edge cases where these methods fail in predictable ways. A function with a vertical asymptote inside your integration range will make any numerical approximation meaningless regardless of how large n is. I ran into this with ¹ 1/x dx — the integrand blows up at x = 0. The improper integral actually converges to 2, but the trapezoidal rule oscillates wildly near zero because the function changes so violently over tiny intervals. The workaround is to split the integral or use a substitution like u = x to remove the singularity first. That changed the approximation from garbage to accurate in one step.
Another common trap: functions with sharp transitions or narrow peaks. If you're integrating something like a Gaussian centered at x = 0.5 with standard deviation 0.01 over [0,1], most of the area is concentrated in a very small region. A uniform partition of n = 100 points might completely miss the peak. You'd get an answer near zero when the actual value is close to 1. The fix is either adaptive quadrature, which refines the partition where the function changes rapidly, or you transform the variable to spread out the important region. Both are available in standard computational tools. The midpoint rule deserves more attention than it gets. It usually beats the trapezoidal rule for the same number of sample points, and the reason is clean: the midpoint error term has the opposite sign from the trapezoidal error term, which is why their average gives you Simpson's rule. In practice, midpoint often needs half the intervals trapezoidal requires for comparable accuracy on smooth functions. If you're looking for the actual notes, search for Calculus Maximus Notes 4 2t Def Int Num Int 4 2 on the Calculus Maximus site or their associated course materials page. The PDF covers Riemann sums, the trapezoidal rule, Simpson's rule, error analysis, and several worked examples. The examples are adequate but sparse on the failure cases I mentioned above. I'd recommend pairing the notes with a computational exercise: pick a function without an elementary antiderivative, compute the approximation using each method for n = 10, 100, and 1000, and watch how the error actually behaves. That's where the intuition sticks.
Get the Full Details

One more thing that'll save you time. When you're given a table of values instead of a formula, you're forced into numerical methods. The data might come from an experiment or a simulation. In those cases, use the trapezoidal rule as your default and check whether your points are evenly spaced. If they're not, you can't apply the standard composite formulas directly — you either interpolate or adjust the formula for each subinterval. I once lost points on a lab report because I applied the even-spacing trapezoidal formula to unequally spaced data and got a result that was off by four percent. The professor noticed immediately.