Modified Leibnitz integral: $\lim\limits_{a \to\infty}\frac1a\int _0^\infty\frac{(x^2+ax+1)\arctan(\frac{1}{x})}{1+x^4}dx=?$ $\lim\limits_{a \to \infty} \frac{1}{a} \int _0^\infty\frac{(x^2+ax+1)\arctan(\frac{1}{x})}{1+x^4}dx $ ,where $a$ is a parameter. 
ATTEMPT:- Let $I(a)=\frac{1}{a} \int _0^\infty \frac{(x^2+ax+1)\arctan(\frac{1}{x})}{1+x^4}dx$
Now by Leibnitz theorem, $I'(a)= -\int _0^\infty\frac{(1+x^2)(arccot(x))}{(1+x^4)a^2}dx$
Substituting $x=cot\theta.$
$\implies$ $I'(a)= -\int _0^\frac{\pi}{2}\frac{(\theta)(cosec^4\theta)}{(1+cot^4\theta)a^2}d\theta$
Also  $I'(a)= -\int _0^\frac{\pi}{2}\frac{(\frac{\pi}{2})(sec^4\theta)}{(1+tan^4\theta)a^2}d\theta +\int _0^\frac{\pi}{2}\frac{(\theta)(sec^4\theta)}{(1+tan^4\theta)a^2}d\theta$
$\implies $$2I'(a)= -\int _0^\frac{\pi}{2}\frac{(\frac{\pi}{2})(sec^4\theta)}{(1+tan^4\theta)a^2}d\theta+\int _0^\frac{\pi}{2}\frac{(\theta)(sec^4\theta)}{(1+tan^4\theta)a^2}d\theta -\int _0^\frac{\pi}{2}\frac{(\theta)(cosec^4\theta)}{(1+cot^4\theta)a^2}d\theta$
Note:The last two integrals add to ZERO.
$\implies$ $2I'(a)=-\int _0^\frac{\pi}{2}\frac{(\frac{\pi}{2})(sec^4\theta)}{(1+tan^4\theta)a^2}d\theta$
This integral can be easily evaluated by putting $tan\theta =t$
However I am getting $I(a)=\frac{\pi^2}{4\sqrt{2}a}.$ which is not the correct answer.
 A: Hint. One may recall that
$$
\arctan x +\arctan \frac1x =\frac{\pi}2,\qquad x>0.
$$
Then by the change of variable $x \to \dfrac1x$, one gets that
$$
aI(a):=\int _0^\infty\frac{(x^2+ax+1)\arctan(\frac1x)}{1+x^4}dx=\int _0^\infty\frac{(x^2+ax+1)\arctan x}{1+x^4}dx
$$ Thus we obtain
$$
aI(a)=\frac{\pi}2\int_0^\infty\frac{(x^2+ax+1)}{1+x^4}dx-aI(a)
$$ or
$$
aI(a)=\frac{\pi}4\int_0^\infty\frac{(x^2+ax+1)}{1+x^4}dx.
$$ Now the latter integral is classically evaluated, giving
$$
aI(a)=\frac{\pi}4 \times \frac{\pi}4 \left(a+2 \sqrt{2}\right) 
$$ and

$$
I(a)=\frac{\pi^2}{16}\left(1+ \frac{2\sqrt{2}}a\right), \qquad a\neq0.
$$

One may deduce that, as $a \to \infty$,
$$
I(a)\to\frac{\pi^2}{16}.
$$
A: It is not necessary to calculate $I(a)$. Noting that $\lim_{a\to\infty}\frac{x^2+ax+1}{a(x^4+1)}=\frac{x}{x^4+1}$ and
$$ \frac{x^2+ax+1}{a(x^4+1)}-\frac{x}{x^4+1}=\frac{x^2+1}{a(x^4+1)} $$
and $\int_0^\infty\frac{(x^2+1)\arctan\frac1x}{x^4+1}dx$ converges, we have, for big $M>0$, 
\begin{eqnarray}
&&\bigg|\int_0^\infty\frac{(x^2+ax+1)\arctan\frac{1}{x}}{a(x^4+1)}dx-\int_0^\infty\frac{x\arctan\frac{1}{x}}{x^4+1}dx\bigg|\\
&=&\frac1{a}\int_0^\infty\frac{(x^2+1)\arctan\frac{1}{x}}{x^4+1}dx\\
&\le&\frac{M}{a}\to 0\text{ as }a\to\infty,
\end{eqnarray}
and hence
\begin{eqnarray}
\lim_{a\to\infty}\frac{1}{a}\int_0^\infty\frac{(x^2+ax+1)\arctan\frac{1}{x}}{a(x^4+1)}dx=\int_0^\infty\frac{x\arctan\frac{1}{x}}{x^4+1}dx.
\end{eqnarray}
Let
$$ I\equiv\int_0^\infty\frac{x\arctan\frac{1}{x}}{x^4+1}dx, J=\int_0^\infty\frac{x\arctan x}{x^4+1}dx.$$
It is easy to see $I=J$ by using $x\to\frac1x$ and $I+J=\frac{\pi^2}{8}$ by usinng $\arctan x+\arctan\frac1x=\frac{\pi}2$. Hence $I=\frac{\pi^2}{16}$.
