# Evaulate $\int_{-\infty}^{\infty} \frac{\ln(x^2+1)}{x^4+x^2+1}dx$

I'm really stuck on this integral. I want to believe there is a closed form for it but I'm really unable to find it. WFA cannot find one either. I think it may be possible to use Feynman's Trick and reduce it to something easier but I can't find a good parameterisation that gives something workable. So far, I have factored the denominator to be $$(x^2+x-1)(x^2+x+1)$$ and have tried to parametrise like

$$I(a) = \displaystyle \int_{-\infty}^{\infty} \frac{\ln(a(x^2+1))}{(x^2+x-1)(x^2+x+1)}dx$$

Which looks promising but after differentiating and integrating (via symbolic math software) I get $$I'(a)=\frac{\pi}{\sqrt{3}a}$$ and I can't do anything to retrieve $$I(1)$$ since $$I(0)$$ is not defined. Performing partial fraction decomposition gives

$$\int_{-\infty}^{\infty} \frac{x\ln(x^2+1)+\ln(x^2+1)}{2(x^2+x+1)} - \int_{-\infty}^{\infty} \frac{x\ln(x^2+1)-\ln(x^2+1)}{2(x^2-x+1)}$$

I am unsure where to go from there. Can anyone give me a hint at the paramterisation if that even is the right approach or if a closed form for this integral even exists? WFA says the decimal expansion is 0.743763...

• Using contour integration and the Residue Theorem should be a good choice here. If you'd be content with such a solution, I can write one up. It looks like the exact form is $-\frac{\pi^2}{6} + \frac{\pi}{\sqrt{3}} \log(2 + \sqrt 3)$. Commented Apr 30, 2023 at 0:17
• I was really hoping I could avoid contour integration but it appears I am out of options so, yes, I’ll be happy with that Commented Apr 30, 2023 at 0:20
• A better way to apply Feynmans trick could be ${I(a) = \int_{-\infty}^{\infty}\frac{\log((ax)^2+1)}{x^4+x^2+1}dx}$. This will satisfy ${I(0) = 0}$ Commented Apr 30, 2023 at 0:21
• The integral that results from differentiating that is almost completely unworkable Commented Apr 30, 2023 at 0:39
• You don't have the correct factorization of the denominator. Commented Apr 30, 2023 at 2:44

$$I=\int_{-\infty}^{\infty} \frac{\log(x^2+1)}{x^4+x^2+1}\,dx=2\int_{0}^{\infty} \frac{\log(x^2+1)}{x^4+x^2+1}\,dx$$ $$J(a)=\int_{0}^{\infty} \frac{\log(ax^2+1)}{x^4+x^2+1}\,dx$$ $$J'(a)=\int_{0}^{\infty}\frac{x^2}{\left(x^4+x^2+1\right) \left(a x^2+1\right)}$$ Use the roots of unity and write (shorter) $$\frac{x^2}{\left(x^4+x^2+1\right) \left(a x^2+1\right)}=\frac{x^2}{(x^2-r)(x^2-s) \left(a x^2+1\right)}=$$ $$-\frac{a}{(a r+1) (a s+1) \left(a x^2+1\right)}+\frac{r}{(a r+1) (r-s) \left(x^2-r\right)}-\frac{s}{(a s+1) (r-s) \left(x^2-s\right)}$$ Simple integrals; using the bounds $$J'(a)=\frac {\pi \sqrt 3} 6\,\, \frac{a-\sqrt{3a} +1}{a^2-a+1}$$ $$\int_0^1 \frac{a-\sqrt{3a} +1}{a^2-a+1}\,da=2\int_0^1 \frac {db}{ b^2+b\,\sqrt{3}+1}=\log \left(2+\sqrt{3}\right)-\frac{\pi }{2 \sqrt{3}}$$ Recombining $$I=\frac{\pi }{\sqrt{3}}\log \left(2+\sqrt{3}\right)-\frac{\pi ^2}{6}$$

• This is the best solution IMO, using completely real methods. Commented Sep 10, 2023 at 16:52

Following Riemann'sPointyNose's suggestion, take $$I(a) := \int_{-\infty}^\infty \frac{\log((a x)^2 + 1)}{x^4 + x^2 + 1} dx,$$ so that the desired integral is $$I(1)$$. Then, $$I(0) = 0$$, and differentiating with respect to $$a$$ gives $$I'(a) = 2 a \int_{-\infty}^\infty \frac{x^2 \,dx}{(a^2 x^2 + 1) (x^4 + x^2 + 1)} ,$$ which is rational. One could decompose the integrand using partial fractions and integrate term-by-term. This computation is straightforward but tedious; it can at least be simplified some by exploiting the evenness of the integrand to reduce to a determination of $$3$$ coefficients instead of $$6$$.

