The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: question about NIntegrate
Replies: 3   Last Post: Nov 24, 2012 2:28 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 7
Registered: 11/22/12
question about NIntegrate
Posted: Nov 22, 2012 4:33 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


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:

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?


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.