Evaluate:
$$\int_{-\infty}^{\infty} \frac{\log(1+x^2) dx}{1+x^2}$$
Using complex analysis, contour integration.
This function has no poles at all.
Try the contour $C$
Obviously,
$$\oint_{C} f(z) dz = 0$$
$$\oint_{C} f(z) dz = \int_{A} f(z) dz + \int_{-R}^{R} f(x) dx$$
$$\int_{-R}^{R} f(x) dx = -\int_{A} f(z) dz$$
Along the semi circle $A$ contour-part the parametrization is:
$$z = Re^{i\theta}$$
$$\int_{A} f(z) dz = \int_{0}^{\pi} (iRe^{i\theta})\cdot \frac{\log(Re^{i\theta} + i) + \log(Re^{i\theta} - i)}{(Re^{i\theta} + i)(Re^{i\theta} - i)} d\theta$$
$$\int_{-R}^{R} f(x) dx = (-)\cdot\int_{0}^{\pi} (iRe^{i\theta})\cdot \frac{\log(Re^{i\theta} + i) + \log(Re^{i\theta} - i)}{(Re^{i\theta} + i)(Re^{i\theta} - i)} d\theta$$
$$\int_{-\infty}^{\infty} f(x) dx = (-)\cdot \lim_{R \to \infty} \int_{0}^{\pi} (iRe^{i\theta})\cdot \frac{\log(Re^{i\theta} + i) + \log(Re^{i\theta} - i)}{(Re^{i\theta} + i)(Re^{i\theta} - i)} d\theta$$
Lets say we can apply the dominated convergence theorem. We can then take the limit INSIDE the integral on the RHS. The problem becomes:
$$\int_{-\infty}^{\infty} f(x) dx = (-i)\cdot \int_{0}^{\pi} \lim_{R \to \infty} (Re^{i\theta})\cdot \frac{\log(Re^{i\theta} + i) + \log(Re^{i\theta} - i)}{(Re^{i\theta} + i)(Re^{i\theta} - i)} d\theta$$
Wolframalpha returns it as $0$ which is wrong. What is the issue? The answer is:
$$I = -\pi\log(\sqrt{2})$$
Please tell me what is wrong with this, do not suggest something else until the end. Thank you!