Instead, we'll set up and evaluate an appropriate contour integral and apply the Residue Theorem. Denote $$g(z) := \frac{2a z^2 \,dz}{(a^2 z^2 + 1) (z^4 + z^2 + 1)}$$ and denote by $$\Gamma_R$$ the contour in the diagram, where $$R > \operatorname{max}\left(1, \frac{1}{a}\right)$$, and $$\textrm{I}$$ and $$\textrm{II}$$ the indicated arcs.

First, $$\lim_{R \to \infty} \int_\textrm{I} g(z) \,dz = 2 a \int_{-\infty}^\infty \frac{x^2 \,dx}{(a^2 x^2 + 1) (x^4 + x^2 + 1)} = I'(a) .$$ Comparing the degrees of the numerator and denominator $$g(z)$$ gives that $$\int_\textrm{II} g(z) \,dz \in O(R^{-3})$$; in particular $$\lim_{R \to \infty} \int_\textrm{II} g(z) \,dz = 0 ,$$ so $$I'(a) = \oint_{\Gamma_R} g(z) \,dz .$$ We evaluate the integral with the Residue Theorem. The poles of $$g(z)$$ inside the contour are at $$\frac{i}{a}, e^{\pi i / 3}, e^{2 \pi i / 3}$$, and all are simple; the residues of $$g$$ there are: \begin{align*} \operatorname{Res}\left(g(z); \frac{i}{a}\right) &= \frac{i a^2}{a^4 - a^2 + 1} \\ \operatorname{Res}\left(g(z); e^{\pi i / 3}\right) &= \frac{a}{2(a^4 - a^2 + 1)} \left(-(a^2 - 1) - \frac{1}{\sqrt{3}} (a^2 + 1) i \right)\\ \operatorname{Res}\left(g(z); e^{2 \pi i / 3}\right) &= \frac{a}{2(a^4 - a^2 + 1)} \left(\phantom{-}(a^2 - 1) - \frac{1}{\sqrt{3}} (a^2 + 1) i \right) \end{align*} So, taking the limit as $$R \to \infty$$ gives $$I'(a) = \oint_{\Gamma_R} g(z) \,dz = 2 \pi i \sum \operatorname{Res}(g(z), z_i) = \frac{2 \pi}{\sqrt{3}} \frac{a}{a^2 + \sqrt{3} a + 1} .$$

Thus, the original integral is \begin{align*} I(1) &= I(0) + \int_0^1 I'(a) \,da\\ &= \frac{2 \pi}{\sqrt{3}} \int_0^1 \frac{a \,da}{a^2 + \sqrt{3} a + 1} \\ &= \left.\frac{\pi}{\sqrt{3}} \log (a^2 + a \sqrt{3} + 1) - 2 \pi \arctan (2 a + \sqrt{3})\right\vert_0^1 \\ &= \boxed{\frac{\pi}{\sqrt{3}} \log(2 + \sqrt{3}) - \frac{\pi^2}{6}} , \end{align*} which agrees with the numerical computation in the question statement. In the last line we used that $$\tan \frac{5 \pi}{12} = 2 + \sqrt{3}$$, which can be derived, e.g., from the angle sum formula for $$\tan$$.

• Could you explain how you got $I'(a)$ more? When I tried to do it using Maxima I got a massive expression. Only when asking Maxima to simplify it do I get the expression you obtained. Did you manage to skip this or is it just grueling computation? Commented Apr 30, 2023 at 1:32
• Computing the antiderivative is tedious though straightforward. We can avoid that computation altogether if we're willing to evaluate a contour integral, as it's a straightforward application of the Residue Theorem: The only poles in the upper half-plane are at $e^{\pi i / 3}, e^{2 \pi i / 3}, \frac{i}{a}$. Since the integrand is rational, you don't have to worry about branch cuts like you would if using the Residue Theorem to evaluate the original integral. Commented Apr 30, 2023 at 1:43
• If it would be useful to you, I can add to my answer the contour integration to evaluate the integral for $I'(a)$. Commented Apr 30, 2023 at 1:47
• Yes, I’ll probably end up accepting that answer since it’s most likely more straightforward and simple than Feynman’s Trick Commented Apr 30, 2023 at 1:56
• I meant, modifying this answer to include the contour integration to evaluate $I'(a) = 2 a \int_{-\infty}^\infty \frac{x^2 \,dx}{(a^2 x^2 + 1) (x^4 + x^2 + 1)}$, which is definitely easier than using a contour integration for the original integrand, but I could write up the latter, too. Commented Apr 30, 2023 at 2:18

