Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to know how to perform numeric integration for the following type of integrals in Mathematica.
For the following integrand, we can not get the symbolic result.

NIntegrate[ y * Integrate[ 1/x * HankelH1[1, k*x] * HankelH2[1, x/k], {x,1,y}],
           {y, 1, 2}]   

The aim of the integration is to find the real and imaginary parts of the result.

Your views and inputs are greatly appreciated.

share|improve this question
p.s. where k = Exp[I*Pi/4] with "I" being the complex variable. – learner123 Nov 29 '13 at 11:15
Yes the integration needs to be done twice – learner123 Nov 29 '13 at 11:32
Can you try along the same direction as your other question 37931 ? – b.gatessucks Nov 29 '13 at 11:38
What's wrong with with a straightforward double integral, NIntegrate[y*1/x*HankelH1[1, k*x]*HankelH2[1, x/k], {y, 1, 2}, {x, 1, y}]? – Michael E2 Nov 29 '13 at 16:30
up vote 1 down vote accepted

You can try to do it this way:

k = Exp[I Pi/4];
f[y_] := y * NIntegrate[ 1/x * HankelH1[1, k*x] * HankelH2[1, x/k], {x, 1, y}]
result = NIntegrate[ f[y], {y, 1, 2}, 
                     Method -> {Automatic, "SymbolicProcessing" -> None}]
share|improve this answer
Hi All, For the following command, NIntegrate[yNIntegrate[1/xHankelH1[1,xk]*HankelH2[1, x/k], {x,1,y}] ,{y,1,2}]/. {x->0.5, k-> Exp[IPi/4]} I recieve following warning. NIntegrate::nlim: x = y is not a valid limit of integration. – learner123 Dec 2 '13 at 2:09
@learner123 Ok, so what is the problem? You can use code that Michael E2 post above (better) or my version (worse). Your code will never give result because there is "k" in the integrand that is not numeric. – Kamov Sergey Dec 2 '13 at 3:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.