sodis
sodis

Reputation: 71

Why the result was different in python Sympy.limit?

I guess both of them are equal(in python/sympy):

from sympy import *

x = Symbol('x')

limit(sin(x)/x,x,0)

#(result 1)

limit(sin(1/x)*x,x,00)

#(result 0 !!!)

In actually, let y = 1/x, limit(sin(1/x)*x,x,00) = limit(sin(y)/y,y,0), right?

(in anaconda 64-bit,ipython notebook, python 2.7, sympy0.7.6)

Upvotes: 4

Views: 2824

Answers (2)

Ray Ronnaret
Ray Ronnaret

Reputation: 166

To more exactly, use sympy.oo

import sympy as sym
from IPython.display import display,Math
fx = (1+1/x)**x
lim_pnt = sym.oo
lim = sym.limit(fx,x,lim_pnt)

display(Math('\\lim_{x\\to %s} %s = %s' %(lim_pnt,sym.latex(fx),sym.latex(lim))))

Upvotes: 3

bubble
bubble

Reputation: 1672

Try to use oo (oo is infinity) instead of 00.

Upvotes: 4

Related Questions