Here's a somewhat overkill method.

Let $$I$$ be the original integral. Note that $$\displaystyle I=2\int_{0}^{\infty}\frac{\ln\left(1+x^{2}\right)}{1+x^{2}+x^{4}}dx$$. Define $$f(z) = \displaystyle \frac{\log\left(1+z^{2}\right)}{1+z^{2}+z^{4}}$$ where the principal log's argument is defined as $$\Im\log{\left(1+z^2\right)} \in (-\pi,\pi]$$. Let $$C = [0,R] \cup \Gamma \cup [iR,i+ir] \cup \gamma \cup [i-ir,0]$$, for sufficiently large $$R$$ and sufficiently small $$r > 0$$, and traverse it counterclockwise. A visual is provided below.

From the picture above, let each simple pole be $$\displaystyle z_{1}=\frac{1}{2}+\frac{i\sqrt{3}}{2}$$, $$\displaystyle z_{2}=-\frac{1}{2}+\frac{i\sqrt{3}}{2}$$, $$\displaystyle z_{3}=-\frac{1}{2}-\frac{i\sqrt{3}}{2}$$, and $$\displaystyle z_{4}=\frac{1}{2}-\frac{i\sqrt{3}}{2}$$. By Cauchy's Residue Theorem, we can write $$\displaystyle \oint_C f(z)dz$$ as

\begin{align} 2\pi i \operatorname{Res}(f(z), z = z_1) =& \text{ } \left(\int_{0}^{R}+\int_{\Gamma}^{ }+\int_{iR}^{i+ir}+\int_{\gamma}^{ }+\int_{i-ir}^{0}\right)f(z)dz \\ \implies \int_0^R f(z)dz =& \text{ } \Re\operatorname{PV}\int_0^{iR}f(z)dz - \Re\int_{\Gamma}f(z)dz - \Re\int_{\gamma}f(z)dz + \Re 2\pi i \operatorname{Res}(f(z), z = z_1) \\ \implies I =& \text{ } 2\lim_{R \to \infty} \Re \operatorname{PV} \int_0^{iR}f(z)dz - 2\lim_{R \to \infty} \Re \int_{\Gamma} f(z)dz - 2\Re\lim_{r \to 0^+}\int_{\gamma} f(z)dz \\ &+ \Re 4\pi i \operatorname{Res}(f(z), z = z_1). \end{align} From left to right, let each expression be $$I_1$$, $$I_2$$, $$I_3$$, and $$I_4$$, respectively.

To prove $$I_2 = 0$$, recall if $$z \in \Gamma$$, then $$|z| = R$$. The ML-inequality yields

$$0 \leq \left|\int_{\Gamma} f(z)dz\right| \leq M\frac{\pi R}{2}.$$ We can get an upper bound $$M$$ by this:

$$\left|\frac{\log\left(1+z^{2}\right)}{1+z^{2}+z^{4}}\right|\le\frac{1+\left|z\right|^{2}+\left|\operatorname{arg}\left(1+z^{2}\right)\right|}{\left|z\right|^{4}+\left|z\right|^{2}-1} \leq \frac{1+R^{2}+\pi}{R^{4}+R^{2}-1}:=M.$$

From there, we just use the Squeeze Theorem and eventually conclude that $$I_2 = 0$$.

To prove $$I_3 = 0$$, parameterize $$z = i + re^{it}$$ where $$t \in \displaystyle \left[-\frac{\pi}{2},\frac{\pi}{2}\right]$$. Then

\begin{align} I_3 &= -2\Re\lim_{r \to 0^+}\int_{-\pi/2}^{\pi/2}f\left(i+re^{it}\right)d\left(i+re^{it}\right) \\ &= -2\Re i\lim_{r \to 0^+} \int_{-\pi/2}^{\pi/2}\frac{r\log\left(1+\left(i+re^{it}\right)^{2}\right)e^{it}}{\left(i+re^{it}\right)^{4}+\left(i+re^{it}\right)^{2}+1}dt \\ &= -2\Re i \int_{-\pi/2}^{\pi/2} e^{it}\lim_{r \to 0^+}\frac{1}{\left(i+re^{it}\right)^{4}+\left(i+re^{it}\right)^{2}+1}\lim_{r \to 0^+}\left(r\log\left(2ire^{it}\right)-\frac{ir^{2}e^{it}}{2}+ O\left(r^{3}\right)\right) \\ &= -2\Re i \int_{-\pi/2}^{\pi/2}\frac{e^{it}}{i^{4}+i^{2}+1}\left(0-0+O\left(0\right)\right)dt \\ &= 0. \\ \end{align}

Here is the calculation of $$I_4$$:

