TITLE: Why the substitution is not working even though its bijective?
QUESTION [7 upvotes]: The following integral i was trying to evaluate:
$$\int_0^\infty \left( \sin(1/x) - \frac{\sin(\pi/x)}{\pi} \right) \,dx.$$ ,what i did was substituting pi/x = 1/t in the second integral , which converts to first integral which tells integral is zero ,but answer is ln(pi) , whats the fault that i wanted to know .

REPLY [4 votes]: Integrate by parts to get $-x\dfrac{\sin\left(\frac{{\pi}}{x}\right)}{{\pi}}+x\sin\left(\dfrac{1}{x}\right)+\operatorname{Ci}\left(\dfrac{{\pi}}{x}\right)-\operatorname{Ci}\left(\dfrac{1}{x}\right)$
$(1).$ As $x\to \infty,$ the first two terms combine to give $-1+1=0.$ As $x\to 0,$ all four terms tend to $0$. Now,
${\displaystyle \operatorname {Ci} (x)=-\int _x^\infty \frac {\cos t}{t}}dt$ so ${\displaystyle \operatorname {Ci} (\pi/x)=-\int _{\pi/x}^\infty \frac {\cos t}{t}}dt$ and $\displaystyle\operatorname {Ci} (1/x)=-\int _{1/x}^\infty \frac{ \cos t}{t}dt$
and therefore
$(2).\ \operatorname{Ci}\left(\dfrac{{\pi}}{x}\right)-\operatorname{Ci}\left(\dfrac{1}{x}\right) = \displaystyle \int _{1/x}^{\pi/x} \frac {\cos t}{t}dt=\int _{1/x}^{\pi/x}\left(\frac{1}{t}-\frac{t}{2}+O(t³)\right)dt=$
$\ln(\pi/x)-\ln(1/x)+O(1/x^2)=\ln \pi+O(1/x^2)$
To finish, let $x\to \infty$ in $(2)$ and combine the result with $(1).$