       Re: "Assuming"

```Andrzej Kozlowski <akoz at mimuw.edu.pl> wrote:
> On 27 Feb 2008, at 00:19, Daniel Lichtblau wrote:
[snip]
> > Here is an example of the behavior in question. I do not pass
> > judgement on whether it should be regarded as a bug or a feature. I
> > simply wanted to give a concrete example where the behavior arises
> > and is difficult to supress.
> >
> > In:= i1 = Integrate[Sin[m*x]*Sin[n*x], {x,0,2*Pi}, Assumptions-
> > >Element[{m,n},Reals]];
> >
> > Check what happens when we assign n->1 and then take limit as m->1.
> >
> > In:= l1 = Limit[i1 /. n->1, m->1]
> > Out= Pi
> >
> > That was fine.

Yes, that limit was fine. But i1 was not valid for all m and n. And indeed
it is that very lack of validity when |m| = |n| which is the common reason
for wishing to find a limit such as l1. This situation can be avoided if we
use an antiderivative for Sin[m*x]*Sin[n*x] which is valid for all m and n:

x/2 (Sinc[(m - n) x] - Sinc[(m + n) x])

Then, applying Newton-Leibniz, we would have gotten

i1alt = Pi (Sinc[2 (m - n) Pi] - Sinc[2 (m + n) Pi])

as an alternative for the definite integral, valid for all m and n.

> > Now see what happens if we assign n->1 and simplify
> > under assumption that m is an arbitrary integer.
> >
> > In:= l2 = Simplify[i1 /. n->1, Element[m,Integers]]
> > Out= 0

In:= Simplify[i1alt /. n -> 1, Element[m, Integers]]
Out= Pi (Sinc[2 (-1 + m) Pi] - Sinc[2 (1 + m) Pi])

In:= FullSimplify[%, Element[m, Integers]]
Out= 0

Thus, Simplify to 0 happened to have been suppressed, but FullSimplify
still gave 0, which I would call a misdemeanor.

> Unless I am missing something obvious (which is possible as I have not
> yet fully woken up) the problem amounts simply to this:
>
> x = (1/2)*(Sin[2*(m - 1)*Pi]/(m - 1) - Sin[2*(m + 1)*Pi]/(m + 1));
>
> In:= Limit[x, m -> 1]
> Out= Pi
>
> In:= Limit[x, m -> 1, Assumptions -> Element[m, Integers]]
> Out= 0
>
> The last answer maybe slightly dubious because it is not perfectly
> clear in what sense the limit is taken here. But it seems to me a very
> minor point and no cause for concern ?

Your In and Daniel's In are asking for different things, a fact which
you probably already noticed, having been awake longer now.

David

```

• Prev by Date: Re: Normalize a collection of arrays on a specific column
• Next by Date: Re: What is the fastest way to threshold data?
• Previous by thread: Re: Re: Re: "Assuming"
• Next by thread: Re: "Assuming"