Sort of nested NIntegrate
- To: mathgroup at smc.vnet.net
- Subject: [mg107176] Sort of nested NIntegrate
- From: "g.resta at iit.cnr.it" <g.resta at iit.cnr.it>
- Date: Fri, 5 Feb 2010 03:19:04 -0500 (EST)
I have the following little problem with a function defined by means of NIntegrate. My function is much more complicated, but the following example suffices. Suppose I've defined a function in this way fu[x_] := NIntegrate[ Cos[ x * Sin[t] ], {t, 0, 1}]; Mathematica can easily compute numerically and plot the function fu. Now, I want to use the function fu in another NIntegrate, say NIntegrate[ fu[x]^2, {x,0,2}] I hoped that was innocuous (maybe slow, since each point of fu require another automatic quadrature) but I got instead this error: NIntegrate::inumr: The integrand Cos[x Sin[t]] has evaluated to non- numerical values for all sampling points in the region with boundaries {{0,1}}. I also got a number which looks like the right value, but I'm afraid to trust it because I do not fully understand the error message. It seems like Mathematica is trying to do something symbolic with the guts of fu, even if fu is defined by means of NIntegrate. But I'm probably wrong. Surely I'm missing something. Can anybody show me the light? (that is, the right way to perform similar computations, maybe the right option to pass along?) thank you very much, giovanni
- Follow-Ups:
- Re: Sort of nested NIntegrate
- From: Leonid Shifrin <lshifr@gmail.com>
- Re: Sort of nested NIntegrate
- From: DrMajorBob <btreat1@austin.rr.com>
- Re: Sort of nested NIntegrate