Re: Numerical integration inside numerical integration

• To: mathgroup at smc.vnet.net
• Subject: [mg48824] Re: [mg48811] Numerical integration inside numerical integration
• From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
• Date: Fri, 18 Jun 2004 02:12:46 -0400 (EDT)
• References: <200406170807.EAA27751@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

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