$$\Re 4\pi i \operatorname{Res}\left(\frac{\log\left(1+z^{2}\right)}{1+z^{2}+z^{4}}, z = z_1\right) = 4\pi \Re i \lim_{z \to z_1}\frac{\left(z-z_{1}\right)\log\left(1+z^{2}\right)}{\left(z-z_{1}\right)\left(z-z_{2}\right)\left(z-z_{3}\right)\left(z-z_{4}\right)} = \frac{\pi^2}{3}.$$

Here is the calculation of $$I_1$$:

\begin{align} I_1 &= 2\lim_{R \to \infty} \Re \operatorname{PV} \int_0^{iR} \frac{\log\left(1+z^{2}\right)}{1+z^{2}+z^{4}}dz \\ &= 2\Re\lim_{R \to \infty}\lim_{r \to 0^+}\int_{0}^{i-ir}\frac{\log\left(1+z^{2}\right)}{1+z^{2}+z^{4}}dz + 2\Re\lim_{R \to \infty}\lim_{r \to 0^+}\int_{i+ir}^{iR}\frac{\log\left(1+z^{2}\right)}{1+z^{2}+z^{4}}dz \\ &= 2\Re\lim_{r \to 0^+}\int_{0}^{1-r}\frac{\log\left(1+\left(ix\right)^{2}\right)}{1+\left(ix\right)^{2}+\left(ix\right)^{4}}d(ix) + 2\Re\lim_{R \to \infty}\lim_{r \to 0^+}\int_{1+r}^{R}\frac{\log\left(1+\left(ix\right)^{2}\right)}{1+\left(ix\right)^{2}+\left(ix\right)^{4}}d(ix) \\ &= 2\Re i\lim_{r \to 0^+}\int_{0}^{1-r}\frac{\log\left(1-x^{2}\right)}{1-x^{2}+x^{4}}dx + 2\Re i\lim_{R \to \infty}\lim_{r \to 0^+}\int_{1+r}^{R}\frac{\log\left(1-x^{2}\right)}{1-x^{2}+x^{4}}dx \\ &= 2 \cdot 0 + 2\Re i\lim_{R \to \infty}\lim_{r \to 0^+}\int_{1+r}^{R}\frac{\log\left|1-x^{2}\right|}{1-x^{2}+x^{4}}dx - 2\Re \lim_{R \to \infty}\lim_{r \to 0^+}\int_{1+r}^{R}\frac{\operatorname{arg}\left(1-x^2\right)}{1-x^{2}+x^{4}}dx \\ &= 2\cdot 0 + 2 \cdot 0 -2\pi\int_{1}^{\infty}\frac{dx}{1-x^{2}+x^{4}}. \end{align}

To avoid divergent integrals and messy bounds, consider the following calculation:

\begin{align} J :=& \int_{ }^{ }\frac{dx}{x^{4}-x^{2}+1} \\ =& \int_{ }^{ }\frac{dx}{\left(x^{2}-\sqrt{3}x+1\right)\left(x^{2}+\sqrt{3}x+1\right)} \\ =& \text{ } \frac{1}{2\sqrt{3}}\int_{ }^{ }\frac{x+\sqrt{3}}{x^{2}+\sqrt{3}x+1}dx-\frac{1}{2\sqrt{3}}\int_{ }^{ }\frac{x-\sqrt{3}}{x^{2}-\sqrt{3}x+1}dx \\ =& \text{ } \frac{1}{2\sqrt{3}}\left(\frac{1}{2}\int_{ }^{ }\frac{2x+\sqrt{3}}{x^{2}+\sqrt{3}x+1}dx+\frac{\sqrt{3}}{2}\int_{ }^{ }\frac{dx}{x^{2}+\sqrt{3}x+1}\right) \\ &-\frac{1}{2\sqrt{3}}\left(\frac{1}{2}\int_{ }^{ }\frac{2x-\sqrt{3}}{x^{2}-\sqrt{3}x+1}dx-\frac{\sqrt{3}}{2}\int_{ }^{ }\frac{dx}{x^{2}-\sqrt{3}x+1}\right) \\ =& \text{ } \frac{1}{2\sqrt{3}}\left(\frac{1}{2}\int_{ }^{ }\frac{d\left(x^{2}+\sqrt{3}x+1\right)}{x^{2}+\sqrt{3}x+1}+\frac{\sqrt{3}}{2}\int_{ }^{ }\frac{dx}{\left(x+\frac{3}{2}\right)^{2}+\frac{1}{4}}\right) \\ &-\frac{1}{2\sqrt{3}}\left(\frac{1}{2}\int_{ }^{ }\frac{d\left(x^{2}-\sqrt{3}x+1\right)}{x^{2}-\sqrt{3}x+1}-\frac{\sqrt{3}}{2}\int_{ }^{ }\frac{dx}{\left(x-\frac{3}{2}\right)^{2}+\frac{1}{4}}\right) \\ =& \text{ } \frac{1}{2\sqrt{3}}\left(\frac{1}{2}\ln\left(x^{2}+\sqrt{3}x+1\right)+\sqrt{3}\arctan\left(2x+\sqrt{3}\right)\right) \\ &-\frac{1}{2\sqrt{3}}\left(\frac{1}{2}\ln\left(x^{2}-\sqrt{3}x+1\right)-\sqrt{3}\arctan\left(2x-\sqrt{3}\right)\right)+C. \\ \end{align}

