Improper integral involving $e^x$ How do you show that
$$\int_{-\infty }^{+\infty }{\frac{{{x}^{2}}\, \text{d}x}{\left( \beta +{{\text{e}}^{x}} \right)\left( 1-{{\text{e}}^{-x}} \right)}}=\frac{\left( {{\pi }^{2}}+{{\ln }^{2}}\beta  \right)\ln \beta }{3\left( \beta +1 \right)},\ \ \left|\text{arg} \ \beta\right|<\pi ?$$

Let $\displaystyle u = e^{x}$.
Then $$\int_{-\infty}^{\infty} \frac{x^{2}}{(\beta+e^x)(1-e^{-x})} \ dx = \int_{0}^{\infty} \frac{\ln^{2} u}{(\beta + u)(u-1)} \ du . $$
Now let $\displaystyle f(z) = \frac{\ln^{3} z}{(\beta+z)(z-1)}$ and integrate around a keyhole contour where the branch cut for $\log z$ is placed along the positive real axis.
Notice that there is a simple pole at $z=1$ below the branch cut.
So the contour needs to be indented around $z=1$ below the branch cut.
Then
$$\int_{0}^{\infty} \frac{\ln^3 u}{(\beta+u)(u-1)} \ du  -\pi i \ \text{Res}[f(z), e^{2 \pi i}] - \text{PV} \int_{0}^{\infty} \frac{(\ln u +2 \pi i)^{3}}{(\beta+u)(u-1)} \ du = 2 \pi i \ \text{Res} [f,-\beta]$$
where $$  \text{Res}[f(z), - \beta] =  \ \frac{\ln^{3}(-\beta)}{-\beta - 1} = -  \frac{(\ln \beta + i \pi)^{3}}{\beta + 1}$$
and
$$ \text{Res}[f(z), e^{2 \pi i} ] = -\frac{8 i \pi^{3}}{\beta + 1} .$$
Equating imaginary parts on both sides of the equation,
$$ \text{PV} \displaystyle \int_{0}^{\infty} \frac{-6 \pi  \ln^{2} u + 8 \pi^{3}}{(\beta+u)(u-1)} \ du = \frac{- 2 \pi \ln^{3} \beta + 6 \pi^{3} \ln \beta}{\beta+1} .$$ 
Then rearranging, 
$$ \begin{align} \int_{0}^{\infty} \frac{\ln^{2}u}{(\beta + u)(u-1)} \ du &= \frac{  \ln^{3} \beta - 3 \pi^{2} \ln \beta}{3(\beta+1)} + \frac{4}{3} \pi^{2} \ \text{PV} \int_{0}^{\infty} \frac{1}{(\beta +u)(u-1)} \ du \\ &=  \frac{\ln^{3} \beta - 3 \pi^{2} \ln \beta}{3(\beta+1)} + \frac{4 \pi^{2}}{3} \frac{\ln \beta}{\beta +1} \\ &= \frac{(\pi^2 + \ln^{2} \beta) \ln \beta}{3(\beta+1)} . \end{align}$$
EDIT:
$$ \begin{align} \text{PV} \int_{0}^{\infty} \frac{1}{(\beta +u)(u-1)} \ du  &= \lim_{\epsilon \to 0^{+}} \Bigg( \int_{0}^{1-\epsilon} \frac{du}{(\beta +u)(u-1)} + \int_{1+\epsilon}^{\infty} \frac{du}{(\beta +u)(u-1)} \Bigg) \\ &= \frac{1}{\beta +1} \lim_{\epsilon \to 0^{+}} \Bigg( \ln \Big(\frac{u-1}{\beta + u}\Big) \Big|^{1- \epsilon}_{0} + \ln \Big(\frac{u-1}{\beta + u}\Big) \Big|^{\infty}_{1+\epsilon}\Bigg) \\ &= \frac{1}{\beta+1} \lim_{\epsilon \to 0^{+}} \Bigg( \ln \Big(\frac{-\beta-1-\epsilon}{\beta+1-\epsilon} \Big) - \ln \big(\frac{-1}{\beta} \big) \Bigg) \\ &= \frac{\ln (-1) - \ln \big( \frac{-1}{\beta}\big) }{\beta+1} \\ &= \frac{i\pi  + \ln \beta - i \pi}{1+ \beta} = \frac{\ln \beta}{\beta+1}. \end{align}$$ 
SECOND EDIT:
And equating real parts on both sides of the equation, $$ \int_{0}^{\infty} \frac{\log u}{(\beta +u)(u-1)} \ du = \frac{1}{2(\beta +1)} \left(\pi^{2}+\log^{2}(\beta) \right) .$$
Initially I forgot to include the contribution from the indentation around $z=1$ below the branch cut. It didn't matter when equating imaginary parts on both sides of the equation.
