1 view

Skip to first unread message

Oct 12, 2004, 2:03:16 AM10/12/04

to

Hi,

I'd like to find the limit of

Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0]

I use Mathematica v.5. I get the wrong (??) answer : 1

While I try to display the graph of this function by using "Plot", it

seems that there is no limit at the point x=0.

Please help...

Amir

Oct 14, 2004, 6:49:30 AM10/14/04

to

Amir ha scritto:

Try with:

Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0,Direction->1]

and you will get the answer as x approaches to x0 from smaller values

(odd limit). Read mathematica help for more informations on Limit[] and

Direction option.

Regards.

Matteo Delfino

Oct 14, 2004, 6:58:36 AM10/14/04

to

Amir wrote:

> Hi,

>

> I'd like to find the limit of

> Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0]

>

> I use Mathematica v.5. I get the wrong (??) answer : 1

Unfortunately, Mathematica by default takes the limit from the right,

and does not check to see if it's the same as the limit from the left.

It does not actually do a two-sided limit. In any example where the

one-sided limits are not the same, instead of an error message that

the limit does not exist, Mathematica instead gives you the limit from

the right. Worse, there's nothing in the Help that even tells you that

Limit means "limit from the right" unless you specify the left.

It will do the one-sided limits correctly if you ask for them separately.

To find the limit as x->0 from the right:

Limit[(Abs[Sin[x] - Sin[2 x]])/x, x -> 0, Direction -> -1]

To find the limit as x->0 from the left:

Limit[(Abs[Sin[x] - Sin[2 x]])/x, x -> 0, Direction -> 1]

In effect,

Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0]

is the same as

Limit[(Abs[Sin[x] - Sin[2 x]])/x, x -> 0, Direction -> -1]

and is *not* a two-sided limit.

(I don't like it either.)

--

Helen Read

University of Vermont

Oct 14, 2004, 6:57:36 AM10/14/04

to

Strictly speaking Direction option has to be specified.

The default is "Automatic" but in this case Mathematica takes (seemingly)

Direction-> -1 as default.

Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0,Direction->-1]

Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0,Direction->1]

will give you two right answers (that are not equal.)

The truth of the matter is, that Calculus-type functions do not handle

Abs very well and if possible I use other things, e.g. UnitStep.

P.

The default is "Automatic" but in this case Mathematica takes (seemingly)

Direction-> -1 as default.

Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0,Direction->-1]

Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0,Direction->1]

will give you two right answers (that are not equal.)

The truth of the matter is, that Calculus-type functions do not handle

Abs very well and if possible I use other things, e.g. UnitStep.

P.

Amir <z64...@netscape.net> wrote in message news:<ckfs34$isl$1...@smc.vnet.net>...

Oct 14, 2004, 6:48:29 AM10/14/04

to

On 12 Oct 2004, at 14:57, Amir wrote:

>

> Hi,

>

> I'd like to find the limit of

> Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0]

>

> I use Mathematica v.5. I get the wrong (??) answer : 1

>

> While I try to display the graph of this function by using "Plot", it

> seems that there is no limit at the point x=0.

> Please help...

>

> Amir

>

Mathematica's answer is correct but ... Limit always computes

directional limits. Thus:

Limit[Abs[Sin[x] - Sin[2*x]]/x, x -> 0, Direction -> -1]

1

but

Limit[Abs[Sin[x] - Sin[2*x]]/x, x -> 0, Direction -> 1]

-1

So the limits as x goes to 0 form above and form below are different

and thus "there is n limit'.

Also, as you see by default Limit computes "from above". However, I

still can't find this clearly documented in version 5, even though I

remeber myself (and others) complaining about this lack of

documentation in version 4 (if not earlier).

Andrzej Kozlowski

Chiba, Japan

http://www.akikoz.net/~andrzej/

http://www.mimuw.edu.pl/~akoz/

Oct 14, 2004, 7:28:09 AM10/14/04

to

Using the option Direction (limit from below/above) solves the problem:

In[6]:=

Limit[Abs[Sin[x] - Sin[2*x]]/x, x -> 0, Direction -> 1]

Out[6]=

-1

In[5]:=

Limit[Abs[Sin[x] - Sin[2*x]]/x, x -> 0, Direction -> -1]

Out[5]=

1

Wolfgang

Oct 14, 2004, 7:26:04 AM10/14/04

to

"Amir"

>Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0]

>

>I use Mathematica v.5. I get the wrong (??) answer : 1

>

>While I try to display the graph of this function by using "Plot", it

>seems that there is no limit at the point x=0.

Yep, the limit from the left is -1, while that from the right is +1.

They can hardly agree in zero. : ]

Ultimately your limit is equivalent to that of Abs[x]/x for x->0

