13 Apr 2026

Compute the following integral: $$ {\rm I} = \int\limits_{-0.5}^2 \frac{x \log |x|}{(1+x^2)^2} \diff x. $$

Proposed by the user "laghes" on the website dailyintegral.com.

We first need to check that the integral is indeed well-defined, for which it suffices to show that the integrand does not blow up at 0. Consider then the limit in question: $$ {\rm L} = \lim_{x\to 0} \frac{x \log |x|}{(1+x^2)^2} = \lim_{x\to 0} x\log |x| = \lim_{x\to 0} \frac{\log |x|}{1/x}, $$ since this is an indetermination of the form $\infty/\infty$, we can safely apply L'Hôpital's rule, which gives $$ {\rm L} = \lim_{x\to 0} \frac{1/x}{-1/x^2} = \lim_{x\to 0} (-x) = 0. $$
Now call the integrand $f$; the first insight comes from the fact that $f$ is an odd function, i.e. $f(-x) = -f(x)$ because: $$ f(-x) = \frac{-x \log |-x|}{(1+(-x)^2)^2} = -\frac{x \log |x|}{(1+x^2)^2} = -f(x), $$ so ${\rm I}$ may be rewritten with positive integration bounds, thus dropping the absolute value: $$ {\rm I} = \int\limits_{-0.5}^0 \frac{x \log (-x)}{(1+x^2)^2} \diff x + \int\limits_0^2 \frac{x \log x}{(1+x^2)^2} \diff x = \int\limits_{0.5}^2 \frac{x \log x}{(1+x^2)^2} \diff x. $$
The square in the denominator looks very suspicious, and motivates considering the derivative of a quotient with $1+x^2$. Notice then that $$ \frac{\diff}{\diff x}\left(\frac{g}{1+x^2}\right) = \frac{g'}{1+x^2} - \frac{2xg}{(1+x^2)^2}; $$ setting $g=\log x$, rearranging terms and using the fundamental theorem of calculus gives a simpler form for primitive of $f$: $$ \frac{\diff}{\diff x}\left(\frac{\log x}{1+x^2}\right) = \frac{1}{x(1+x^2)} - \frac{2x\log x}{(1+x^2)^2} \implies 2 \int \frac{x \log x}{(1+x^2)^2} \diff x = \int \frac{\diff x}{x(1+x^2)} - \frac{\log x}{1+x^2}, $$ and throwing partial fraction decomposition to the remaining integral does the trick: $$ \int \frac{x \log x}{(1+x^2)^2} \diff x = \frac{1}{2}\left[\int \frac{\diff x}{x} - \int \frac{x}{x^2+1}\diff x - \frac{\log x}{1+x^2}\right] = \frac{1}{2}\log x - \frac{1}{4}\log(x^2+1) - \frac{\log x}{2x^2 + 2}. $$
Finally, it only remains to put all the pieces of the puzzle together: $$ {\rm I} = \left(\frac{1}{2}\log 2 - \frac{1}{4}\log 5 - \frac{1}{10}\log 2\right) - \left(-\frac{1}{2}\log 2 - \frac{1}{4}[\log 5 - 2\log 2] + \frac{2}{5}\log 2\right) = \color{green}\boxed{0.} $$