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.