First time here? Check out the FAQ!

Ask Your Question
0

Similar limits give very different behavior

asked 12 years ago

Andy gravatar image

The following code produces the expected right answer:

sage: var('x,h')
sage: f(x) = sin(x^2)
sage: lim((f(x+h)-f(x))/h, h=0)

The answer, of course, is 2xcos(x^2). However, the following code fails to complete:

sage: lim((f(pi+h)-f(pi))/h, h=0)

Sage just thinks and thinks and does not come up with an answer. This happens on two different versions I have access to, 5.2 and 5.0. What is happening?

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
0

answered 12 years ago

achrzesz gravatar image

updated 12 years ago

sage: from sympy import Symbol, limit
sage: h=Symbol('h')
sage: limit((sin((pi+h)^2)-sin(pi^2))/h,h,0)
2*pi*cos(pi**2)
Preview: (hide)
link
0

answered 12 years ago

kcrisman gravatar image

For what it's worth, Maxima is the one causing the hang.

(%i1) limit( (sin((h + x)^2) - sin(x^2))/h, h, 0);
                                       2
(%o1)                             2 x cos(x )

(%i3) limit( (sin((%pi+h)^2)-sin(%pi^2))/h,h,0);

But I can't diagnose it any further than that. Replacing %pi with 2 or something does the same (well, unless x=0).

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 12 years ago

Seen: 344 times

Last updated: Sep 04 '12