You should load the package Calculus`Limit` to compute limits with

discontinuos functions such as Abs.

(But don't forget, as you've just done, to double check the result you get).

cheers,

Peltio

Invalid address in reply-to. Crafty demunging required to mail me.

Oct 14, 2004, 7:17:55 AM10/14/04

to

If a function is not continuous - which is the case here - you have to use

the Direction option :

In[1]:=Limit[Abs[Sin[x] - Sin[2x]]/x, x -> 0, Direction -> -1]

Out[1]=1

In[2]:=Limit[Abs[Sin[x] - Sin[2x]]/x, x -> 0, Direction -> 1]

Out[2]=-1

v.a.

--

0% de pub! Que du bonheur et des vrais adhérents !

Vous aussi inscrivez-vous sans plus tarder!!

Message posté à partir de http://www.gyptis.org, BBS actif depuis 1995.

Oct 14, 2004, 6:59:37 AM10/14/04

to

That's the right answer, and a Plot confirms it at my machine.

f[x_] = (Sin[x] - Sin[2*x])/x;

Limit[f[x], x -> 0]

-1

Limit[Abs[f[x]], x -> 0]

1

Plot[f[x], {x, -1, 1}]

A look at the Series representations makes the answer very clear:

Series[Sin[x], {x, 0, 5}]

Series[Sin[2*x], {x, 0, 5}]

(%% - %)/x

SeriesData[x, 0, {1, 0, -1/6, 0, 1/120}, 1, 6, 1]

SeriesData[x, 0, {2, 0, -4/3, 0, 4/15}, 1, 6, 1]

SeriesData[x, 0, {-1, 0, 7/6, 0, -31/120}, 0, 5, 1]

Or, in even simpler terms, when x is close to 0, Sin[x] is close to x and Sin[2x] is close to 2x, so their difference is close to -x. Divide by x, and that's close to -1. Take Abs and you get 1.

Bobby

On Tue, 12 Oct 2004 01:57:42 -0400 (EDT), Amir <z64...@netscape.net> wrote:

> Hi,

>

> I'd like to find the limit of

> Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0]

>

> I use Mathematica v.5. I get the wrong (??) answer : 1

>

> While I try to display the graph of this function by using "Plot", it

> seems that there is no limit at the point x=0.

> Please help...

>

> Amir

>

>

>

>

Oct 15, 2004, 3:14:27 AM10/15/04

to

The documentation is there in the front end (at least in Mathematica

5.0.1), just not in The Mathematica Book:

5.0.1), just not in The Mathematica Book:

Options[Limit]

{Analytic -> False, Assumptions :> $Assumptions, Direction -> Automatic}

?Direction

Direction is an option for Limit. Limit[expr, x -> x0, Direction -> 1]

computes the limit as x approaches x0 from smaller values. Limit[expr, x

-> x0, Direction -> -1] computes the limit as x approaches x0 from

larger values. Direction -> Automatic uses Direction -> -1 except for

limits at Infinity, where it is equivalent to Direction -> 1.

Andrzej Kozlowski wrote:

> On 12 Oct 2004, at 14:57, Amir wrote:

>

>

>>Hi,

>>

>>I'd like to find the limit of

>>Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0]

>>

>>I use Mathematica v.5. I get the wrong (??) answer : 1

>>

>>While I try to display the graph of this function by using "Plot", it

>>seems that there is no limit at the point x=0.

>>Please help...

>>

>>Amir

>>

>

>

> Mathematica's answer is correct but ... Limit always computes

> directional limits. Thus:

>

>

> Limit[Abs[Sin[x] - Sin[2*x]]/x, x -> 0, Direction -> -1]

>

> 1

>

> but

>

> Limit[Abs[Sin[x] - Sin[2*x]]/x, x -> 0, Direction -> 1]

>

> -1

>

> So the limits as x goes to 0 form above and form below are different

> and thus "there is n limit'.

>

> Also, as you see by default Limit computes "from above". However, I

> still can't find this clearly documented in version 5, even though I

> remeber myself (and others) complaining about this lack of

> documentation in version 4 (if not earlier).

>

>

>

>

> Andrzej Kozlowski

> Chiba, Japan

> http://www.akikoz.net/~andrzej/

> http://www.mimuw.edu.pl/~akoz/

>

>

>

--

Murray Eisenberg mur...@math.umass.edu

Mathematics & Statistics Dept.

Lederle Graduate Research Tower phone 413 549-1020 (H)

University of Massachusetts 413 545-2859 (W)

710 North Pleasant Street fax 413 545-1801

Amherst, MA 01003-9305

Oct 15, 2004, 3:09:23 AM10/15/04

to

Helen Read wrote:

> Amir wrote:

>

>

>>Hi,

>>

