I want to find the main term of the asymptotic expansion for $x\to 0^+$ for
$$f(x)=\int_0^{\pi/2} \dfrac{\cos t}{t+x}dt.$$
Now, clearly, the problem is at $t=0$ and the cosine is almost $1$ there, so I can replace the cosine with $1$ and I can find my result.
However, to justify this approach, my only tool is to use the estimation of the cosine between $1-\dfrac{t^2}2$ and $1$ in this interval for the difference between $f(x)$ and the expression where the cosine is replaced with $1$ which is ok, but not very pretty.
What is the cleanest argument that goes from the start of the expansion of the cosine to the start of the expansion of the function $f$ without using any irrelevant calculatory details?
(I would be as happy with a link to a similar problem or an appropriate theorem or a rough sketch as with a complete solution.)
Note that $$\eqalign{f(x)&=\int_0^{\pi/2}\frac{1}{t+x} dt-\int_0^{\pi/2}\frac{1-\cos t }{t+x}dt\cr &=\ln\left(\frac{\pi}{2}+x\right)-\ln x- \int_0^{\pi/2}\frac{1-\cos t }{t}dt+ \int_0^{\pi/2}\left(\frac{1}{t}-\frac{1}{t+x}\right)(1-\cos t )dt\cr &=\ln\left(\frac{\pi}{2}+x\right)-\ln x- \int_0^{\pi/2}\frac{1-\cos t }{t}dt+x \int_0^{\pi/2}\frac{1-\cos t}{t(t+x)}dt }$$ Clearly, for the last integral we have $$ 0\leq \int_0^{\pi/2}\frac{1-\cos t}{t(t+x)}dt\leq \int_0^{\pi/2}\frac{1-\cos t}{t^2}dt. $$ Also, $\ln(\frac{\pi}{2}+x)=\ln\frac{\pi}{2}+{\cal O}(x)$, combining these we conclude that, as $x\to0^+$ we have $$ f(x)=C-\ln x+{\cal O}(x) $$ where, $$C=\ln\left(\frac{\pi}{2}\right)-\int_0^{\pi/2}\frac{1-\cos t}{t}\,dt=-\gamma+\hbox{Ci}\left(\frac{\pi}{2}\right).$$ where $\gamma$ is Euler's constant and $\hbox{Ci}$ is the CosIntegral function. $\qquad\square$