gamma function type complex integral estimation?

Is there any way to compute or estimate the following integrals? Surely this type of thing must be known, but Wolfram and other online integrators are giving me either useless or zero information:

∫2π0xne±ixdx\int_{0}^{2\pi}x^n e^{\pm ix}dx where n≥1n\geq1 is an integer.




If it were f: R→Rf:\ \mathbb R\to\mathbb R, we could use comparison.
– Simple Art
Oct 20 at 21:34



You can compute the integral via integration by parts, or by expanding the exponential into its power series and integrating termwise. Apparently, those are not the type of result you want, so can you clarify what type of result/estimate you want?
– Daniel Fischer♦
Oct 20 at 21:44



I suppose I am mainly looking for a numerical estimation of really any kind. Do you recommend parts or expansion for this?
– Johnny Apple
Oct 20 at 21:46


3 Answers


Integration by parts gives

(1)(1): define ana_n
(2)(2): integrate by parts
(3)(3): rewrite (2)(2) in terms of (1)(1)
(4)(4): solve the recursion from (3)(3)
(5)(5): use ∞∑k=1(−i2π)kk!=e−2πi−1=0\sum\limits_{k=1}^\infty\frac{(-i2\pi)^k}{k!}=e^{-2\pi i}-1=0

The real and imaginary parts of (5)(5) give the asymptotic expansions




I also got the leading term of (6) using the approximation-to-the-identity argument, but I never expected that such a precise expansion can be obtained by a simple and elegant computation. (+1)
– Sangchul Lee
Oct 21 at 4:18



It is possible due to the fact that ∞∑k=1(−i2π)kk!=e−2πi−1=0\sum_{k=1}^\infty\frac{(-i2\pi)^k}{k!}=e^{-2\pi i}-1=0
– robjohn♦
2 days ago



@robjohn, elegant!
– G Cab
2 days ago



Thanks so much for this! I hadn’t realized (5), or life would have been a little easier!
– Johnny Apple
2 days ago

We can write
\int_{\,x\, = \,0}^{\,2\pi } {x^{\,n\,} e^{\, \pm \,i\,x} \,dx} = \int_{\,x\, = \,0}^{\,2\pi } {x^{\,n\,} \left( {\cos x \pm \,i\sin x} \right)\,dx}

And we can start and compute the integral by parts
\int_{\,x\, = \,0}^{\,2\pi } {x^{\,n\,} \cos x\,dx} = \int_{\,x\, = \,0}^{\,2\pi } {x^{\,n\,} d\left( {\sin x} \right)} = \left. {\left( {x^{\,n\,} \sin x} \right)} \right|_{\,x\, = \,0}^{\,2\pi } – n\int_{\,x\, = \,0}^{\,2\pi } {x^{\,n – 1\,} \sin x\,dx} = \hfill \\
= – n\int_{\,x\, = \,0}^{\,2\pi } {x^{\,n – 1\,} \sin x\,dx} \hfill \\
\int_{\,x\, = \,0}^{\,2\pi } {x^{\,n\,} \sin x\,dx} = – \int_{\,x\, = \,0}^{\,2\pi } {x^{\,n\,} d\left( {\cos x} \right)} = \left. {\left( { – x^{\,n\,} \cos x} \right)} \right|_{\,x\, = \,0}^{\,2\pi } + n\int_{\,x\, = \,0}^{\,2\pi } {x^{\,n – 1\,} \cos x\,dx} = \hfill \\
= \left[ {0 = n} \right] – 2^{\,n\,} \pi ^{\,n\,} + n\int_{\,x\, = \,0}^{\,2\pi } {x^{\,n – 1\,} \cos x\,dx} \hfill \\

which translates into a double FDE.

Now, if your scope is to calculate the integrals on a computer, then you can use this result iteratively.



Thanks so much!
– Johnny Apple
2 days ago

Make the substitution ∓ix=u\mp ix=u and ∓idx=du\mp idx=du.

∫2π0xne±ixdx=±i∫∓2πi0(∓iu)ne−udu=−(∓i)n+1∫∓2πi0une−udu=−(∓i)n+1γ(n+1,∓2πi)\begin{align}\int_0^{2\pi}x^ne^{\pm ix}dx&=\pm i\int_0^{\mp2\pi i}(\mp iu)^ne^{-u}du\\
&=-(\mp i)^{n+1}\int_0^{\mp2\pi i}u^ne^{-u}du\\
&=-(\mp i)^{n+1}\gamma(n+1,\mp2\pi i)

where γ(n,x)\gamma(n,x) is the incomplete gamma function.

An example of an approximation:

γ(n,x)≈xn(1n−x1!(n+1)+x22!(n+2)−⋯+(−x)kk!(n+k))\gamma(n,x)\approx x^n\left(\frac1n-\frac x{1!(n+1)}+\frac{x^2}{2!(n+2)}-\dots+\frac{(-x)^k}{k!(n+k)}\right)

for very large kk.



Sure, but how do I then estimate the incomplete gamma function given?
– Johnny Apple
Oct 20 at 21:46



@JohnnyApple You may find everything in the link I will provide in my answer momentarily.
– Simple Art
Oct 20 at 21:47



I have been to the wiki page on this function. Where is there information on estimation?
– Johnny Apple
Oct 20 at 21:57



@JohnnyApple You may have found many expansion of the lower incomplete gamma function, which provide approximations.
– Simple Art
Oct 20 at 22:17



What is ss in the asymptotic expansion?
– robjohn♦
2 days ago