Since $$\displaystyle \frac{1}{x^{4}-x^{2}+1}$$ is improperly integrable on $$[1,\infty)$$, we use FTC and get

\begin{align} I_1 &= -2\pi \Big[\frac{1}{4\sqrt{3}}\ln\left(\frac{x^{2}+\sqrt{3}x+1}{x^{2}-\sqrt{3}x+1}\right)+\frac{1}{2}\arctan\left(2x+\sqrt{3}\right)+\frac{1}{2}\arctan\left(2x-\sqrt{3}\right)\Big]_1^{\infty} \\ &= \frac{\pi}{2\sqrt{3}}\ln\left(\frac{2+\sqrt{3}}{2-\sqrt{3}}\right)-\frac{\pi^{2}}{2}. \\ \end{align}

We conclude with

$$I= \frac{\pi}{2\sqrt{3}}\ln\left(\frac{2+\sqrt{3}}{2-\sqrt{3}}\right)-\frac{\pi^{2}}{2} - 0 - 0 + \frac{\pi^{2}}{3} = \frac{\pi}{\sqrt{3}}\ln\left(2+\sqrt{3}\right)-\frac{\pi^{2}}{6}.$$

Utilize $$\int_0^\infty \frac{\ln(x^2+1)}{x^2+a^2}dx=\frac\pi a\ln(1+a)$$ to integrate \begin{align} &\int_{-\infty}^{\infty} \frac{\ln(x^2+1)}{x^4+x^2+1}\ dx\\ = &\int_{0}^{\infty} \frac{2\ln(x^2+1)}{(x^2+e^{-\frac{i\pi}3})(x^2+e^{\frac{i\pi}3})}\ dx =\frac4{\sqrt3}\ \Im \int _0^\infty \frac{\ln(x^2+1)}{x^2+e^{-\frac{i\pi}3}}\ dx\\ =& \ \frac4{\sqrt3}\ \Im \frac{\pi}{e^{-\frac{i\pi}6}}\ln (1+ e^{-\frac{i\pi}6}) = \frac{\pi }{\sqrt{3}}\ln \left(2+\sqrt{3}\right)-\frac{\pi ^2}{6} \end{align}

Here's an approach just using contour integration and the Residue Theorem.

Denote the integrand by $$g(z) := \frac{\log(1 + z^2)}{z^4 + z^2 + 1}$$ and the contour indicated in the diagram by $$\Gamma_{\epsilon, R}$$, $$0 < \epsilon < \frac{\sqrt 3 - 1}{\sqrt 2}$$, $$1 < R$$; we use the standard choice of branch cut for logarithm, so that $$\arg z = \Im z \in (-\pi, \pi)$$. The wavy red curve indicates the part of the consequent branch cut for $$\log(1 + z^2)$$ in the upper half-plane.

We evaluate $$\oint_{\Gamma_{\epsilon, R}} g(z) \,dz$$ in two ways: using direct integration and via the Residue Theorem. We denote by $$\textrm{I}, \ldots, \textrm{VI}$$ the arcs so labeled in the diagram.

By design, $$\lim_{R \to \infty} \int_\textrm{I} g(z) \,dz = \int_{-\infty}^\infty \frac{\log(x^2 + 1) \,dx}{x^4 + x^2 + 1}$$ is the integral whose value we want to compute.

Now, $$\left\vert\int_\textrm{II} g(z) \,dz\right\vert \leq \int_\textrm{II} |g(z)| \,|dz| \leq \frac{\pi}{2} \cdot \frac{\log(R^2 + 1)}{R^4 - R^2 - 1},$$ which (by, e.g., l'Hôpital's Rule) approaches to $$0$$ as $$R \to \infty$$. So, $$\lim_{R \to \infty} \int_\textrm{II} g(z) \,dz = 0$$. For the same reason, $$\lim_{R \to \infty} \int_\textrm{VI} g(z) \,dz = 0$$.

