Could anyone explain how to keep track of the error terms when solving an integral approximately? For example consider to evaluate the integral $\int_0^{\pi/2}\frac{\cos^2xdx}{x^2+\epsilon^2}$ as $\epsilon \rightarrow0$ correct to two terms I would split the range at $0\ll\delta\ll\pi/2$ and evaluate $\int_0^\delta$ and $\int_\delta^{\pi/2}$ separately.
In the small region I would rescale by $x=\epsilon u$ to get:
$${1\over \epsilon}\int_0^{\delta/\epsilon}\frac{\cos^2(\epsilon u)}{u^2+1}du={1\over \epsilon}\int_0^{\delta/\epsilon}\frac{1}{u^2+1}(1-4\epsilon^4u^2)dx={1\over \epsilon}\int_0^{\delta/\epsilon}\frac{1}{u^2+1}dx+O(what)$$
What is the order of the terms left out?
If I remember correctly O details items of order something and smaller. In your case you are neglecting terms of order $\epsilon^2$ and smaller since this is the next smallest term in the squared cosine expansion ( I want to mention I think you need to change the power on the $\epsilon$ so it matches the power of u)