Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2009

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

Search the Archive

Re: Nested numerical integration

  • To: mathgroup at
  • Subject: [mg99167] Re: [mg99138] Nested numerical integration
  • From: "David Park" <djmpark at>
  • Date: Wed, 29 Apr 2009 03:49:17 -0400 (EDT)
  • References: <189219.1240908982824.JavaMail.root@n11>

Mathematica can't do a numerical integration on the inner integral because w
is left as a symbol. So either do a double integral all at once:

NIntegrate[w^2/(s - w), {s, 1, 5}, {w, -5, -1}]

Or do a symbolic integration on the inner integral and a numerical integral
on the outer:

Assuming[w <= 1, Integrate[1/(s - w), {s, 1, 5}]]
NIntegrate[w^2 %, {w, -5, -1}]
Log[(-5 + w)/(-1 + w)]

David Park
djmpark at  

From: tsg.moore at [mailto:tsg.moore at] 

Hi, I'd like to compute a nested integral like,

NIntegrate[ w^2 * NIntegrate[1/(s-w), {s, 1, 5}], {w, -5, -1}]

Unfortunately, mathematica gives me an error (NIntegrate::inumr) and
it also outputs the wrong value. Is there a way to do these types of

  • Prev by Date: Inverse function warnings
  • Next by Date: Re: variable initial value in NDSolve
  • Previous by thread: Re: Nested numerical integration
  • Next by thread: Re: Nested numerical integration