import numpy,sympy
n = sympy.Symbol('n')
f = ((1/n)**2-2*(1/n))/(3*(1/n)**2+(1/n))
print sympy.limit(f,n,0)
import sympy
n = sympy.Symbol('n')
f = 3+(-1)**n
print sympy.limit(f,n,100)
import numpy,sympy
n = sympy.Symbol('n')
print "1+2+3+4+5+6+7+....+n + . . . . . = ",
p = 1/n*(1/n+1)/2
print sympy.limit(p,n,0)
print "5−4−1+5−4−1+5−4−1+5−4−1+.........=0,5,1 according to the no. of terms."
print "clearly, in this case sum doesnt tend to a unique limit. hence, series is oscillatory."
import numpy,sympy
n = sympy.Symbol('n')
v = 1/((1/n)**2)
u = (2/n-1)/(1/n*(1/n +1)*(1/n +2))
print sympy.limit(u/v,n,0)
print "both u and v converge and diverge together, hence u is convergent"
import numpy,sympy
n = sympy.Symbol('n')
v = 1/((1/n)**2)
u = ((1/n)**2)/((3/n+1)*(3/n+4)*(3/n+7))
print sympy.limit(u/v,n,0)
print "both u and v converge and diverge together, hence u is divergent"
import numpy,sympy
n = sympy.Symbol('n')
print "u=((n+1)^0.5−1)/((n+2)^3−1)=>"
u = ((1+1/(1/n))-(1/n)**(-0.5))/(((1/n)**5/2)*((1+2/(1/n))**3-(1/n)**(-3)))
v = (1/n)**(-5/2)
print sympy.limit(u/v,n,0)
print 'since, v is convergent, so u is also conzavergent.'
import numpy,sympy
n = sympy.Symbol('n')
print sympy.integrate(1/(n*sympy.log(n)),(n,2,numpy.inf))
import numpy,sympy
n = sympy.Symbol('n')
x = sympy.Symbol('x')
u = (x**(2*(1/n)-2))/(((1/n)+1)*(1/n)**0.5)
v = (x**(2*(1/n)))/((1/n+2)*(1/n+1)**0.5)
print sympy.limit(u/v,n,0)
import numpy,sympy
n = sympy.Symbol('n')
x = sympy.Symbol('x')
u = ((2**(1/n)-2)*(x**(1/n-1)))/(2**(1/n)+1)
v = ((2**((1/n)+1)-2)*(x**(1/n)))/(2**(1/n+1)+1)
print sympy.limit(u/v,n,0)
import numpy,sympy
n = sympy.Symbol('n')
x = sympy.Symbol('x')
u = 1/(1+x**(-n))
v = 1/(1+x**(-n-1))
print sympy.limit(u/v,n,0)
import numpy,sympy
n = sympy.Symbol('n')
a = sympy.Symbol('a')
b = sympy.Symbol('b')
l = (b+1/n)/(a+1/n)
print sympy.limit(l,n,0)
import numpy,sympy
n = sympy.Symbol('n')
x = sympy.Symbol('x')
print "u=((4.7....(3n+1))∗xˆn)/(1.2.....n)"
print "v=((4.7....(3n+4)∗xˆ(n+1))/(1.2.....(n+1))"
print "l=u/v=>",
l = (1+n)/((3+4*n)*x)
print sympy.limit(l,n,0)
import numpy,sympy,math
n = sympy.Symbol('n')
x = sympy.Symbol('x')
u = (((sympy.factorial(n))**2)*x**(2*n))/sympy.factorial(2*n)
v = (((sympy.factorial(n+1))**2)*x**(2*(n+1)))/sympy.factorial(2*(n+1))
print sympy.limit(u/v,n,numpy.inf )