MathGroup Archive 2005

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

Search the Archive

Re: Integrate problem?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62125] Re: Integrate problem?
  • From: Peter Pein <petsie at dordos.net>
  • Date: Sat, 12 Nov 2005 03:31:27 -0500 (EST)
  • References: <dl1j6h$t54$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Martin Manscher schrieb:
> In[48]:=
> Integrate[Sin[t]Sign[Sin[.999t]],{t,0,2p}]
> 
> Out[48]=
> 2. - 1.91585*10^-14 I
> 
> In[49]:=
> NIntegrate[Sin[t]Sign[Sin[.999t]],{t,0,2p}]
> 
> Out[49]=
> 4.
> 
> Why?
> /Martin
> 

Hi Martin,
assuming p==Pi, version 5.1 (Windows) calculates:

In[1]:=
Integrate[Sin[t]*Sign[Sin[0.999*t]], {t, 0, 2*Pi}]
Out[1]=
3.999990110634892

In[2]:=
Integrate[Sin[t]*Sign[Sin[999*t/1000]], {t, 0, 2*p},
   Assumptions -> 0 <= p <= Pi]
Out[2]=
Piecewise[{{1 + Cos[2*p] - 2*Cos[(1000*Pi)/999], p > (500*Pi)/999},
    {1 - Cos[(1000*Pi)/999], p == (500*Pi)/999},
    {2*Sin[p]^2, 0 < p < (500*Pi)/999}}]

In[3]:=
% /. p -> Pi
Out[3]=
2 - 2*Cos[(1000*Pi)/999]
In[4]:=
N[%]
Out[4]=
3.999990110634892

In[5]:=
NIntegrate[Sin[t]*Sign[Sin[0.999*t]], {t, 0, 2*Pi}]
Out[5]=
3.999990110634892


  • Prev by Date: Re: Tilting at Windmills?
  • Next by Date: Re: 'Good' or 'Proper' Mathematica coding habits question
  • Previous by thread: Re: Integrate problem?
  • Next by thread: Re: FileNamesin a loop..