Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: NIntegrate a list

  • To: mathgroup at
  • Subject: [mg52979] Re: [mg52940] NIntegrate a list
  • From: DrBob <drbob at>
  • Date: Sat, 18 Dec 2004 04:00:12 -0500 (EST)
  • References: <>
  • Reply-to: drbob at
  • Sender: owner-wri-mathgroup at

I'm not sure why you want to integrate functions of x with respect to theta, but it's easily done symbolically:

Integrate[x*Sin[x]*{1, 2}, {theta, -Pi, Pi}]
{2*Pi*x*Sin[x], 4*Pi*x*Sin[x]}

The same thing with NIntegrate doesn't work because NIntegrate needs an integrand that resolves to NUMBERS.

If we change theta to x, these work:

Integrate[x*Sin[x]*{1, 2}, {x, -Pi, Pi}]
NIntegrate[x*Sin[x]*{1, 2}//Evaluate, {x, -Pi, Pi}]

but this doesn't:

NIntegrate[x*Sin[x]*{1, 2}, {x, -Pi, Pi}]


On Fri, 17 Dec 2004 05:19:17 -0500 (EST), Aaron Fude <aaronfude at> wrote:

> Hi,
> I can Integrate this, but apparently not NIntegrate this:
> Integrate[x*Sin[x]*{1, 2}, {theta, -Pi, Pi}]
> but not
> NIntegrate[x*Sin[x]*{1, 2}, {theta, -Pi, Pi}]
> Is there a good way to do this (w/o writing loops)?
> Many thanks!
> Aaron Fude

DrBob at

  • Prev by Date: Re: slow eigenvectors and eigenvalues
  • Next by Date: An argument pattern problem: ranges and lists
  • Previous by thread: Re: NIntegrate a list
  • Next by thread: Re: NIntegrate a list