<s>[INST] Value of this definite integral $\int_{0}^{\infty} \frac{ \ln(x)}{x^2+2x+4} dx $ So I came across this question on brilliant.org and didn't know how to go about it:
$$\int_{0}^{\infty} \frac{ \ln(x)}{x^2+2x+4} dx $$
I tried to complete the squares in the denominator and then use a trigonometric substitution (with tan) but I didn't get anything beyond that. 
How do I do it? Do we need to differentiate under the integral sign here?
 [/INST] This CAN be done with real variables and no, you do not need to differentiate with respect to a parameter. Here's how:
$$I=\int_{0}^{\infty} \frac{\ln(x)}{x^2+2x+4} dx $$
$$I=\int_{0}^{\infty} \frac{\ln(x)}{{(x+1)}^2+3}dx $$
$$I=\frac{1}{3} \int_{0}^{\infty} \frac{\ln(x)}{ ({ \frac{x+1}{\sqrt{3}} })^2 + 1} dx $$
Now, set 
$$\frac{x+1}{\sqrt{3}} = \tan(t)$$
Thus $t$ is between $\frac{\pi}{6}$ and $\frac{\pi}{2}$.
We now have
$$I=\frac{1}{\sqrt{3}} \int_{\frac{\pi}{6}}^{\frac{\pi}{2}} \ln{ (\sqrt{3} \tan(t) - 1 )} dt $$
Now, use this property:
$$\int_{a}^{b} f(x) dx = \int_{a}^{b} f(a+b-x) dx$$
So, we have:
$$I= \frac{1}{\sqrt{3}} \int_{\frac{\pi}{6}}^{\frac{\pi}{2}} \ln{ \left( \sqrt{3} \frac{ \sqrt{3} + \tan(t) }{\sqrt{3} \tan(t) - 1} - 1\right) }dt $$
On simplifying,
$$I=\frac{1}{\sqrt{3}} \int_{\frac{\pi}{6}}^{\frac{\pi}{2}} \ln{\left( \frac{4}{\sqrt{3} \tan(t) - 1}\right)} dt $$
Thus,
$$I=\frac{1}{\sqrt{3}} \int_{\frac{\pi}{6}}^{\frac{\pi}{2}} \ln{(4)} dt - I$$
$$I= \frac{\pi}{3 \sqrt{3} } \ln{2} $$
and we are done.
</s>