We parameterize the integral over $$\textrm{V}$$ by $$z = \epsilon - i t$$, $$dz = i \,dt$$, where $$t$$ varies from $$1$$ to $$R$$: $$\int_\textrm{V} g(z) \,dz = \int_1^R \frac{\log[(-\epsilon + it)^2 + 1]}{(-\epsilon + i t)^4 + (\epsilon + i t)^2 + 1},$$ and in the limit as $$\epsilon \searrow 0$$, this is $$\lim_{\epsilon \searrow 0} \int_\textrm{V} g(z) \,dz = i \int_1^R \frac{\log(t^2 - 1) - \pi i}{t^4 - t^2 + 1}\,dt .$$ Parameterizing the integral over $$\textrm{III}$$ by $$z = \epsilon + i t$$, $$dz = i \,dt$$ similarly gives $$\lim_{\epsilon \searrow 0} \int_\textrm{III} g(z) \,dz = -i \int_1^R \frac{\log(t^2 - 1) + \pi i}{t^4 - t^2 + 1}\,dt,$$ so $$\lim_{\epsilon \searrow 0} \left[\int_\textrm{III} g(z) \,dz + \int_\textrm{V} g(z) \,dz\right] = 2 \pi \int_1^R \frac{dt}{t^4 - t^2 + 1} ,$$ and in the limit as $$R \to \infty$$, $$\begin{multline*} \lim_{\epsilon \searrow 0, R \to \infty} \left[\int_\textrm{III} g(z) \,dz + \int_\textrm{V} g(z) \,dz\right] \\ = 2 \pi \int_1^\infty \frac{dt}{t^4 - t^2 + 1} = 2 \pi \left(\frac{\pi}{4} - \frac{\log(2 + \sqrt{3})}{2 \sqrt{3}}\right) = \frac{\pi^2}{2} - \frac{\pi}{\sqrt 3} \log (2 + \sqrt 3) .\end{multline*}$$

Finally, parameterizing the half-circle $$\textrm{IV}$$ by $$z = i + \epsilon e^{i \theta}$$, $$dz = i \epsilon e^{i \theta} \,d\theta$$ gives $$\int_\textrm{IV} g(z) \,dz = i \int_0^{-\pi} \frac{\epsilon \log [1 + (i + \epsilon e^{i \theta})^2] e^{i \theta} \,d\theta}{(i + \epsilon e^{i \theta})^4 + (i + \epsilon e^{i \theta})^2 + 1}.$$ We have the bound $$\left\vert\int_\textrm{IV} g(z) \,dz\right\vert \leq \int_\textrm{IV} |g(z)| \,|dz| \leq \frac{\epsilon (2 + 2 \pi + |\log \epsilon| + \epsilon)}{1 - 12 \epsilon} \cdot \pi\epsilon \in O(\epsilon^2 \log \epsilon),$$ so by l'Hôpital's Rule $$\lim_{\epsilon \searrow 0} \int_\textrm{IV} g(z) \, dz = 0 .$$

In summary we have $$\phantom{(\ast)} \qquad \oint_{\Gamma_{\epsilon, R}} g(z) \,dz = \int_{-\infty}^\infty \frac{\log(x^2 + 1) \,dx}{x^4 + x^2 + 1} + \left[\frac{\pi^2}{2} - \frac{\pi}{\sqrt 3} \log (2 + \sqrt 3)\right]. \qquad (\ast)$$

On the other hand, the only poles of $$g$$ inside the contour are the simple poles at $$e^{\pi i / 3}, e^{2 \pi / 3}$$, and computing directly gives $$\operatorname{Res}\left(g; e^{\pi i / 3}\right) = \frac{\pi}{12 \sqrt{3}} - \frac{\pi}{12} i \qquad \textrm{and} \qquad \operatorname{Res}\left(g; e^{2 \pi i / 3}\right) = -\frac{\pi}{12 \sqrt{3}} - \frac{\pi}{12} i ,$$ so the Residue Theorem yields $$\phantom{(\ast\ast)} \qquad \oint_{\Gamma_{\epsilon, R}} g(z) \,dz = 2 \pi i \left[\operatorname{Res}\left(g; e^{\pi i / 3}\right) + \operatorname{Res}\left(g; e^{2\pi i / 3}\right)\right] = 2 \pi i \left(-\frac{\pi i}{6}\right) = \frac{\pi^2}{3}. \qquad (\ast\ast)$$ Combining $$(\ast)$$ and $$(\ast\ast)$$ gives the desired value: $$\int_{-\infty}^\infty \frac{\log(x^2 + 1) \,dx}{x^4 + x^2 + 1} = \boxed{\frac{\pi}{\sqrt 3} \log (2 + \sqrt 3) - \frac{\pi^2}{6}} .$$

