Date: Mar 7, 2013 10:47 PM
Author: psycho_dad
Subject: Re: Using NIntegrate in a function

Hi dude,

That's not a serious problem. Just define your function as:
f[a_?NumberQ]:=NIntegrate[Exp[-((a-1/3)^2+1)*x^4],{x,-1,1}]

Notice the ?NumberQ part that tells Math to only evaluate the function when "a" is a number. This will stop the errors from coming up.

Cheers