# lim(y, x=x0) ; #lim(k_*y_,x_,c_,d_) := If(isfree(k,x), k*lim(y,x,c,d)); #lim(k_+y_,x_,c_,d_) := If(isfree(k,x), k+lim(y,x,c,d)); #lim(y_, x_,oo) := replace(y,x,oo); lim(a_^b_, x_,c_) := If(isfree(b,x), lim(a,x,c)^b, exp(lim(b*ln(a), x,c))); lim(a_+b_, x_,inf) := If(isfree(a,x), a+lim(b,x,inf), lim(a,x,inf)+lim(b,x,inf)); #lim(a_*b_, x_,inf) := If(has(a,exp(-x)) or has(b,exp(-x)), 0, lim(d(a,x),x,inf)*lim(d(b,x),x,inf)); #lim(a_/b_, x_,c_) := If(isfree(a,x), a/lim(b,x,c), lim(d(a,x),x,c)/lim(d(b,x),x,c)); #lim(a_^(-1)*b_,x_,c_) := block(f:=d(b,x)/d(a,x), lim(f,x,c)); #lim(a_*b_^(-1),x_,c_) := block(f:=d(a,x)/d(b,x), lim(f,x,c)); #lim(a_^(-1)*b_,x_,c_) := block(f:=d(b,x)/d(a,x), lim(f,x,c)); lim((f(x_+h_)-f(x_))/h_, h_,0) := d(f(x)); lim(sum(y_,k_,a_,n_),n_,Infinity):=sum(y,k,a,oo); lim(sums(y_,k_,a_,n_),n_,Infinity):=sum(y,k,a,oo); #lim(x_*infsums(y_,k_),k_,infinity):= If(isatom(x),x*sum(y,k,infinity)); #lim(infsums(y_,k_)/x_,k_,infinity):= 1/x*sum(y,k,infinity); #lim(infsums(y_,k_),k_,infinity):= infsum(y,k); #lim(infsums((-1)^(k_-1)*x_^k_/k_),k_,infinity) := log(1+x); #lim(infsums(k_*x_^(k_-1),k_),k_,infinity):=1/(x-1)^2; lim(a_/x_,x_,0) := If(isfree(a,x), NaN); lim(1/x_,x_,0) := NaN; lim(sin(x_)/x_,x_,inf):=0; lim(sin(1/x_)*x_,x_,oo):=1; lim(sin(1/x_)*x_,x_,-oo):=1; lim(sin(x_)/x_,x_,0):=1; lim(sin(a_*x_)/x_,x_,0):=if(hasnot(a,x),a); lim(sin(a_*x_)/sin(b_*x_),x_,0):=if(hasnot(a,b,x),a/b); lim(cos(x_)/x_,x_,0,right) := infinity; lim(cos(x_)/x_,x_,0,left) := -inifity; #lim(x_^(-1)*tan(x_),x_,0) :=1; lim(tan(x_)/x_,x_,pi/2,right) :=-infinity; lim(tan(x_)/x_,x_,pi/2,left) :=infinity; lim(x_^n_,x_,0,right) := If(n<0,infinity, If(n>0, 0)); lim(x_^n_,x_,0,left) := If(n<0, If(iseven(n), infinity, If(isodd(n), -inf )), If(n>0, 0)); lim(x_/(1+x_),x_,0) := 0; lim(1/x_*(1+x_),x_,infinity) := 1; lim(x_^x_,x_,0) :=1; lim(x_^x_,x_,-inf):=0; lim(x_^sin(x_),x_,0):=1; lim((1+1/x_)^x_,x_,0,right) :=1; lim((1+1/x_)^x_,x_,0,left) :=infinity; lim((1+x_)^(a_/x_),x_,0) :=exp(a); lim((1+x_)^(1/x_),x_,0) :=e; lim((1+1/x_)^x_,x_,infinity) :=e; lim((1-1/x_)^x_,x_,infinity) := exp(-1); lim((1+1/k_)^(k_*a_),k_,infinity) :=exp(a); lim((1+1/k_)^(k_*x_),k_,infinity) :=exp(x); lim((1-1/k_)^(k_*a_),k_,infinity) :=exp(-a); lim((1+x_/k_)^k_,k_,infinity) :=exp(x); lim((1+a_/k_)^k_,k_,infinity) :=exp(a); lim((1-a_/k_)^k_,k_,infinity) :=exp(-a); lim(x_*log(x_),x_,0,right) :=0; lim(log(x_)/x_,x_,0,right) :=-infinity; lim(log(x_)/x_,x_,infinity) :=0; #lim(log(1+x_)/x_,x_,0) :=1; lim(log(1+x_)/x_,x_,infinity) :=0; lim(log(1+x_)/x_,x_,(-1),right) :=infinity; lim(log(x_),x_,0,right) := -infinity; lim(log(x_),x_,0,left) := -infinity; lim(log(x_),x_,0) := -infinity; lim(exp(1/x_),x_,0,right) := infinity; lim(exp(1/x_),x_,0,left) := 0; lim(x_*exp(1/x_),x_,0,right) := infinity; lim(x_*exp(1/x_),x_,0, left) := 0; lim(y_,x_):=lim(y,x,0); lim(y_,x_=a_) := lim(y,x,a); lim(y_,x_=a_,c_) := lim(y,x,a,c); lim(y_):=lim(y,x,0);