>>I'd like to find the limit of

>>Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0]

>>

>>I use Mathematica v.5. I get the wrong (??) answer : 1

>

>

>

> In effect,

>

> Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0]

>

> Amir wrote:

>

>

>>Hi,

>>

>>I'd like to find the limit of

>>Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0]

>>

>>I use Mathematica v.5. I get the wrong (??) answer : 1

>

>

> Unfortunately, Mathematica by default takes the limit from the right,

> and does not check to see if it's the same as the limit from the left.

> It does not actually do a two-sided limit. In any example where the

> one-sided limits are not the same, instead of an error message that

> the limit does not exist, Mathematica instead gives you the limit from

> the right. Worse, there's nothing in the Help that even tells you that

> Limit means "limit from the right" unless you specify the left.

>

> It will do the one-sided limits correctly if you ask for them separately.

>

> To find the limit as x->0 from the right:

>

> Limit[(Abs[Sin[x] - Sin[2 x]])/x, x -> 0, Direction -> -1]

>

> To find the limit as x->0 from the left:

>

> Limit[(Abs[Sin[x] - Sin[2 x]])/x, x -> 0, Direction -> 1]> and does not check to see if it's the same as the limit from the left.

> It does not actually do a two-sided limit. In any example where the

> one-sided limits are not the same, instead of an error message that

> the limit does not exist, Mathematica instead gives you the limit from

> the right. Worse, there's nothing in the Help that even tells you that

> Limit means "limit from the right" unless you specify the left.

>

> It will do the one-sided limits correctly if you ask for them separately.

>

> To find the limit as x->0 from the right:

>

> Limit[(Abs[Sin[x] - Sin[2 x]])/x, x -> 0, Direction -> -1]

>

> To find the limit as x->0 from the left:

>

>

> In effect,

>

> Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0]

>

> is the same as

>

> Limit[(Abs[Sin[x] - Sin[2 x]])/x, x -> 0, Direction -> -1]

>

> and is *not* a two-sided limit.

>

> (I don't like it either.)

>

> --

> Helen Read

> University of Vermont

>

> Limit[(Abs[Sin[x] - Sin[2 x]])/x, x -> 0, Direction -> -1]

>

> and is *not* a two-sided limit.

>

> (I don't like it either.)

>

> --

> Helen Read

> University of Vermont

For an explanation of why the notion of a "two sided limit" makes little

sense for a general Limit function, I refer to a prior post to MathGroup:

http://forums.wolfram.com/mathgroup/archive/2001/Nov/msg00190.html

I tend to agree that the default behavior of Direction->Automatic

warrants explicit documentation.

Daniel Lichtblau

Wolfram Research

Oct 16, 2004, 4:28:29 AM10/16/04

to

Yes, you are right. But, as I am sure Bobby Treat would agree ;-) , it

ought to be under Limit. The point is that unless you have a reason to

suspect that Limit by default computes directional limits it is

unlikely you will look under Direction to find out. But I have to agree

that I was wrong: the long ago made promise to put this into the

documentation was kept, even though, in my opinion, not in the most

natural way.

ought to be under Limit. The point is that unless you have a reason to

suspect that Limit by default computes directional limits it is

unlikely you will look under Direction to find out. But I have to agree

that I was wrong: the long ago made promise to put this into the

documentation was kept, even though, in my opinion, not in the most

natural way.

Andrzej

On 15 Oct 2004, at 15:46, Murray Eisenberg wrote:

> The documentation is there in the front end (at least in Mathematica

> 5.0.1), just not in The Mathematica Book:

>

> Options[Limit]

> {Analytic -> False, Assumptions :> $Assumptions, Direction ->

> Automatic}

>

> ?Direction

> Direction is an option for Limit. Limit[expr, x -> x0, Direction -> 1]

> computes the limit as x approaches x0 from smaller values. Limit[expr,

> x

> -> x0, Direction -> -1] computes the limit as x approaches x0 from

> larger values. Direction -> Automatic uses Direction -> -1 except for

> limits at Infinity, where it is equivalent to Direction -> 1.

>

>

> Andrzej Kozlowski wrote:

>> On 12 Oct 2004, at 14:57, Amir wrote:

>>

>>

>>> Hi,

>>>

>>> I'd like to find the limit of

>>> Limit[(Abs[Sin[x]-Sin[2 x]]) / x, x->0]

>>>

>>> I use Mathematica v.5. I get the wrong (??) answer : 1

>>>

Oct 17, 2004, 3:31:27 AM10/17/04

to

>> But, as I am sure Bobby Treat would agree, itought to be under Limit.

You got THAT right.

Bobby

Reply all

Reply to author

Forward

0 new messages

Search

Clear search

Close search

Google apps

Main menu