Evaluating $\int_{0}^{1} \frac{x^{2n+2}}{x^2-2x+2}\,{\rm d}x$

definite integralsintegration

$$\int_{0}^{1} \frac{x^{2n+2}}{x^2-2x+2} \,{\rm d}x \tag{1}$$

This integral came up as a result of another integral I was trying to evaluate. Just for recreational purposes. Is there some closed form for this, even in terms of special functions?

In general, is it possible to evaluate integrals of the form:

$$\int_{0}^{1} \frac{P(x,x^n)}{Q(x)} \,{\rm d}x \tag{2}$$

with $\text{deg}(P) > \deg(Q)$? For example:

$$\int_{0}^{1} \frac{x^n}{1+x^2} \,{\rm d}x \tag{3}$$

can be written in terms of the digamma function. If I'm not mistaken, $(1)$ does not follow from $(3)$, because if you try to complete the square in the denominator of $(1)$, you'd end up having to perform a $u$-sub with $u = x-1$ and then a $(u+1)^{2n+2}$ in the numerator. This ruins things.

Can someone give some help?

Best Answer

Like most things in life, this is a hypergeometric integral:

$$ \fbox{$\frac{(1+i) \left(\, _2F_1\left(1,2 n+3;2 (n+2);\frac{1}{2}-\frac{i}{2}\right)-i \, _2F_1\left(1,2 n+3;2 (n+2);\frac{1}{2}+\frac{i}{2}\right)\right)}{8 n+12}\text{ if }\Re(n)>-\frac{3}{2}$} $$ The way to get it there is to transform $[0, 1]$ to $[0, \infty]$ by a linear fractional, and then it looks like a standard hypergeometric integral (I did not do that, but just asked mathematica).