Ask Your Question

The method lim() does not return a simple integer

asked 2023-11-28 23:33:03 +0100

PatB gravatar image

updated 2023-11-29 04:06:49 +0100


I have two cases where I would expect the answer to be a simple integer when I take the limit using lim(..)


This answer should be 1. Instead I get: 1/2*I + 1/2


Similarly, the answer should be 0

Instead I get this form:

-5/52*I + 1/52

Question: Am I using the right method, od do I need to add more constraints ?

thanks Pat

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2023-11-29 00:26:14 +0100

updated 2023-11-29 06:15:41 +0100

i is predefined in Sage to be the square root of $-1$, so it doesn't really make sense to take a limit as it varies. If you instead do either



var('i')  # make "i" a variable

then you'll get the answer you expect.

edit flag offensive delete link more


Thanks very much John - good catch!

PatB gravatar imagePatB ( 2023-11-30 05:58:52 +0100 )edit

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2023-11-28 23:33:03 +0100

Seen: 48 times

Last updated: Nov 30 '23