RE: Error in integrals?
- To: mathgroup at smc.vnet.net
- Subject: [mg9495] RE: [mg9482] Error in integrals?
- From: Ersek_Ted%PAX1A at mr.nawcad.navy.mil
- Date: Sat, 8 Nov 1997 23:04:28 -0500
- Sender: owner-wri-mathgroup at wolfram.com
Cliff Nelson wrote:
----------
| 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}]]
|
| In[32]:=
| NIntegrate[ior[m],{m,0,1}]
|
Here is what you get from Integrate.
In[17]:= Integrate[ior[m],{m,0,1}]
Out[17]= 1/Sqrt[3] - 1
If you use Plot[ior[m],{m,0,1}]
you will see ior[m] has a kink at ( m = 0.268....). It turns out the
kink is at ( m = 2-Sqrt[3] ). It seems Integrate was not able to find
this kink and correctly take it into account.
You get a different result if you break the region of integration into
two parts (it takes a long time to solve). I think this gives the
right answer, since the results of Integrate and NIntegrate agree.
In[18]:= int=Integrate[ior[m],{m,0,2-Sqrt[3],1}]
Out[18]= -1 + 1/Sqrt[3] + (Sqrt[3] - 3)/(3*(Sqrt[3] - 2)) +
(3 - 2*Sqrt[3])/(3*Sqrt[3] - 6)
In[19]:= estimate=NIntegrate[ior[m],{m,0,2-Sqrt[3],1}]; estimate==int
Out[19]= True
If I was doing important work to used results from Integrate, DSolve, or
FullSimplify I would check the results using numerical tests, human
intelligence and separate algorithms. This isn't because Wolfram
Research made a bad program, but because we expect the program to do
things that are incredibly difficult.
Over the years Wolfram Research will correct discovered problems, and
the program will get closer to the holy grail.
Ted Ersek
ersek_ted%pax1a at mr.nawcad.navy.mil