HOW we approximate one strip [xi,xi+1] of width h=xi+1−xi:
Replace f by the straight line L(x) through the endpoints (xi,f(xi)) and (xi+1,f(xi+1)). The region under L is a trapezium with parallel sides f(xi) and f(xi+1) and height h.
Derivation by summing:∫abfdx≈∑k=0n−12h(f(xk)+f(xk+1))
Write out terms: f(x0)+f(x1)+f(x1)+f(x2)+⋯+f(xn−1)+f(xn).
Every interior node x1,…,xn−1 appears in two strips → counted twice. Endpoints appear once.
Single-strip error (derive the order). On [xi,xi+1], Taylor-expand and integrate the difference. The exact result (from integrating the interpolation error of a line):
Estrip=−12h3f′′(ξi),ξi∈(xi,xi+1)
Composite error. Sum over n strips and use the mean of the f′′(ξi) values →f′′(ξ):
En=∑−12h3f′′(ξi)=−12h3nf′′(ξ)
Now n=hb−a, so nh3=(b−a)h2:
Imagine a wiggly hill and you want the area under it. You can't measure a wiggle, but you CAN measure straight slopes. So you cut the hill into thin slices and pretend each slice's top is a straight ramp. The area under a ramp is easy (a slanted box). Add all the boxes — that's your answer. If the hill curves a lot, thin slices guess wrong by a little; making slices twice as thin makes the mistake four times smaller.
Dekho, kabhi-kabhi integral ∫abf(x)dx nikalna mushkil hota hai kyunki antiderivative milta hi nahi (jaise e−x2), ya phir function sirf kuch data points pe pata hai. Toh hum area ko approximate karte hain. Trapezoidal rule ka core idea simple hai: poore interval ko n patli-patli strips mein kaato (har strip ki width h=nb−a), aur har strip ke upar curve ko seedhi line maan lo. Seedhi line ke neeche ka area ek trapezium hota hai, jiska area =2h(left height+right height).
Jab sab strips ko jodte ho, toh interior wale points dono taraf ke strips mein aate hain, isliye unka weight 2 ho jata hai, aur do endpoints ka weight 1. Yahi se formula banta hai: Tn=2h[f0+2(f1+⋯+fn−1)+fn]. Pattern yaad rakho: 1,2,2,…,2,1.
Ab error ki baat. Seedhi line curve ka curvature (mudna) ignore karti hai, isliye error f′′ pe depend karta hai: En=−12(b−a)h2f′′(ξ). Sabse important baat — error h2 ke proportional hai. Matlab agar tum strips ko double kar do (n double, h aadha), toh error chaar guna kam ho jata hai! Agar function convex hai (f′′>0, cup-jaisa upar khula), toh chord curve ke upar rahegi, toh rule thoda zyada estimate karega. Yeh intuition exam mein sign-check ke liye bahut kaam aata hai.