How to calculate the improper integral $\int_0^\infty\left(\frac{1}{\sqrt{x^2+4}}-\frac{P}{x+2}\right)dx$ This is the first time I've seen a problem like this. I have no idea what to do. Detailed guidance would be of great help.
For which values of P does the integral converge?
$$\int_0^\infty\left(\dfrac{1}{\sqrt{x^2+4}}-\dfrac{P}{x+2}\right)dx$$
Thank You!
 A: $\newcommand{\+}{^{\dagger}}
 \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\down}{\downarrow}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\isdiv}{\,\left.\right\vert\,}
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}
 \newcommand{\wt}[1]{\widetilde{#1}}$
With $\ds{\Lambda > 0}$:
\begin{align}
&\color{#c00000}{%
\int_{0}^{2\Lambda}\pars{{1 \over \root{x^{2} + 4}} - {P \over x + 2}}\,\dd x}
={\rm arcsinh}\pars{\Lambda} - P\ln\pars{\Lambda + 1}
\\[3mm]&=\ln\pars{\Lambda + \root{\Lambda^{2} + 1}} - P\ln\pars{\Lambda + 1}
=\ln\pars{\Lambda + \root{\Lambda^{2} + 1} \over \bracks{\Lambda + 1}^{P}}
\end{align}

When $\ds{\Lambda \gg 1}$, it's clear that:



*
*$\ds{\large P \not= 1}$: The integral diverges as
        $\ds{\ln\pars{2\Lambda^{1 - P}}}$.
    
*$\ds{\large P = 1}$: The integral converges to
        $\ds{\ln\pars{2}}$.

A: Let our function be $f(x)$. The function $f(x)$ behaves nicely in the interval $[0,1]$, so it is enough to find $p$ such that $\int_1^\infty f(x)\,dx$ converges.  
If $p\le 0$, then Comparison shows divergence. So we can assume $p\gt 0$.
Rewrite $f(x)$ as $\frac{x+2-p\sqrt{x^2+4}}{(x+2)\sqrt{x^2+4}}$, and then rationalize the numerator by multiplying top and bottom by $x+2+p\sqrt{x^2+4}$. We get
$$f(x)=\frac{x^2(1-p^2) +4x+4(1-p^2)}{(x+2)\sqrt{x^2+4}\left(x+2+\sqrt{x^2+4}\right)}.$$
If $p=1$, then $f(x)\le \frac{4x}{2x^3}=\frac{2}{x^2}$. Since $\int_1^\infty \frac{2}{x^2}\,dx$ converges, so does $\int_1^\infty f(x)\,dx$. 
If $0\lt p\lt 1$ or $p\gt 1$, then our integral diverges. There are two cases to consider. 
Suppose that $0\lt p\lt 1$. Let $g(x)=\frac{1}{x}$. One can show that
$$\lim_{x\to\infty} \frac{f(x)}{g(x)}=\frac{1-p^2}{2}.$$
 Since $\int_1^\infty g(x)\,dx$ diverges, so does $\int_1^\infty f(x)\,dx$. The argument for $p\gt 1$ is similar.  
