MathGroup Archive 2012

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

Search the Archive

question about NIntegrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg128739] question about NIntegrate
  • From: dsmirnov90 at gmail.com
  • Date: Thu, 22 Nov 2012 04:33:10 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net

Hi,

I want to use function NIntegrate to integrate a rather complicated function which should be calculated numerically and returns a Table. However, when I write something of the kind:

Clear[f]
f[(a_)?NumericQ] := {a^2};
NIntegrate[f[x], {x, -1, 1}]

I get an error: "Integrand f[x] is not numerical at {x} = {-0.984085}"

Strangely, the following code works fine:

NIntegrate[f[1], {x, -1, 1}]

giving the result {2.}

What am I doing wrong?

Dmitry



  • Prev by Date: Re: How to calculate the partial derivative?
  • Next by Date: Re: How to calculate the partial derivative?
  • Previous by thread: Special characters on file names: issues with linux
  • Next by thread: Re: question about NIntegrate