# lim(y, x=x0) ; #lim(y_,x_,c_,d_) := replace(y,x,c); #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_,c_) := replace(y,x,c); lim(a_^b_, x_,c_) := If(isfree(b,x), lim(a,x,c)^b, e^(lim(b*ln(a), x,c))); lim(a_+b_, x_,c_) := If(isfree(a,x), a+lim(b,x,c), lim(a,x,c)+lim(b,x,c)); 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_/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(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(cos(x_)^2+sin(x_)^2,x_,inf):=1; lim(cosh(x_)^2-sinh(x_)^2,x_,inf):=1; lim(a_/x_,x_,c_) := If(isfree(a,x), NaN,lim(d(a,x),x,c)); lim(1/x_,x_,0) := NaN; #lim(1/x_*sin(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(x_^(-1)*cos(x_),x_,0,right) := infinity; lim(x_^(-1)*cos(x_),x_,0,left) := -inifity; lim(x_^(-1)*tan(x_),x_,0) :=1; lim(x_^(-1)*tan(x_),x_,pi/2,right) :=-infinity; lim(x_^(-1)*tan(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(1/x_,x_,0,right) := infinity; #lim(1/x_,x_,0,left) := -infinity; 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+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(log(x_),x_,0,right) := -infinity; lim(x_*log(x_),x_,0,right) :=0; lim(x_^(-1)*log(x_),x_,0,right) :=-infinity; lim(x_^(-1)*log(x_),x_,infinity) :=0; lim(x_^(-1)*log(1+x_),x_,0) :=1; lim(x_^(-1)*log(1+x_),x_,infinity) :=0; lim(x_^(-1)*log(1+x_),x_,(-1),right) :=infinity; lim(e^(1/x_),x_,0,right) := infinity; lim(e^(1/x_),x_,0,left) := 0; lim(x_*e^(1/x_),x_,0,right) := infinity; lim(x_*e^(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);