Finding Cauchy Principal Value for $\int_0^\infty \frac{\ln^2x }{(1-x)^2\sqrt{x}(x-4)} dx$ I am trying to find Cauchy Principal value for
$$\int_0^\infty \frac{\ln^2x }{(1-x)^2\sqrt{x}(x-4)} dx$$
Can you please suggest me where to start? Any help would be appreciated.
Thanks!
 A: Because I would rather not usurp the regular and very ingenious posters, I usually do not post many solutions. But, I hope no one minds I respond this time. Had some time before going to eat Christmas dinner :). 
Ron, I would very much like to see your contour method!.
But, here is an approach to the problem. No doubt, someone has a more efficient method. When I see ln, often it signals DUTIS to introduce the ln term.  
DUTIS stands for Differentiation Under The Integral Sign. 
We'll differentiate twice, w.r.t 'a', then let $a\to -1/2$ in order to obtain the integrand we need. 
Write the integrand as:
$$\int_{0}^{\infty}\frac{x^{a}}{(1-x)^{2}(x-4)}dx$$
$$=1/9\underbrace{\int_{0}^{\infty}\frac{x^{a}}{1-x}dx}_{\text{[1]}}-1/3\underbrace{\int_{0}^{\infty}\frac{x^{a}}{(1-x)^{2}}dx}_{\text{[2]}}+1/9\underbrace{\int_{0}^{\infty}\frac{x^{a}}{x-4}dx}_{\text{[3]}}$$
The first integral is a classic. It is related to digamma and evaluates to
[1]: $$\int_{0}^{\infty}\frac{x^{a}}{1-x}dx=\pi \cot(\pi a)$$
Diff twice w.r.t 'a', then let $a\to -1/2$:
$$\frac{d^{2}a}{da^{2}}\left[\frac{\pi}{9}\cot(\pi a)\right]=\frac{2}{9}\pi^{2}\cot(\pi a)\cdot \csc^{2}(\pi a)$$
$$\rightarrow \frac{2}{9}\pi^{2}\cot(\pi (-1/2))\cdot \csc^{2}(\pi (-1/2))=\boxed{0}$$
[2]: The middle integral can be done thusly:
$$1/3\int_{0}^{\infty}\frac{x^{a}}{(1-x)^{2}}dx=1/3\int_{0}^{1}\frac{x^{a}}{(1-x)^{2}}dx+1/3\int_{1}^{\infty}\frac{x^{a}}{(1-x)^{2}}dx$$
Let $x\to 1/x$ in the second integral. This leads to:
$$1/3\int_{0}^{1}\frac{x^{a}}{(1-x)^{2}}dx-1/3\int_{0}^{1}\frac{x^{-a}}{(1-x)^{2}}dx$$
Begin with $$\lim_{n\to \infty}\sum_{k=0}^{n}kx^{k-1\pm a}=\frac{x^{\pm a}}{(1-x)^{2}}$$
Integrate over $[0,1]$ and get sums related to digamma again:
$$\sum_{k=0}^{n}\left(\frac{k}{k-a}+\frac{k}{k+a}\right)=2(n+1)-a\left[\psi(a+n+1)-\psi(n-a+1)-\psi(a)+\psi(-a)\right]$$
I have to admit that I used tech to do the grunt work here. 
Diff twice w.r.t 'a', then let $n\to \infty$.  
This returns:
$$2\pi^{2}+2\pi^{2}\cot^{2}(\pi a)-2a\pi^{3}\cot(\pi a)-2a\pi^{3}\cot^{3}(\pi a)$$
Let $a\to -1/2$ and don't forget the -1/3 in front of the integral sign at the beginning.
$$\frac{1}{3}\left(2\pi^{2}+2\pi^{2}\cot^{2}(\pi (-1/2))-2(-1/2)\pi^{3}\cot(\pi (-1/2))-2(-1/2)\pi^{3}\cot^{3}(\pi (-1/2)) \right)= \boxed{\frac{2}{3}\pi^{2}}$$
[3]: Now we can do [3] by making a sub and using the digamma relation again.
$$1/9\int_{0}^{\infty}\frac{x^{a}}{x-4}dx$$
Make the sub $x=4y, \;\ dx=4dy$
This gives:
$$\frac{-4^{a}}{9}\int_{0}^{\infty}\frac{y^{a}}{1-y}dy$$
Now, we're back to the same integrand as in [1].  This then evaluates to:
$$\frac{-4^{a}}{9}\pi\cot(\pi a)$$
Diff this twice w.r.t. 'a':
$$\frac{2\cdot 4^{a}\pi}{9}\csc^{3}(\pi a)\left[2\cos(\pi a)\sin^{2}(\pi a)\ln^{2}(2)+\pi^{2}\cos(\pi a)-2\pi \ln(2)\sin(\pi a)\right]$$
Let $a\to -1/2$ and get $$\boxed{\frac{2\pi^{2}}{9}\ln(2)}$$
Put the 'boxed' pieces together and finally get the desired result of said integral:
$$\int_{0}^{\infty}\frac{\ln^{2}(x)}{(1-x)^{2}\sqrt{x}(x-4)}dx=[1]+[2]+[3]=\boxed{-\frac{2}{3}\pi^{2}+\frac{2\pi^{2}}{9}\ln(2)}$$
This appears to check numerically. 
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\on}[1]{\operatorname{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

*

*First, I'll evaluate
$\ds{\left.\oint_{\cal C}{z^{\nu} \over z - a}\,\dd z\,\right\vert_{\substack{-1\ <\ \nu\ <\ 0\\[0.75mm] a\ >\ 0}}\,\,\,}$ where $\ds{\cal C}$ is a key-hole contour which "takes care" of the $\ds{z^{\nu}}$-branch cut
$$
z^{\nu} = \verts{z}^{\nu}\expo{\ic\arg\pars{z}\nu}\,,\quad \arg\pars{z} \in \pars{0,2\pi}\,,\quad z \not= 0
$$

\begin{align}
0 & = \int_{0}^{\infty}{x^{\nu} \over x - a + \ic 0^{+}}\,\dd x +
\int_{\infty}^{0}
{x^{\nu}\expo{2\pi\nu\ic} \over x - a - \ic 0^{+}}\,\dd x
\\[5mm] & =
\mrm{P.V.}\int_{0}^{\infty}{x^{\nu} \over x - a}\,\dd x -
\ic\pi a^{\nu}
\\[2mm] & -
\expo{2\pi\ic\nu}\,\mrm{P.V.}
\int_{0}^{\infty}{x^{\nu} \over x - a}\,\dd x -
\ic\pi a^{\nu}\expo{2\pi\ic\nu}
\\[5mm] & =
\pars{1 - \expo{2\pi\ic\nu}}\,\mrm{P.V.}
\int_{0}^{\infty}{x^{\nu} \over x - a}\,\dd x -
\ic\pi a^{\nu}\pars{1 + \expo{2\pi\ic\nu}}
\end{align}

*

*Then
\begin{align}
\mrm{P.V.}
\int_{0}^{\infty}{x^{\nu} \over x - a}\,\dd x & =
\pi\ic a^{\nu}\,{1 + \expo{2\pi\ic\nu} \over
1 - \expo{2\pi\ic\nu}} =
\pi\ic a^{\nu}\,{\expo{-\pi\ic\nu} + \expo{\pi\ic\nu} \over
\expo{-\pi\ic\nu} - \expo{\pi\ic\nu}}
\\[5mm] & =
-\pi a^{\nu}\cot\pars{\pi\nu}
\\[5mm] 
\mrm{P.V.}
\int_{0}^{\infty}{\ln^{2}\pars{x} \over x - a}
\,{\dd x \over \root{x}}& =
\left.\partiald[2]{\bracks{-\pi a^{\nu}\cot\pars{\pi\nu}}} {\nu}
\,\right\vert_{\,\nu\ =\ -1/2} =
2\pi^{2}\,{\ln\pars{a} \over \root{a}}
\end{align}


*In addition,
\begin{align}
&\mrm{P.V.}
\int_{0}^{\infty}{\ln^{2}\pars{x} \over \pars{x - a}\pars{x - 4}}
\,{\dd x \over \root{x}}
\\[5mm] = &\
{1 \over a - 4}\bracks{%
\mrm{P.V.}
\int_{0}^{\infty}{\ln^{2}\pars{x} \over x - a}
\,{\dd x \over \root{x}} -
\mrm{P.V.}
\int_{0}^{\infty}{\ln^{2}\pars{x} \over x - 4}
\,{\dd x \over \root{x}}}
\\[5mm] = &\
2\pi^{2}\,{\ln\pars{a}/\root{a} - \ln\pars{2} \over a - 4}
\end{align}


*Finally,
\begin{align}
&\mrm{P.V.}
\int_{0}^{\infty}{\ln^{2}\pars{x} \over
\pars{x - 1}^{2}\pars{x - 4}}\,{\dd x \over \root{x}}
\\[5mm] = &\
2\pi^{2}\,\totald{}{a}\bracks{%
{\ln\pars{a}/\root{a} - \ln\pars{2} \over a - 4}}_{\,a\ =\ 1}
\\[5mm] = &\
\bbx{{2 \over 9}\,\pi^{2}\ln\pars{2} - {2 \over 3}\,\pi^{2}}
\approx -5.0595 \\ &
\end{align}
