$\require{\cancel}$
My original problem was:
$$I=\int_0^\infty \frac{1}{x^2+b^2}dx$$
where $b>0$
which i solved the following way
$$I=\int_0^\infty\left(\frac{1}{2ib(x-ib)}-\frac{1}{2ib(x+ib)}\right)dx=$$
$$=\frac{1}{2ib}\lim_{s\to\infty}\int_0^s\left(\frac{1}{(x-ib)}-\frac{1}{(x+ib)}\right)dx=$$
$$=\frac{1}{2ib}\lim_{s\to\infty}\left\{\left[\ln|(x-ib)|\right]_0^s-\left[\ln|(x+ib)|\right]_0^s\right\}=$$
$$=\frac{1}{2ib}\lim_{s\to\infty}\left\{\ln|\frac{s-ib}{-ib}|-\ln |\frac{s+ib}{ib}|\right\}=$$
$$=\frac{1}{2ib}\ln\lim_{s\to\infty}\left\{\dfrac{|\frac{s-ib}{-ib}|}{|\frac{s+ib}{ib}|}\right\}=$$
$$=\frac{1}{2ib}\ln\lim_{s\to\infty}\left\{|\frac{s-ib}{\color{red}{\boxed{-}}\cancel{ib}}|\cdot|\frac{\cancel{ib}}{s+ib}|\right\}=\frac{1}{2ib}\ln\underbrace{\left(\color{green}{\boxed{-}}\lim_{s\to\infty} \left|\dfrac{s-ib}{s+ib}\right|\right)}_{-1}$$
Why am i allowed to multiply out by the minus sign, but why only until inside the logarithm? If i don't multiply out with it the logarithm's argument will become $1$ so then i get a wrong answer. If I multiply out to the front my final result will be negative.
$\frac{\pi}{2b}$ is the correct solution by the way.
I use that $\log z=\log|z|+i\arg(z).$
$$\int_0^{\infty}\left(\frac{1}{x-ib}-\frac{1}{x+ib}\right)dx=$$ $$\log(x-ib)-\log(x+ib){\large|}_{x=0}^{\to \infty}=$$
$$\log{{x-ib\over x+ib}}{\large |}_{x=0}^{\to \infty}=$$
$$\log\left|{{x-ib\over x+ib}}\right| +i \arg {x-ib\over x+ib} {\large|}_{x=0}^{\to \infty}=$$ $$0-\{\log\left|{-ib\over ib}\right|+i(-\pi/2-\pi/2)\}=i\pi.$$ Thus, $I={i\pi\over 2ib}={\pi\over 2b}.$