Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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
1  
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

1 Answer 1

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[y*NIntegrate[1/x*HankelH1[1,x*k]*HankelH2[1, x/k], {x,1,y}] ,{y,1,2}]/. {x->0.5, k-> Exp[I*Pi/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

 
discard

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.