Re: Integrate with If
- To: mathgroup at smc.vnet.net
- Subject: [mg22361] Re: [mg22180] Integrate with If
- From: bergervo at prl.philips.nl (Bergervoet J.R.M.)
- Date: Fri, 25 Feb 2000 21:14:13 -0500 (EST)
- Organization: Philips Research Laboratories Eindhoven, Netherlands
- References: <200002170624.BAA04409@smc.vnet.net> <88jt51$9lf@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In <88jt51$9lf at smc.vnet.net> Hartmut Wolf <hwolf at debis.com> writes:
>> Why does
>>
>> Integrate[If[Sin[t] > 0, 1, 0] , {t, -Pi, Pi}]
>>
>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.
But this functionallity (in order to generalize to functions other than
Sin[]) would require:
Integrate[UnitStep[Sin[t]], {t,-Pi, Pi}]
and that still gives 0 (incorrect!). It does work with jump-point 0:
Integrate[UnitStep[Sin[t]], {t,-Pi, 0, Pi}]
which correctly gives Pi.
(Jos)
--
Dr. Jozef R. Bergervoet Electromagnetism and EMC
Philips Research Laboratories, Eindhoven, The Netherlands
Building WS01 FAX: +31-40-2742224
E-mail: bergervo at natlab.research.philips.com Phone: +31-40-2742403
- References:
- Integrate with If
- From: "Johan Berglind,5879" <johanbe@chl.chalmers.se>
- Integrate with If