Re: Re: Error in integrals?
- To: mathgroup at smc.vnet.net
- Subject: [mg9532] Re: [mg9502] Re: Error in integrals?
- From: David Withoff <withoff>
- Date: Thu, 13 Nov 1997 01:39:59 -0500
- Sender: owner-wri-mathgroup at wolfram.com
: Mathematica 3.0 on a PowerMac 7200/90 88MB Mac OS 8 gives different
: results for Integrate vs. NIntegrate.
: Here is one example.
: ior[m_] := 1/3*(2*Sqrt[3]*Sqrt[(-1 + m^2)^2/(1 + m^2)^4] +
: Sqrt[(Sqrt[3] - 6*m - Sqrt[3]*m^2)^2/(1 + m^2)^4] + Sqrt[(Sqrt[3] +
: 6*m - Sqrt[3]*m^2)^2/(1 + m^2)^4])
: In[31]:=
: N[Integrate[ior[m],{m,0,1}]]
: Out[31]=
: -0.42265
> I tried your example in Mathematica 2.2:
>
> In[12]:= In[12]:= N[Integrate[ior[m],{m,0,1}]]
>
> General::intinit: Loading integration packages -- please wait.
>
> Out[12]= 1.73206
>
> In[13]:= NIntegrate[ior[m],{m,0,1}]
>
> Out[13]= 1.73206
>
> In[14]:= In[14]:= $Version
>
> Out[14]= DEC OSF/1 Alpha 2.2 (September 9, 1994)
>
> Sergio
The Integrate function in Version 2.2 gives the "right" answer here
because it didn't do the integral. N[Integrate[ior[m],{m,0,1}]] and
NIntegrate[ior[m],{m,0,1}] give the same answer in Version 2.2 because
both calculations are done using NIntegrate. When N is applied to an
unevaluated integral, Mathematica automatically calls NIntegrate.
Integrate[ior[m],{m,0,1}] in Version 2.2 returns the integral
unevaluated.
Dave Withoff
Wolfram Research