Re: Integrate with If
- To: mathgroup at smc.vnet.net
- Subject: [mg22275] Re: Integrate with If
- From: "Johan Berglind,5879" <johanbe at chl.chalmers.se>
- Date: Mon, 21 Feb 2000 20:00:45 -0500 (EST)
- Organization: Chalmers University of Technology
- References: <88g62h$4mq@smc.vnet.net> <88jtvv$9n3@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
>
> 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.
> (...)
>
Thank you, Harald.
As you and many others have pointed out, If is not suited for use in
Integrate.
It does, however work most of the time;
Integrate[If[Sin[t]>0,1,0], {t,-Pi/2,Pi/2}]
gives the correct answer. (The critical point seems to be -Pi)
And it seems to be fairly efficient. (Try using it in FourierSeries.)
My point is that either should If work in Integrate all of the time (and
I believe that is the ambition of Wolfram) or Mathematica should at
least produce a warning.
Johan.