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"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Peter Pein
11/16/12 01:19am

In Response To 'Re: numerical integration and limits of integra...'
---------
Hi,

this is a possibility when one knows the range of integration. To write a little function that does a correct job in any case is simple:

nintval[r_] :=
NIntegrate[f[x], {x, -r, r}, AccuracyGoal -> 8,(*(*either*)Method->
"LocalAdaptive",(*or sth. like*)*)
MinRecursion -> Ceiling@Log[1 + Abs@r]]

but in this case I would do
Integrate[f[x],{x,-r,r}]
to get
7 Sqrt[Pi/5] Erf[Sqrt[5] r]
and then write a function like:
intval[r_] := N[(7 Sqrt[\[Pi]/5] Erf[Sqrt[5] r]), {Infinity, 8}]
to get an accuracy of 8 digits.

hth,
Peter

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
< Previous CommentHelp | Reply To Comment | Reply To Topic