By using the upper-semi-circle contour and Residue theorem, I tried to do a simplified computation, fitting the given answer: \begin{align} \frac{I}{2}=\int_0^{\infty}\frac{\ln(x^2+1)}{x^4+x^2+1}dx&=\Re\int_C\frac{\ln(z+i)}{z^4+z^2+1}dz\\ &=\Re\,\,2\pi i(Res_{z=\large{e^{\pi i/3}}}+Res_{z=e^{2\pi i/3}})\\ &=\Re\,\,2\pi i\left(\frac{\ln(e^{\pi i/3}+i)}{2\sqrt3\,i\,e^{\pi i/3}}+\frac{\ln(e^{2\pi i/3}+i)}{-2\sqrt3\,i\,e^{2\pi i/3}}\right)\\ &=\frac\pi{\sqrt3}\Re\,\,e^{-\pi i/3}\ln(\sqrt{2+\sqrt3}\,e^{5\pi i/12})-e^{-2\pi i/3}\ln(\sqrt{2+\sqrt3}\,e^{7\pi i/12})\\ &=\frac\pi{\sqrt3}(\frac14\ln(2+\sqrt3)+\frac{5\sqrt3\pi}{24}+\frac14\ln(2+\sqrt3)-\frac{7\sqrt3\pi}{24})\\ &=\frac{\pi}{2\sqrt3}\ln(2+\sqrt3)-\frac{\pi^2}{12} \end{align}

First, we will manipulate our integral into a form we can easily evaluate using double integrals, a replacement for Feynman's trick. $$I=2\int_0^\infty\frac{\ln(x^2+1)}{x^4+x^2+1}dx=\int_0^\infty\frac{\ln(x^4+2x^2+1)}{x^4+x^2+1}dx$$ $$=\int_0^\infty\left(\frac{\ln(x^2+y(x^4+x^2+1))}{x^4+x^2+1}\Bigg|_{y=0}^{y=1} +\frac{\ln(x^2)}{x^4+x^2+1}\right)dx$$ $$=\int_0^\infty\int_0^1\frac{1}{yx^4+(y+1)x^2+y}dy\space dx+2\int_0^\infty\frac{\ln x}{x^4+x^2+1}dx=J+2K$$ Our integral has split into 2 more integrals. We will name and evaluate the first integral J using a formula to cut out the tedium. $$J=\int_0^\infty\int_0^1\frac{1}{yx^4+(y+1)x^2+y}dy\space dx$$ $$\int_0^\infty\frac{dx}{ax^4+bx^2+c}=\frac{\pi}{2\sqrt c\sqrt{b+2\sqrt{ac}}}$$ $$J=\pi\int_0^1\frac{ dy}{2\sqrt{3y+1}\sqrt y}=\frac{\pi}{\sqrt3}\log(2+\sqrt3)$$ Our second integral $$K$$ seems tricky, but the denominator allows for tricks. We'll start by splitting the integral at $$x=1$$ and inverting to form an integral in $$[0,1]$$. This allows us to use geometric series. We can use the Basel sum to evaluate onwards. $$K=\int_0^\infty\frac{\ln x}{x^4+x^2+1}dx=\int_0^1\frac{(1-x^2)\ln x}{x^4+x^2+1}dx=\int_0^1\frac{(1-x^2)^2\ln x}{1-x^6}dx$$$$=\int_0^1(1-2x^2+x^4)\ln x \space \sum_{n=0}^\infty x^{6n}dx$$$$=\sum_{n=0}^\infty\int_0^1x^{6n}\ln x\space dx-2\sum_{n=0}^\infty\int_0^1x^{6n+2}\ln x\space dx+\sum_{n=0}^\infty\int_0^1x^{6n+4}\ln x\space dx$$$$=-\sum_{n=0}^\infty\frac{1}{(6n+1)^2}+2\sum_{n=0}^\infty\frac{1}{(6n+3)^2}-\sum_{n=0}^\infty\frac{1}{(6n+5)^2}$$$$=-\sum_{n=0}^\infty\frac{1}{(6n+1)^2}-\sum_{n=0}^\infty\frac{1}{(6n+3)^2}-\sum_{n=0}^\infty\frac{1}{(6n+5)^2}+3\sum_{n=0}^\infty\frac{1}{(6n+3)^2}$$$$=-\sum_{n=1}^\infty\frac{1}{(2n+1)^2}+\frac{1}{3}\sum_{n=0}^\infty\frac{1}{(2n+1)^2}$$ $$K=-\frac{2}{3}\frac{\pi^2}{8}=-\frac{\pi^2}{12}$$ Finally $$I=\left(\frac{\pi}{\sqrt3}\log(2+\sqrt3)\right)+2\left(-\frac{\pi^2}{12}\right)=\frac{\pi}{\sqrt3}\log(2+\sqrt3)-\frac{\pi^2}{6}$$

