Proof of Fundamental Theorem of Calculus using big O 
As far as I understand fundamental theorem of calculus requires that $f$ be continuous at $x$.  But I'm not sure where it was used in the above proof.  I also think is an issue with line 2 to line 3.  Can anyone explain that step?
Note this is extracted from Cambridge student made notes https://dec41.user.srcf.net/notes/IA_M/differential_equations_trim.pdf (just look at integration section)
 A: The usage of $O(h^2)$ is wrong here. Just continuity can't ensure this. On the other hand if $f$ is differentiable then we can write $f(t) =f(x) +O(h) $ and integrating this gives the desired result in question.
The proof presented in your question is thus making an extra assumption and IMHO full credit should not be provided if this comes as an answer to a question in exam. 
A: It's easier to do it rigorously, using continuity of $f$ at $x$:
Let $\epsilon>0$. There is an $\delta>0$ such that $|f(x+h)-f(x)|<\epsilon$ if $0<h<\delta$. Then, for such $h,$
$\frac{1}{h}\int^{x+h}_xf(t)dt-f(x)=\frac{1}{h}\int^{x+h}_x(f(t)-f(x))dt$ 
so 
$\left|\frac{1}{h}\int^{x+h}_x(f(t)dt-f(x))\right|\le \frac{1}{h}\int^{x+h}_x|f(t)-f(x)|dt\le \frac{1}{h}\cdot\epsilon\cdot h=\epsilon.$ 
A: In the second line $h$ tends to $0$, implying  value or height of the function is $f(x)$ very close to $f(x+h)$ now width is $dh$. So if we assume it as constant, area is $f(x)h$. Now if it is linearly increasing error is the triangle left out which is Error = $0.5 ~ h~ ( f(x+h)-f(x))$. For linear curve slope (m)= $\frac{f(x+h)-f(x)}{h}$. So  Error$=0.5 m h^2 =O(h^2)$. Now if it is not linear, higher orders with Taylors series expansion, it will have  terms with powers of $h$ larger than 2 meaning very small numbers. Hence line 3.
