Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'numerical integration and limits of integration' topicStudent Support Forum > General > "numerical integration and limits of integration"

Next Comment >Help | Reply To Topic
Author Comment/Response
Felipe Benguria
11/15/12 1:04pm


I am trying to integrate a function using nintegrate. I need to integrate this function for different parameters, which change its shape. Ideally, I would just very wide limits of integration , since for some parameters, the function can have a wide domain. However, NIntegrate sometimes fails to give the right answer when the limits of integration are too wide. An example of the problem is below.

I define and plot a function:
f[x_] := 7*Exp[-5*x^2]
Plot[f[x], {x, -10, 10}, AxesOrigin -> {0, 0}, PlotRange -> {0, 10}]

I try to integrate the functions for different limits, and in the last case, when they are too wide, the value goes to zero.

NIntegrate[f[x], {x, -5, 5}, AccuracyGoal -> 8]
NIntegrate[f[x], {x, -10, 10}, AccuracyGoal -> 8]
NIntegrate[f[x], {x, -20, 20}, AccuracyGoal -> 8]
NIntegrate[f[x], {x, -100, 100}, AccuracyGoal -> 8]
NIntegrate[f[x], {x, -1000, 1000}, AccuracyGoal -> 8]

The issue is that I need to have wide limits of integration because for some parameters the function f[x] will actually have positive values for a large domain of x.

Thanks a lot for your help

URL: ,

Subject (listing for 'numerical integration and limits of integration')
Author Date Posted
numerical integration and limits of integration Felipe Bengu... 11/15/12 1:04pm
Re: numerical integration and limits of integra... jf 11/15/12 7:18pm
Re: Re: numerical integration and limits of int... Felipe 11/15/12 9:49pm
Re: Re: numerical integration and limits of int... Peter Pein 11/16/12 01:19am
Next Comment >Help | Reply To Topic