Evaluate $\int_0^1\left(\frac{2x-1}{x^2-(1-i)x+\frac{1}{2}(1-i)}\right)^ndx$ for natural $n$

definite integralsintegration

I was trying to solve this integral the another integral came up:
$$I_n=\int_0^1\left(\frac{2x-1}{x^2-(1-i)x+(1-i)/2}\right)^ndx$$
There seems to be a pattern in the results
$$I_0=1$$$$I_2=-2+\frac{\pi}{\sqrt2}$$$$I_4=\frac{4}{3}-\frac{3\pi}{2\sqrt2}$$$$I_6=\frac{8}{5}-\frac{9\pi}{8\sqrt2}$$$$I_8=\frac{-16}{7}+\frac{61\pi}{16\sqrt3}$$

The odd inputs seem to be rational multiples of $\frac{\pi i}{\sqrt2}$. The difference in the odd and even inputs makes me think they should be evaluated separately.

Differentiating with respect to n seemed to make it worse.
$$I'(n)=\int_0^1\left(\frac{2x-1}{x^2-(1-i)x+(1-i)/2}\right)^n\ln\left(\frac{2x-1}{x^2-(1-i)x+(1-i)/2}\right)dx$$I tried integration by parts with $u=(\frac{2x-1}{x^2-(1-i)x+(1-i)/2})^{n-1}$ and $dv=\frac{2x-1}{x^2-(1-i)x+(1-i)/2}$ but it seemed to make the integrand so much messier.

Edit: We can substitute $u=\frac{2x-1}{x^2-(1-i)x+(1-i)/2}$, and the problem reduces to finding

$$J_n=\int_{-1-i}^{-1+i}\frac{x^n}{\sqrt{-2x^2-4ix+4}}dx$$

For which I asked another question for

Best Answer

