MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: NIntegrate & Integrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100155] Re: [mg100048] NIntegrate & Integrate
  • From: peter <plindsay.0 at gmail.com>
  • Date: Tue, 26 May 2009 05:12:02 -0400 (EDT)
  • References: <200905220547.BAA19130@smc.vnet.net>

In[1]:= {a,b}={8.76,4.56};
NIntegrate[2*Cos[x],{x,a,b}]
Out[2]= -3.21059
In[3]:= Integrate[2*Cos[x],{x,a,b}]
Out[3]= -3.21059
In[4]:= $Version
Out[4]= 7.0 for Mac OS X x86 (32-bit) (February 18, 2009)


2009/5/22 Konstantin <kzhuravl at mtu.edu>:
> Hello everybody,
>
> Easy question for Mathematica. Evaluate definite integral: 2*Cos[x] from =
8.76 to 4.56.
>
> I have evaluated it three different ways: Integrate, NIntegrate and Integ=
ral sign from basic math input palette.
>
> Here is the code(without Integral sign from basic math input palette):
>
>    Clear[x]
>    {a, b} = {8.76, 4.56};
>    NIntegrate[2*Cos[x], {x, a, b}]
>    Clear[x]
>    Integrate[2*Cos[x], {x, a, b}]
>
> My output is:
>
>    3.21059(NIntegrate)
>    -3.21059(Integrate)
>
> The right answer is -3.21059.
>
> Why does NIntegrate gave me wrong answer? Any help is appreciated. Thanks
>
> Konstantin
>
>



--
Peter Lindsay


  • Prev by Date: Re: update notebook calculations on startup?
  • Next by Date: Correlating two lists
  • Previous by thread: NIntegrate & Integrate
  • Next by thread: Re: NIntegrate & Integrate