Question: We have to find the integration of 

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

In this I tried to do substitution of $x=e^t$

After that got stuck .

Answer: 
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}}$$