Integrate[Abs[Cos[u]], u] for u real
- To: mathgroup at smc.vnet.net
- Subject: [mg73753] Integrate[Abs[Cos[u]], u] for u real
- From: "David W. Cantrell" <DWCantrell at sigmaxi.net>
- Date: Tue, 27 Feb 2007 05:52:05 -0500 (EST)
- References: <errl49$80t$1@smc.vnet.net> <erugbv$8o$1@smc.vnet.net>
In a thread with the informative title "Fw: Re: Fw: 2", "dimitris" <dimmechan at yahoo.com> wrote: > Hi Jerry. > > Someone could say this conversation is a little pointless since I > don't have version 4.2. > > As I said I could find many occasions that 5.2 shows superior > performance than 4.2. But as I understood is a matter of what > applications someone is interested in. > > Anyway... > I want you just to execute the following in your version 4.2: > > In[183]:= > Integrate[Abs[Cos[u]], {u, 0, x*Pi}] > > Out[183]= > Integrate[Abs[Cos[u]], {u, 0, Pi*x}] > > (*in version 4.0 you get the incorrect result Sqrt[Cos[Pi x]^2] Tan[Pi x]; > the correct symbolic result > is Sqrt[Cos[Pi x]^2] Tan[Pi x] + 2 Floor[x + 1/2] see here [snip] I presume you meant for us to look specifically at Paul Cally's <http://groups.google.com/group/comp.soft-sys.math.mathematica/msg/b1daeacee8a40791>. Besides the fact that x was implicitly assumed to be real, it should be noted that Cally's "correct" result is not fully correct, being Indeterminate when x = (1/2 + an integer). A result which is fully correct follows from the fact, not obtainable by Mathematica AFAIK, that for real u, Abs[Cos[u]] has a continuous antiderivative Sin[u] (-1)^Floor[u/Pi + 1/2] + 2 Floor[u/Pi + 1/2]. Hence, the definite integral considered by Cally is correctly (and also more simply) Sin[Pi x] (-1)^Floor[x + 1/2] + 2 Floor[x + 1/2]. Perhaps a result equivalent to the above already appears at the Wolfram Functions site, but I was unable to find it. It's also interesting to see what the current version does if we try to restrict x so that things should be easy: In[5]:= Integrate[Abs[Cos[u]], {u, 0, Pi x}, Assumptions-> -1/2 <= x <= 1/2] Out[5]= Piecewise[{{1, x == 1/2}, {Sin[Pi*x], -1/2 <= x < 0 || 0 < x < 1/2}}] Strangely, Mathematica's answer is mute for x == 0 and it considers x == 1/2 separately. The simple complete answer is merely Sin[Pi x]. David W. Cantrell