Re: Integrate with If
- To: mathgroup at smc.vnet.net
- Subject: [mg22207] Re: Integrate with If
- From: Harald Giese <giese at ifm.uni-hamburg.de>
- Date: Fri, 18 Feb 2000 02:34:43 -0500 (EST)
- Organization: Institut fuer Meereskunde, Universitaet Hamburg
- References: <88g62h$4mq@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
"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,
Hi Johan,
The "If" construct is an impropper argument for Integrate, see the
online-help:
(...)
Integrate can evaluate integrals of rational functions. It can also
evaluate integrals that involve exponential, logarithmic, trigonometric
and inverse trigonometric functions, so long as the result comes out in
terms of the same set of functions.
(...)
You can use NIntegrate instead or contruct your argument with the
function UnitStep.
Hope this helps,
/Harald
--
Harald Giese
Email: giese at dkrz.de
Phone: +49 (0)40 42838 5796; Fax: +49 (0)40 5605724
Institut fuer Meereskunde der Universitaet Hamburg
(Institute of Oceanography of the University of Hamburg)
Troplowitzstrasse 7, D-22529 Hamburg