I want to numerically integrate a function of the form:
NIntegrate(Exp(I a x) x^-n (1+Exp(I b x))^n,{x,1,10^4},
Method -> {"LevinRule", "LevinFunctions" -> {"TrigRelated"}})
BTW, Mathematica understands this better using Euler’s formula exp = cos + i sin
.
The Levin Rule wants a explicit oscillating kernel like Exp(I 1/50 x)
. The obvious solution would be to expand the bracket using the binomial theorem and then there would be contributions like Exp(I (a+l b) x)
– oscillations with well defined frequency. But then I need to compute N integrals instead of 1 and there will be cancellations.
Is there a smarter way of telling the Levin Rule what to do than the Binomial expansion?