$\int ^{\infty}_0 \frac{\ln x}{x^2 + 2x+ 4}dx$

May be this will be a more elementary solution.

Let us start with a the substitution $x=2y$. Then \begin{gather*} I = \int_{0}^{\infty}\dfrac{\ln(x)}{x^2+2x+4}\, dx = \int_{0}^{\infty}2\dfrac{\ln(2y)}{4y^2+4y+4}\, dy =\\[2ex] \dfrac{1}{2}\int_{0}^{\infty}\dfrac{\ln(2)}{y^2+y+1}\, dy + \dfrac{1}{2}\int_{0}^{\infty}\dfrac{\ln y}{y^2+y+1}\, dy= \dfrac{\ln(2)}{2}I_1+ \dfrac{1}{2}I_2\tag{1} \end{gather*} where \begin{equation*} I_1 = \int_{0}^{\infty}\dfrac{1}{y^2+y+1}\, dy =\dfrac{4}{3}\int_{0}^{\infty}\dfrac{1}{\left(\frac{2y+1}{\sqrt{3}}\right)^{2}+1}\, dy = \dfrac{2}{\sqrt{3}}\left[\arctan\left(\dfrac{2y+1}{\sqrt{3}}\right)\right]_{0}^{\infty} = \dfrac{2\pi}{3\sqrt{3}}\tag{2} \end{equation*} and \begin{equation*} I_2 = \int_{0}^{\infty}\dfrac{\ln(y)}{y^2+y+1}\, dy =\left[y=\dfrac{1}{z}\right] = \int_{0}^{\infty}\dfrac{-\ln(z)}{z^2+z+1}\, dz = -I_2. \tag{3} \end{equation*} But (3) implies that $I_2=0$. This and (2) substituted in (1) give us $I = \dfrac{\pi\ln(2)}{3\sqrt{3}}$.


Let $I$ be defined by the integral

$$I=\int_0^\infty \frac{\log(x)}{x^2+2x+4}\,dx \tag1$$

and let $J$ be the contour integral

$$J=\oint_{C}\frac{\log^2(z)}{z^2+2z+4}\,dz \tag2$$

where the contour $C$ is the classical "key-hole" contour for which the keyhole coincides with the branch cut along the positive real axis.

Then, we can write $(2)$ as

$$\begin{align} J&=\int_0^R \frac{\log^2(x)}{x^2+2x+4}\,dx-\int_0^R \frac{(\log(x)+i2\pi)^2}{x^2+2x+4}\,dx+\int_{C_R}\frac{\log^2(z)}{z^2+2z+4}\,dz\\\\ &=-i4\pi \int_0^R \frac{\log(x)}{x^2+2x+4}\,dx+4\pi^2\int_0^R\frac{1}{x^2+2x+4}\,dx+\int_{C_R}\frac{\log^2(z)}{z^2+2z+4}\,dz\tag 3 \end{align}$$

As $R\to \infty$ the integral over $C_R$ vanishes and we have from $(1)$

$$\lim_{R\to \infty}J=-i4\pi I +4\pi^2\int_0^\infty\frac{1}{x^2+2x+4}\,dx\tag 4$$


Next, we apply the residue theorem to evaluate the left-hand side of $(4)$. Proceeding we find that

$$\begin{align} \lim_{R\to \infty}J&=2\pi i \text{Res}\left(\frac{\log^2(z)}{z^2+2z+4}\,dz, z=-1\pm i\sqrt{3}\right)\\\\ &=2\pi i \left(\frac{(\log(2)+i2\pi/3)^2}{i2\sqrt{3}}+\frac{(\log(2)+i4\pi/3)^2}{-i2\sqrt{3}}\right)\\\\ &=-\frac{i4\pi^2\log(2)}{3\sqrt{3}}+\frac{4\pi^3}{3\sqrt{3}}\tag 5 \end{align}$$

Equating real and imaginary parts of $(3)$ and $(5)$ reveals

$$\int_0^\infty \frac{\log(x)}{x^2+2x+4}\,dx =\frac{\pi \log(2)}{3\sqrt{3}}$$

and as a bonus

$$\int_0^\infty\frac{1}{x^2+2x+4}\,dx=\frac{\pi}{3\sqrt{3}}$$

And we are done!


Let $$I = \int^{\infty}_{0}\frac{\ln x}{x^2+2x+4}dx = \int^{\infty}_{0}\frac{\ln x}{(x+1)^2+(\sqrt{3})^2}dx$$

put $\displaystyle x=\frac{1^2+(\sqrt{3})^2}{y} = \frac{4}{y}$ and $\displaystyle dx = -\frac{4}{y^2}dy$

$$I = \int^{0}_{\infty}\frac{\ln (4)-\ln (y)}{16+8y+4y^2}\cdot -\frac{4}{y^2}\cdot y^2 dy = \int^{\infty}_{0}\frac{\ln 4-\ln y}{y^2+2y+4}dy$$

$$I = \ln 4\int^{\infty}_{0}\frac{1}{(y+1)^2+(\sqrt{3})^2}dy-I$$

So $$I = \ln 2 \cdot \frac{1}{\sqrt{3}}\cdot \tan^{-1}\left(\frac{y+1}{\sqrt{3}}\right)\bigg|^{\infty}_{0} = \frac{\ln 2}{\sqrt{3}}\cdot \bigg(\frac{\pi}{2}-\frac{\pi}{6}\bigg) = \frac{\pi \cdot \ln 2}{3\sqrt{3}}$$