Evaluating $\int_{-\infty}^{\infty} \frac{\log^{2}(1+ix^{2})}{1+ix^{2}} dx$ using contour integration

It was recommended to me that I evaluate $$\int_{-\infty}^{\infty} \frac{\log^{2}(1+ix^{2})}{1+ix^{2}} \ dx$$ by integrating $\displaystyle f(z) = \frac{\log^{2}(1+z^{2})}{1+z^{2}}$around a semicircle that has its diameter along the line $z= e^{i \pi /4}t, t \in \mathbb{R}$.

Using the principal branch of the logarithm, there are branch cuts on the imaginary axis from $i$ to $i \infty$ and from $-i$ to $-i \infty$.

Deforming the contour around branch cut in the upper half-plane I get

$$e^{ \frac{i \pi }{4}} \int_{-\infty}^{\infty} \frac{\log^{2}(1+it^{2})}{1+it^{2}} \ dt + i \int^{1}_{\infty} \frac{\left(\log (t^{2}-1) + \pi i\right)^{2}}{1-t^{2}} \ dt + i \int_{1}^{\infty} \frac{\left(\log (t^{2}-1) - \pi i \right)^{2}}{1-t^{2}} \ dt = 0$$

which implies

$$\int_{-\infty}^{\infty} \frac{\log^{2}(1+it^{2})}{1+it^{2}} \ dt = -4 \pi e^{- i \pi /4} \int_{1}^{\infty} \frac{\log(t^{2}-1)}{1-t^{2}} \ dt.$$

But $\displaystyle \int_{1}^{\infty} \frac{\log(t^{2}-1)}{1-t^{2}} \ dt$ does not converge.

What's going on here?

EDIT:

The issue is the indentation around the branch point at $z=i$. It's contribution doesn't vanish (nor is it finite) in the limit.

If you integrate $\displaystyle f(z) = \frac{\log^{2}(1+iz^{2})}{1+iz^{2}}$ around a semicircular contour that includes the real axis, you run into a similar issue with the branch point at $z=e^{i \pi/4}$.

I have not been able to come up with another approach that would make the evaluation less difficult.

• could you also take the semicircle the opposite direction too? but this way shod produce something meaningful still , how did you get the last equalities? – Evan Aug 22 '13 at 14:52
• What's wrong with integrating along the real axis here? Deform a semicircular contour to avoid the branch point at $z=e^{i \pi/4}$, but that's about as complicated as it needs to be. I think. – Ron Gordon Aug 22 '13 at 14:55
• Do you know what the answer is? – Mhenni Benghorbal Aug 22 '13 at 14:58
• I'm a bit confused: sometimes you have log, and sometimes log squared. – user8268 Aug 22 '13 at 15:54

$$2\int_0^{\infty}(1+i x^2)^s dx=-e^{3i\pi/4}\frac{\sqrt{\pi}}{2}\frac{\Gamma(-1/2-s)}{\Gamma(-s)}$$ twice wrt $s$ and set $s=-1$.