       Re: Simple integral wrong

• To: mathgroup at smc.vnet.net
• Subject: [mg25073] Re: Simple integral wrong
• From: Paul Cally <cally at kronos.maths.monash.edu.au>
• Date: Thu, 7 Sep 2000 22:28:17 -0400 (EDT)
• Organization: Monash University
• References: <8opmr5\$15@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Paul Cally wrote:

> Try integrating | cos u| from u=0 to u = Pi x. Despite the integrand
> being everywhere
> non-negative, Mathematica 4 gives a result which jumps DOWNWARDS by 2 at
>
> x=1/2, 3/2, 5/2, .... I thought these simple integration errors had been
> sorted out by
> Wolfram years ago!
>
> Paul Cally
>
> --
>
> +--------------------------------------------------------------------------+
> |Assoc Prof Paul Cally            |    Ph:  +61 3 9905-4471                |
> |Dept of Mathematics & Statistics |    Fax: +61 3 9905-3867                |
> |Monash University                |    paul.cally at sci.monash.edu.au        |
> |PO Box 28M, Victoria 3800        |                                        |
> |AUSTRALIA                        | http://www.maths.monash.edu.au/~cally/ |
> +--------------------------------------------------------------------------+

Here is
the full story:

A couple of people told me that

Plot[Integrate[Abs[Cos[u]], {u, 0, x  Pi]}], {x, 0, 3}]

works fine. The result is monotonic increasing as expected.

But try

Plot[Evaluate[Integrate[Abs[Cos[u]],{u,0,Pi*x}]],{x,0,3}]

and see what happens! The evaluate forces Mathematica to do the
integral symbolically. It was doing it numerically without the Evaluate.

Or just type

Integrate[Abs[Cos[u]],{u,0,Pi x}]

Mathematica 4 returns

2
Out= Sqrt[Cos[Pi x] ] Tan[Pi x]

(Actually, I don't think Mathematica 3 can do it at all.) This
plots as a saw-tooth. The true solution should be

Sqrt[Cos[Pi x]^2] Tan[Pi x] + 2 Floor[x + 1/2]

Mathematica misses the step functions necessary to make the solution
continuous.

Paul Cally

--

+--------------------------------------------------------------------------+
|Assoc Prof Paul Cally            |    Ph:  +61 3 9905-4471                |
|Dept of Mathematics & Statistics |    Fax: +61 3 9905-3867                |
|Monash University                |    paul.cally at sci.monash.edu.au        |
|PO Box 28M, Victoria 3800        |                                        |
|AUSTRALIA                        | http://www.maths.monash.edu.au/~cally/ |
+--------------------------------------------------------------------------+

```

• Prev by Date: Re: newbie PolarPlot question
• Next by Date: Re: Simple integral wrong
• Previous by thread: Re: Simple integral wrong
• Next by thread: Re: Simple integral wrong