MathGroup Archive 2000

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

Search the Archive

Re: Integrate with If


Johan Berglind,5879 schrieb:
> 
> Why does
> 
>         Integrate[If[Sin[t] > 0, 1, 0] , {t, -Pi, Pi}]
> 
> evaluate to 2Pi?
> 
>         Plot[If[Sin[t] > 0, 1, 0] , {t, -Pi, Pi} ]
> 
> looks all right.
> 
> Puzzled,
> 
> Johan Berglind,
> Chalmers, Goteborg,
> Sweden.

Dear Johan,

Integrate doesn't work with If, use UnitStep instead. So both

In[17]:= Plot[UnitStep[t], {t, -Pi, Pi}]
Out[17]= Graphics[]

In[18]:= Integrate[UnitStep[t], {t, -Pi, Pi}]
Out[18]= Pi

do well.

Kind regards, Hartmut


  • Prev by Date: Front-end crashes in Redhat6.1
  • Next by Date: Input Output Label
  • Previous by thread: Integrate with If
  • Next by thread: Re: Integrate with If