MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Numerical integration inside numerical integration


On 17 Jun 2004, at 17:07, blah12 at mail.com wrote:

> Hello all,
>
> I'm trying to solve numerically an integral like,
>
>
> A=some_value
> NIntegrate[f[y,u]*Log[1+NIntegrate[g[y,u,s], {s, A, \[Infinity]}]],
>     {u, -\[Infinity],\[Infinity]},{y, -\[Infinity],\[Infinity]}]
>
> I know I am doing this wrong as the inner integration fails because
> it doesn't have specific numerical values for y and u.
> I guess Mathematica doesn't perform numerical integrations from the
> outside to the inside (and so passing each time values of y,u to
> the inner integration).
>
> How can this problem be solved with Mathematica please ?
>
> Thanks.
>
>
>
Just define:

h[u_?NumericQ, y_?NumericQ] := f[y, u]*Log[1 + NIntegrate[g[y,
    u, s], {s, 1, Infinity}]]

and then evaluate

NIntegrate[h[u, y],
     {u, -Infinity, Infinity}, {y, -Infinity, Infinity}]


It will probably be quite slow since NIntegrate can't compile a 
function defined in this way. (It may even be slightly better to use 
the Compiled->False option in the second NIntegrate, though I am not 
sure if it will make any difference.)

Andrzej Kozlowski
Chiba, Japan
http://www.mimuw.edu.pl/~akoz/


  • Prev by Date: Re: Re: Random Matrix of Integers
  • Next by Date: Re: Substitution ignored?
  • Previous by thread: Numerical integration inside numerical integration
  • Next by thread: Re: Numerical integration inside numerical integration