Stefano added to README and credits
[sympy.git] / examples / limits_examples.py
blob78394515f81c38dbbad3f27cddb652222f927698
1 #!/usr/bin/env python
2 import iam_sympy_example
4 from sympy import exp,log,Symbol,Rational,sin,limit, sqrt,oo
6 x=Symbol("x")
7 a=Symbol("a")
8 h=Symbol("h")
10 def sqrt3(x):
11 return x**Rational(1,3)
13 def show(computed, correct):
14 print "computed:",computed,"correct:",correct
16 show( limit(sqrt(x**2-5*x+6)-x,x,oo) , -Rational(5)/2 )
17 #show( limit(x*(sqrt(x**2+1)-x),x,oo) , Rational(1)/2 )
18 show( limit(x-sqrt3(x**3-1),x,oo) , Rational(0) )
19 show( limit(log(1+exp(x))/x,x,-oo) , Rational(0) )
20 show( limit(log(1+exp(x))/x,x,oo) , Rational(1) )
21 show( limit(sin(3*x)/x,x,0) , Rational(3) )
22 show( limit(sin(5*x)/sin(2*x),x,0) , Rational(5)/2 )
23 #show( limit(((x-1)/(x+1))**x,x,oo) , exp(-2))