TITLE: Contour integration with infinite poles
QUESTION [8 upvotes]: I am trying to find the integral of the following expression:-
$$\int_{-\infty}^{\infty} \frac{x^2}{e^{k}+e^{x^2}}dx$$
I think this can be solved using contour integration. The poles will be the points with $z^2 = k+i(2n+1)\pi$ according to me. But this results in infinite poles if you choose a contour covering the entire real axis. Does anybody have any insights to solve this integral?

REPLY [4 votes]: I would like to add a different approach, directly connecting the integral to the field of polylogarithms (and I don't know why it wasn't mentioned within the two excellent answers already given).
Clearly, the integrand is an even function of $x$ and thus we only need to be concerned about the interval $[0,\infty]$. Enforcing the substitution $x^2\mapsto x$ reveals the integral representation of the Polylogarithm Function as
\begin{align*}
\int_{-\infty}^\infty \frac{x^2}{e^{x^2}+e^k}\mathrm dx&=2\int_0^\infty \frac{x^2}{e^{x^2}+e^k}\mathrm dx\\
&=\int_0^\infty\frac{x^\frac12}{e^x+e^k}\mathrm dx\\
&=-e^{-k}\int_0^\infty\frac{x^{\frac32-1}}{e^x/(-e^k)-1}\mathrm dx\\
&=-e^{-k}\left[\Gamma\left(\frac32\right)\operatorname{Li}_\frac32\left(-e^k\right)\right]
\end{align*}

$$\therefore~\int_{-\infty}^\infty \frac{x^2}{e^{x^2}+e^k}\mathrm dx~=~-\frac{\sqrt\pi }2e^{-k}\operatorname{Li}_\frac32\left(-e^k\right)$$

The last step follows by basic properties of the Gamma Function. Anyway, note that the conditions - under which this representation holds - are met and at the same time the final expression matches the ones given by the other answers. Integral representation, as the one used here, are quite helpful when dealing with integrals of the "Mellin type" as they are sometimes called (due to their relation to the Mellin Transform).