simplify(a_ and b_):=simplify(a) and simplify(b); simplify(a_=b_):=simplify(a)=simplify(b); simplify(log(x_+sqrt(1+x_^2))):=asinh(x); simplify(log(x_+sqrt(x_^2-1))):=acosh(x); simplify(log((1+x_)/(x_-1))):= 2acoth(x); simplify(log((1+x_)/(1-x_))):= 2atanh(x); simplify(Gamma(x_-1)/Gamma(x_)):=1/(x-1); simplify(Gamma(x_)/Gamma(x_-1)):= x-1; simplify(sin(x_)^n_):=if(n<0,csc(x)^(-n)); simplify(cos(x_)^n_):=if(n<0,sec(x)^(-n)); simplify(tan(x_)^n_):=if(n<0,cot(x)^(-n)); simplify(cot(x_)^n_):=if(n<0,tan(x)^(-n)); simplify(csc(x_)^n_):=if(n<0,sin(x)^(-n)); simplify(sec(x_)^n_):=if(n<0,cos(x)^(-n)); simplify(1/cos(x_)*sin(x_)):=tan(x); simplify(cos(x_)/sin(x_)):=cot(x); simplify(atan(1/x_)):=acot(x); simplify(acos(1/x_)):=asec(x); simplify(asin(1/x_)):=acsc(x); simplify(a_*e^(-x_)+b_*e^(x_)):= If(a==-b, 2b*sinh(x)); simplify(a_*e^(-x_)-a_*e^(x_)):= -2a*sinh(x); simplify(a_*e^(x_)-a_*e^(-x_)):= 2a*sinh(x); simplify(a_*e^(-x_)+a_*e^(x_)):= 2a*cosh(x); simplify(e^(-x_)+e^(x_)):= 2cosh(x); simplify(e^(x_)-e^(-x_)):= 2sinh(x); simplify(e^(-x_)-e^(x_)):= -2sinh(x); simplify(a_*e^(-i*x_)-a_*e^(i*x_)):= -2a*i*sin(x); simplify(a_*e^(-i*x_)+(-a_)*e^(i*x_)):= 2a*i*sin(x); simplify(a_*e^(-i*x_)+a_*e^(i*x_)):= 2a*cos(x); simplify(1/tanh(x_)):=coth(x); simplify(1/sinh(x_)):=csch(x); simplify(1/cosh(x_)):=sech(x); simplify(1/coth(x_)):=tanh(x); simplify(1/csch(x_)):=sinh(x); simplify(1/sech(x_)):=cosh(x); simplify(1/cosh(x_)*sinh(x_)):=tanh(x); simplify(cosh(x_)/sinh(x_)):=coth(x); simplify(log(x_+(1+x_^2)^(1/2))):=asinh(x); simplify(log(x_+(x_^2-1)^(1/2))):=acosh(x); simplify(atanh(1/x_)):=acoth(x); simplify(acosh(1/x_)):=asech(x); simplify(asinh(1/x_)):=acsch(x); simplify(x_+(1+x_^2)^(1/2)):=exp(asinh(x)); simplify(x_+(x_^2-1)^(1/2)):=exp(acosh(x)); simplify(sin(i*x_)):= -i*sinh(x); simplify(cos(i*x_)):= cosh(x); simplify(tan(i*x_)):= i*tanh(x); simplify(asin(i*x_)):= -i*asinh(-x); simplify(acos(i*x_)):= -i*acosh(-x); simplify(atan(i*x_)):= i*atanh(x); simplify(sinh(i*x_)):= -i*sin(x); simplify(cosh(i*x_)):= cos(x); simplify(tanh(i*x_)):= i*tan(x); simplify(asinh(i*x_)):= -i*asin(-x); simplify(acosh(i*x_)):= -i*acos(-x); simplify(atanh(i*x_)):= i*atan(x); simplify(sgn(x_)*abs(x_)):=x; simplify(x_/abs(x_)):=sgn(x); simplify(x_/sgn(x_)):=abs(x); simplify(e^(a_*log(x_))):=x^a; simplify(e^(log(x_))):=x; simplify(cos(x_)*sin(x_)) := sin(2x)/2; simplify(sin(a_)*cos(b_)+cos(a_)*sin(b_)):=sin(a+b); simplify(sin(a_)*cos(b_)-cos(a_)*sin(b_)):=sin(a-b); simplify(cos(a_)*cos(b_)- sin(a_)*sin(b_)):=cos(a+b); simplify(cos(a_)*cos(b_)+ sin(a_)*sin(b_)):=cos(a-b); simplify((x_^n_-1)/(x_-1)):=If(n>0, sum(x^k,k,0,n-1,1)); simplify((x_^n_-1)/(1-x_)):=If(n>0, sum(-x^k,k,0,n-1,1)); simplify((1-x_^n_)/(x_-1)):=If(n>0, sum(-x^k,k,0,n-1,1)); simplify((1-x_^n_)/(1-x_)):=If(n>0, sum(x^k,k,0,n-1,1)); simplify(x_/(2-3*x_+x_^2)):=2/(x-2)-1/(x-1); simplify(cosh(x_)+sinh(x_)):=exp(x); simplify(cosh(x_)-sinh(x_)):=exp(-x); simplify(cosh(x_)^2-sinh(x_)^2):=1; simplify(cos(x_)^2+sin(x_)^2):=1; simplify(sec(x_)^2-tan(x_)^2):=1; simplify(csc(x_)^2-cot(x_)^2):=1; simplify(tan(x_)^2-sec(x_)^2):= -1; simplify(-1+sin(x_)^2):= -cos(x)^2; simplify(-1+cos(x_)^2):= -sin(x)^2; simplify(1/(exp(a_)+exp(b_))):=exp(-a)/(exp(b-a)+1); simplify((-a_)^n_):=if(iseven(n),a^n, if(isodd(n),-a^n )); simplify(sqrt(x_)):=x^(1/2); simplify(cbrt(x_)):=x^(1/3); simplify(exp(x_)):=e^x; simplify(mittag(a_,b_)*mittag(a_,c_)):=mittag(a,b+c); simplify(mittag(a_,b_)^(-1)):=mittag(a,-b); simplify((-a_)*b_):= -simplify(a*b); simplify(GammaQ(a_,x_)*Gamma(a_)):=Gamma(a,x); simplify(Gamma(a_,x_)/GammaQ(a_,x_)):=Gamma(a);