$\int_0^\infty |2 \arctan\sqrt{x} - \pi {x^p}/(1+x^p)| \mathrm dx $ Let $a(x) = 2 \arctan\sqrt{x}$ and $b(x) = \pi {x^p}/(1+x^p)$. I'm trying to evaluate:
$$\int_0^\infty |a(x) - b(x)| \mathrm dx $$
I've figured out I need the integrals:
$$\int_0^1 a(x)-b(x) dx = \left[A(x)-B(x)\right]_0^1$$ and
$$\int_1^\infty a(x)-b(x) dx = \left[A(x)-B(x)\right]_1^\infty$$
The first of which is finite, but the second may or may not be. $A(x)$ has an expression in terms of elementary functions:
$$A(x) = (1+x)\arctan{\sqrt{x}} - \sqrt{x}$$
But $B$ is not so nice. Wolfram Alpha gives a result in terms of the hypergeometric function:
$$B(x) = x\left(1-{}_2F_1\left[1,\frac{1}{p};1+\frac{1}{p}; -x^p\right]\right)$$
Evaluation of some things are easy $A(0)=B(0)=0$, $A(1)=\pi/2 - 1$ and $B(1)$ has an expression.
So, basically I need to know if
$$\lim_{x\rightarrow\infty} A(x)-B(x)$$
converges, and if so, to what?
 A: Using the Taylor series for $\arctan x$ at $x=\infty$, we find
$$A(x) = \frac{\pi x}{2}-2 \sqrt{x} +o(1).$$
As you mention, the $B(x)$ term is more ornery. Our limit depends fundamentally on the sign of $p$, which forces us to address $B(x)$ in cases.  Our first two are easy:


*

*If $p=0$, then $B(x)=\pi x/2$ exactly, hence
$$A(x)-B(x) = -2\sqrt{x}+o(1).$$

*If $p<0$, we compute
$$\lim_{x \to \infty} \,_2F_1\left(1,\frac{1}{p},1+\frac{1}{p};-x^p\right)=\,_2F_1\left(1,\frac{1}{p},1+\frac{1}{p};0\right)=1,$$
in which we make use of the series definition for the hypergeometric function.  It follows that $B(x)=o(x)$, hence $A(x)-B(x)=\pi x/2 +o(x)$. 

*If $p>0$, our task is considerably harder.  Nevertheless, we claim that $B(x) \sim x$ as $x \to \infty$, i.e. that
$$\lim_{x \to \infty}\,_2 F_1\left(1,\frac{1}{p},1+\frac{1}{p};-x^p\right)=\lim_{x \to \infty} \,_2F_1\left(1,\frac{1}{p},1+\frac{1}{p};-x\right)=0.$$
For $p>1$, write
$$\lim_{x \to \infty} \,_2F_1\left(1,\frac{1}{p},1+\frac{1}{p};-x\right)=\lim_{x \to \infty}(1+x)^{-1/p}\,_2F_1\left(\frac{1}{p},\frac{1}{p},1+\frac{1}{p};\frac{x}{1+x}\right)$$
by Euler's hypergeometric transformations.  Our hypothesis $p>1$ allows us to apply Gauss's theorem, and we find
$$_2F_1\left(\frac{1}{p},\frac{1}{p},1+\frac{1}{p},1\right)=\frac{\pi}{p} \csc\left(\frac{\pi}{p}\right).$$
Therefore our claim holds because $(1+x)^{-1/p} \to 0$ as $x \to \infty$. If $p=1$ exactly, then
$$\lim_{x \to \infty} \,_2 F_1\left(1,1,2;-x\right)=\lim_{x \to \infty} \frac{\log(1+x)}{x}=0,$$
and our claim still holds.  Finally, given $p \in (0,1)$, Euler's hypergeometric relations give
$$\lim_{x \to \infty} \,_2F_1\left(1,\frac{1}{p},1+\frac{1}{p};-x\right)=\lim_{x \to \infty} (1+x)^{-1} \,_2F_1\left(1,1,1+\frac{1}{p};\frac{x}{1+x}\right).$$
Fix $t \in \mathbb{R}$.  By definition,
$$_2 F_1(1,1,t,x)=\sum_{k=0}^\infty \binom{-t}{k}^{-1}x^k,$$
which converges at $x=1$ provided $t>2$.  In particular, setting $t=1+1/p$, we obtain a convergent sum at $x=1$, so that the value $_2F_1(1,1,1+1/p;1)$ is finite by Abel's theorem.  It follows that
$$\lim_{x \to \infty} (1+x)^{-1} \,_2F_1\left(1,1,1+\frac{1}{p};\frac{x}{1+x}\right)=0,$$
again in accordance with our claim $B(x) \sim x$.  Thus $p >0$ implies
$$A(x)-B(x) = \left(\frac{\pi}{2} -1 \right)x + o(1).$$


In conclusion, the limit
$$\lim_{x \to \infty} A(x)-B(x)$$
diverges, for any choice of $p \in \mathbb{R}$.
Note: the weaker result $A(x) \sim B(x)$ holds if and only if $p=0$.
A: Since $\arctan u+\arctan1/u=\pi/2$ for every positive $u$, 
$$
a(x)-b(x)=\frac{\pi}{1+x^p}-2\arctan\frac1{\sqrt{x}}.
$$
Let us look at the behaviour of $a(x)-b(x)$ when $x\to+\infty$::


*

*If $p\gt1/2$, the $\arctan$ term is predominant and  $\arctan1/\sqrt{x}\sim1/\sqrt{x}$ which is not integrable, hence $a-b$ is not integrable.

*If $p\lt1/2$, the $\pi/(1+x^p)$ term is predominant and $\pi/(1+x^p)\sim\pi/x^p$ when $p\gt0$ which is not integrable, hence $a-b$ is not integrable (when $p\leqslant0$, $\pi/(1+x^p)$ converges to a nonzero limit hence $a-b$ is not integrable either).

*If $p=1/2$, both terms are equivalent to multiples of $1/\sqrt{x}$ and $a(x)-b(x)\sim(\pi-2)/\sqrt{x}$ hence $a-b$ is not integrable.


Finally, the function $a-b$ is never integrable at $+\infty$.
Tools used: 


*

*$\arctan u+\arctan1/u=\pi/2$ for $u\gt0$

*$u/(1+u)=1-1/(1+u)$ for every $u\ne-1$

*$1/(1+u)\sim1/u$ when $u\to\infty$

*$\arctan u\sim u$ when $u\to0$

*Integrability or nonintegrability of $u\mapsto u^a$ at $+\infty$, for various exponents $a$

*NOT W|A and NO hypergeometric function