Too long for comment:

\begin{align*} I &= \int_{-\infty}^\infty \frac{\ln\left(x^2+1\right)}{x^4+x^2+1} \, dx \\ &= 2 \int_0^\infty \frac{\ln\left(x^2+1\right)}{x^4+x^2+1} \, dx \tag1 \\ &= 2 \left\{\int_0^1 + \int_1^\infty\right\} \frac{\ln\left(x^2+1\right)}{x^4+x^2+1} \, dx \\ &= 2 \int_0^1 \frac{\ln\left(x^2+1\right)}{x^4+x^2+1} \, dx + 2 \int_0^1 \frac{\ln\left(\frac1{x^2}+1\right)}{\frac1{x^4}+\frac1{x^2}+1} \, \frac{dx}{x^2} \tag2 \\ &= 2 \int_0^1 \frac{\ln\left(x^2+1\right)}{x^4+x^2+1} \, dx + 2 \int_0^1 \frac{x^2 \left(\ln\left(x^2+1\right) - \ln\left(x^2\right)\right)}{x^4+x^2+1} \, dx \\ &= 2 \underbrace{\int_0^1 \frac{x^2+1}{x^4+x^2+1} \ln\left(x^2+1\right) \, dx}_J - 4 \underbrace{\int_0^1 \frac{x^2}{x^4+x^2+1} \ln(x) \, dx}_K \\[2ex] \hline J &= \int_0^1 \frac{x^2+1}{x^4+x^2+1} \left[\int_0^1 \frac{x^2}{1+x^2y} \, dy\right] \, dx \tag3 \\ &= \frac12 \int_0^1 \frac1{y^2-y+1} \left[\int_0^1 \left(\frac{x+y-1}{x^2-x+1}-\frac{x-y+1}{x^2+x+1} - \frac{2(y-1)}{1+yx^2}\right) \, dx \right] \, dy \\ &= \frac\pi{4\sqrt3} \int_0^1 \frac{2y-1}{y^2-y+1} \, dy - \frac{\ln(3)}4 \int_0^1 \frac{dy}{y^2-y+1} - \int_0^1 \frac{y-1}{y^2-y+1} \cdot \frac{\arctan\left(\sqrt y\right)}{\sqrt y} \, dy \\ &= -\frac{\pi\ln(3)}{6\sqrt3} - 2 \underbrace{\int_0^1 \frac{y^2-1}{y^4-y^2+1} \arctan(y) \, dy}_{L} \tag4 \\[2ex] \hline K &= \int_0^1 \frac{x^4-x^2}{x^6-1} \ln(x) \, dx \tag5 \\ &= \sum_{n=0}^\infty \int_0^1 \left(x^{6n+2} - x^{6n+4}\right) \ln(x) \, dx \tag6 \\ &= \sum_{n=0}^\infty \left(\frac1{(6n+5)^2}-\frac1{(6n+3)^2}\right) \\ &= \frac{\psi^{(1)}\left(\frac56\right) - \psi^{(1)}\left(\frac12\right)}{36} \tag7 \end{align*}

• $$(1)$$ : symmetry
• $$(2)$$ : substitute $$x\mapsto\dfrac1x$$ in the latter integral
• $$(3)$$ : integral definition of $$\ln\left(x^2+1\right)$$
• $$(4)$$ : substitute $$y\mapsto y^2$$
• $$(5)$$ : introduce a factor of $$x^2-1$$
• $$(6)$$ : exploit the series expansion of $$\dfrac1{1-x}$$
• $$(7)$$ : trigamma function, or first derivative of digamma

I'm currently stuck on $$L$$. Partial evaluation follows with substituting $$y=\tan(z)$$, then replacing $$z\mapsto\dfrac z2$$ and integrating by parts.

\begin{align*} L &= \int_0^1 \frac{y^2-1}{y^4-y^2+1} \arctan(y) \, dy \\ &= \int_0^{\tfrac\pi4} \frac{\tan^4z-1}{\tan^4z-\tan^2z+1} z \sec^2(z) \, dz \\ &= - \int_0^{\tfrac\pi2} \frac{2z\cos(z)}{3\cos(2z)+5} \, dz \\ &= \frac\pi{4\sqrt3} \ln(2+\sqrt3) + \frac1{4\sqrt3} \int_0^{\tfrac\pi2} \ln\left(\frac{2+\sqrt3\sin(w)}{2-\sqrt3\sin(w)}\right) \, dw \end{align*}