Here is the complete solution providing the closed form of the integral for any postive integer. The solution was obtained following the plan decribed earlier in the incomplete solution (an which I didn't believe to work out in the first place). I did not succeed finding sufficient patterns so I decided to look for the solution so that the patterns emerged automatically.

We employ the method of generating functions (as suggested also in a comment). Luckily, a closed expression for the the g.f. can be found.

We have to compute

$$i(n) = \int_{0}^{1} f(x)^n \;dx\tag{1}$$

where

$$f(x) = \frac{2 x-1}{x^2-(1-i) x+\frac{1-i}{2}}=\frac{P_1(x)}{P_2(x)}\tag{2}$$

Now we define a g.f. by multiplying $i(n)$ with a factor $t^n$ and summing over all $n$. The resulting geometric series can be done immediately, giving

$$g(t,x) = \sum _{n=0}^{\infty} t^n f(x)^n=\frac{1}{1-t f(x)}\tag{3}$$

Integrating over $x$ we get the g.f. of interest here:

$$g(t) = \int_{0}^{1} g(t,x)\;dx= \int_{0}^{1} \frac{P_2(x)}{P_2(x)-t P_1(x)}\;dx\tag{4}$$

The integral over a quotient of two polynomials is elementary.

Then $i(n)$ can be calculated from

$$i(n) =\frac{1}{n!} (\frac{\partial}{\partial t})^n g(t)|_{t\to 0}\tag{5}$$

A convenient final result which I have split into three terms is

$$g(t) = g_1(t) + g_2(t) + g_3(t)$$

where

$$g_1(t)=1+ \frac{1}{2} t \log \left(1-\frac{4 t}{2 t (t+1)+1}\right)\tag{6.1}$$ $$g_2(t) = -i t \left(\tan ^{-1}\left(\frac{1-t}{t}\right)+\tan ^{-1}\left(\frac{t}{t+1}\right)\right)\tag{6.2}$$ $$g_3(t) = \frac{\pi t (2 t-i)}{\sqrt{2} \sqrt{1-2 t (t-i)}}\tag{6.3}$$

We observe that $g_1$ is real, $g_2$ is purely imaginary, and $g_3$ is complex with a common factor $\frac{i \pi }{\sqrt{2}}$.

The power series expansions of the three parts are

$$\begin{align} g_1(t) &= \sum _{k=0}^{\infty }a(k)t^{2k}\\ a(k)&=(-1)^{1+\binom{k}{2}}\frac{ 2^k }{2 k-1} \end{align}\tag{6.1a}$$

$$\begin{align} g_2(t)&=\sum _{k=0}^{\infty }b(k)t^{k}\\ b(0)&=0, b(1)=\frac{i \pi}{2}, \\ b(4k-1)& = i (-1)^{k+1}\frac{ 4^{k}}{2(2k-1)}, k=1,2,3,...\\ b(k)&=0 \text{, else} \end{align}\tag{6.2a}$$

$$\begin{align} g_3(t)&=\sum _{k=0}^{\infty } c(k) t^k\\ c(k) &= -\frac{\pi }{\sqrt{2}} i^k 2^k k \binom{\frac{1}{2}}{k} \, _2F_1\left(-\frac{1}{2} (k-1),-\frac{k}{2};\frac{3}{2}-k;2\right) \end{align}\tag{6.3a}$$

Here $_2F_1$ is the hypergeometric sum which is actually a finite sum of $\lfloor \frac{k}{2}\rfloor$ terms.

The integrals are therefore

$$i(n=2k) = a(k) + b(2k)+c(2k)\tag{7.1}$$ $$i(n=2k-1) = b(2k-1)+c(2k-1)\tag{7.2}$$

Explcitly, in the format $\{n,i(n)\}$

$$i (n=2 k)=\left( \begin{array}{cc} 0 & 1 \\ 2 & \frac{\pi }{\sqrt{2}}-2 \\ 4 & \frac{4}{3}-\frac{3 \pi }{2 \sqrt{2}} \\ 6 & \frac{8}{5}-\frac{9 \pi }{8 \sqrt{2}} \\ 8 & \frac{61 \pi }{16 \sqrt{2}}-\frac{16}{7} \\ 10 & \frac{395 \pi }{128 \sqrt{2}}-\frac{32}{9} \\ 12 & \frac{64}{11}-\frac{3093 \pi }{256 \sqrt{2}} \\ 14 & \frac{128}{13}-\frac{10157 \pi }{1024 \sqrt{2}} \\ 16 & \frac{84509 \pi }{2048 \sqrt{2}}-\frac{256}{15} \\ 18 & \frac{1115379 \pi }{32768 \sqrt{2}}-\frac{512}{17} \\ 20 & \frac{1024}{19}-\frac{9595745 \pi }{65536 \sqrt{2}} \\ \end{array} \right)\tag{7.1a}$$

$$i (n=2 k-1)=\left( \begin{array}{cc} 1 & \frac{i \pi }{2}-\frac{i \pi }{\sqrt{2}} \\ 3 & 2 i-\frac{3 i \pi }{2 \sqrt{2}} \\ 5 & \frac{5 i \pi }{8 \sqrt{2}} \\ 7 & \frac{49 i \pi }{16 \sqrt{2}}-\frac{1}{3} (8 i) \\ 9 & -\frac{243 i \pi }{128 \sqrt{2}} \\ 11 & \frac{32 i}{5}-\frac{2365 i \pi }{256 \sqrt{2}} \\ 13 & \frac{6513 i \pi }{1024 \sqrt{2}} \\ 15 & \frac{63225 i \pi }{2048 \sqrt{2}}-\frac{1}{7} (128 i) \\ 17 & -\frac{731459 i \pi }{32768 \sqrt{2}} \\ 19 & \frac{512 i}{9}-\frac{7091313 i \pi }{65536 \sqrt{2}} \\ \end{array} \right)\tag{7.2a}$$

Discussion

Substituting $x\to y+\frac{1}{2}-\frac{i}{2}$ the integral is transformed into this compact form

$$i(n) = \int_{\frac{i-1}{2}}^{\frac{i+1}{2}} \left(\frac{4 y-2 i}{2 y^2+1}\right)^n \, dy$$

Related Question