Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Bug with Limit?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74258] Re: Bug with Limit?
  • From: "dimitris" <dimmechan at yahoo.com>
  • Date: Thu, 15 Mar 2007 19:11:04 -0500 (EST)
  • References: <200703021134.GAA03672@smc.vnet.net><esb4eh$3ql$1@smc.vnet.net>

I agree in some level with what you said. But not totally.

I don't believe what commands I used to "dig around"
are exotic to a naive user. Quite the opposite!
May be the way I present them it was not the proper
one for a naive user.

But when someone takes the first steps in Mathematica one of the most
important
things he know (or he should have known!) is how to get information
about one command.

Apart from the Help Browser there is the following Text-Based
Interface
setting.

??FunctionName

So here we have

?? Limit
Limit[expr, x->x0] finds the limiting value of expr when x approaches
x0.
Options[Limit] = {Analytic -> False, Assumptions :> $Assumptions,
Direction -> Automatic}

What now a naive user with a correct attitude will do?
Continue to apply Limit blindly or investigate what are Options
in first step and then what are the Options of Limit in particular?

When you learnt to evaluate a definite integral you don't learn first
WHEN you can apply it?

Like mathematics, Mathematica needs from you to know some things
for it built in functions before aplying them (and no blind
application!).
That means, of course, that you don't need to know the implementation
algorithm of
Integrate for example (except you are interested in like me!) but
rather than to know e.g.
(or learn by Mathematica book, this forum and handrends of sources!)
that Mathematica may not
 return an indefinite integral similar with you have evaluated by
hand, or similar to what you have seen to a calculus book.
And moreover it will not return the well known constant of
integration.

Let for example

In[162]:=
f = 1/Sqrt[s^2 - x^2];

Then

In[164]:=
ff = Integrate[1/Sqrt[s^2 - x^2], x]
Out[164]=
-ArcTan[(x*Sqrt[s^2 - x^2])/(-s^2 + x^2)]

In[168]:=
D[ff, x]
Simplify[%] == f

Out[168]=
-((-((2*x^2*Sqrt[s^2 - x^2])/(-s^2 + x^2)^2) - x^2/(Sqrt[s^2 - x^2]*(-
s^2 + x^2)) + Sqrt[s^2 - x^2]/(-s^2 + x^2))/
   (1 + (x^2*(s^2 - x^2))/(-s^2 + x^2)^2))
Out[169]=
True

Note that in order to check you should apply Simplify.

By hand, one could work-say that s is real-(I use Mathenatica to
follow these steps!)

In[214]:=
integrand = f*dx /. x -> s*Sin[u] /. dx -> D[s*Sin[u], u]
FullSimplify[integrand,Element[s,Reals]&&0=E2=89=A4u=E2=89=A4Pi/2]
Integrate[%, u]
fff=% /. u -> ArcSin[x/s]
FullSimplify[D[%, x], Element[s,Reals]&&] == f

Out[214]=
(s*Cos[u])/Sqrt[s^2 - s^2*Sin[u]^2]
Out[215]=
Sign[s]
Out[216]=
u*Sign[s]
Out[217]=
ArcSin[x/s]*Sign[s]
Out[218]=
True

Note now

In[234]:=
ff - fff
D[%, x]
FullSimplify[%, Element[s,Reals]]

Out[234]=
-ArcTan[(x*Sqrt[s^2 - x^2])/(-s^2 + x^2)] - ArcSin[x/s]*Sign[s]
Out[235]=
-((-((2*x^2*Sqrt[s^2 - x^2])/(-s^2 + x^2)^2) - x^2/(Sqrt[s^2 - x^2]*(-
s^2 + x^2)) + Sqrt[s^2 - x^2]/(-s^2 + x^2))/
    (1 + (x^2*(s^2 - x^2))/(-s^2 + x^2)^2)) - Sign[s]/(s*Sqrt[1 - x^2/
s^2])
Out[236]=
0

as it should be!


Let return now to Limit. We saw that

?? Limit
Limit[expr, x->x0] finds the limiting value of expr when x approaches
x0.
Options[Limit] = {Analytic -> False, Assumptions :> $Assumptions,
Direction -> Automatic}

So what is Options.

??Options
Options[symbol] gives the list of default options assigned to a
symbol. \
Options[expr] gives the options explicitly specified in a particular \
expression such as a graphics object. Options[stream] or
Options["sname"] \
gives options associated with a particular stream. Options[object]
gives \
options associated with an external object such as a NotebookObject. \
Options[obj, name] gives the setting for the option name. Options[obj,
\
{name1, name2, ... }] gives a list of the settings for the options
namei.
Attributes[Options] = {Protected}

What do they mean the Options of Limit in particular?

??Analytic

Analytic is an option for Limit and Series. With Analytic -> True, \
unrecognized functions are treated as analytic, and processed using
Taylor \
series expansions; with Analytic -> False, Taylor series are not used
unless \
the function is recognized as analytic.
Attributes[Analytic] = {Protected}

?? Assumptions
Assumptions is an option for functions such as Simplify, Refine and
Integrate \
which specifies default assumptions to be made about symbolic
quantities.
Attributes[Assumptions] = {Protected}

??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.
Attributes[Direction] = {Protected}

(Note the presence of the hyperlink to the Help Browser by cliking
More!)

Now the question is what are the Attributes but that's the end of
lesson 1!


Best Regards
Dimitris








=CE=9F/=CE=97 Eric Smith =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5:
> I wrote:
> > Making the documentation clear is a problem for the designers
> > of Mathematica.
>
> "dimitris" <dimmechan at yahoo.com> writes:
> > Everything is clear and "out there"...(at least for me!)
>
> I went to the Help Browser page for the Limit function, and the
> way the page was written did not suggest that a Limit with no
> direction specified would use a default direction.
>
> I have no doubt that you can dig around with a much of commands
> like you showed in your posting, and figure it out.  That was
> not my point.  Naive users like me expect the help browser to
> provide this sort of information.  Especially when we've been
> taught (incorrectly, according to some people in this forum)
> that the mathematical definition of a limit is that it has
> the same value from all directions, unless a direction has been
> specified.  Expert mathematicians may know otherwise, but
> many of the common introductory calculus textbooks present it
> that way.  Thus if Mathematica does it differently (undoubtedly
> for very good reasons), the Help Browser should explain it,
> without the user needing to do a lot of extra digging.
>
> Eric



  • References:
  • Prev by Date: Re: Triangular Distribution in Mathematica
  • Next by Date: Mathematica 4.0
  • Previous by thread: Re: Bug with Limit?
  • Next by thread: Re: Bug with Limit?