I'm very much a beginner at using this integration technique and this is my first attempt at tackling an integral blindly and choosing this method so I'm not even sure if it can be solved this way. But my attempt came sort of close to the actual answer so I'm interested to see what went wrong and if my choice of the variable $b$ can even lead to a correct answer. This is problem $555$ from Putnam and Beyond (in the text a different approach was used).
$$I=\int_{0}^{\infty} \frac{\ln x}{x^2 + a^2}\mathrm{d}x$$
Let $$I(b)=\int_{0}^{\infty} \frac{\ln (bx)}{x^2 + a^2}\mathrm{d}x$$ Note: I wasn't that big a fan of the placement of this variable so I'd be intertesed to see other placements.
\begin{align} I'(b)&=\int_{0}^{\infty} \frac{\partial}{\partial b}\frac{\ln (bx)}{x^2 + a^2}\mathrm{d}x \\ I'(b)&=\frac{1}{b}\int_{0}^{\infty} \frac{1}{x^2+a^2}\mathrm{d}x \\ I'(b)&=\frac{1}{ab}\left[\arctan\left(\frac{x}{a}\right)\right]^{\infty}_{0} \\ I'(b)&=\begin{cases}\frac{1}{ab}\left(\frac{\pi}{2}-0\right) &,a>0 \\\frac{1}{ab}\left(-\frac{\pi}{2}-0\right) &,a<0 \end{cases} \\ I(b)&=\begin{cases}\frac{\pi}{2a}\ln b+C_1 &,a>0 \\ -\frac{\pi}{2a}\ln b+C_2 &,a<0 \end{cases} \end{align} Also $\displaystyle I(1/x)=\int_{0}^{\infty} \frac{\ln (1)}{x^2+a^2}\mathrm{d}x=0 $, so $\displaystyle I(1/x)= \begin{cases}\frac{\pi}{2a}(-\ln x)+C_1 &,a>0 \\ \frac{\pi}{2a}(\ln x)+C_2 &,a<0\end{cases} \Leftrightarrow \begin{cases}C_1=\frac{\pi}{2a}\ln x &,a>0 \\ C_2=-\frac{\pi}{2a}\ln x &,a<0 \end{cases}$ and for $x=1\Rightarrow C_{1,2}=0$
$$I(b)=\pm\frac{\pi}{2a}\ln b$$
But $$I=I(1)=0$$ Which is wrong. But the correct answer felt familiar when I saw it; $\displaystyle I=\frac{\pi \ln a}{2a}$ so what went wrong here?