simplify(a_ and b_):=simplify(a) and simplify(b); simplify(a_=b_):=simplify(a)-simplify(b)=0; simplify(a_ * b_):=simplify(a) * simplify(b); simplify(a_ + b_):=simplify(a) + simplify(b); simplify(-a_ * b_):= -simplify(a*b); simplify(taylors(x_=>f_,x_,x0_,n_)):=taylor(f,x,x0,n); simplify(taylors(x_=>f_,x_)):=taylor(f,x); simplify(semids(x_=>f_,x_)):=d(f,x,1/2); simplify(ds(f_,x_,n_)):=d(f,x,n); simplify(ds(f_,x_)):=d(f,x); simplify(ds(x_=>f_,x_,n_)):=d(f,x,n); simplify(ds(x_=>f_,x_)):=d(f,x); simplify(d(x_=>f_,x_,n_)):=d(f,x,n); simplify(d(x_=>f_,x_)):=d(f,x); simplify(ints(x_=>f_,x_,a_,b_)):=integrate(f,x,a,b); simplify(integrates(x_=>f_,x_,a_,b_)):=integrate(f,x,a,b); simplify(integrates(x_=>f_,x_)):=integrate(f,x); simplify(integrals(x_=>f_,x_)):=integral(f,x); simplify(inte(x_=>f_,x_)):=integrate(f,x); simplify(ints(x_=>f_,x_)):=integrate(f,x); simplify(ds(ds(y_,x_),t_)):=d(d(y,x),t); simplify(mittag(a_,b_)*mittag(a_,c_)):=mittag(a,b+c); simplify(mittag(a_,b_)/mittag(a_,c_)):=mittag(a,b-c); simplify(mittag(2,x_^2)):=cosh(x); simplify(mittag(2,-x_^2)):=cos(x); simplify(mittag(a_,x_)^n_):=mittag(a,n*x); simplify(GammaQ(a_,x_)*Gamma(a_)):=Gamma(a,x); simplify(Gamma(a_,x_)/GammaQ(a_,x_)):=Gamma(a); simplify(Gamma(x_-1)/Gamma(x_)):=1/(x-1); simplify(Gamma(x_)/Gamma(x_-1)):= x-1; simplify(Gamma(x_+1)):= x!; simplify((x_-1)!):=Gamma(x); #simplify(ln(n_,x)):= If(n>0 and isinteger(n), -(-1)^n*(n-1)!/x^n); simplify(ln(n_,x_)):= If(n>0,-(-1)^n*(n-1)!/x^n, (log(x)+psi(1)-psi(1-n))/gamma(1-n)*x^(-n) ); simplify(log(x_^n_)):=n*log(x); simplify(log(x_*y_)):=log(x)+log(y); simplify(log(x_+(1+x_^2)^0.5)):=asinh(x); simplify(log(x_+(-1+x_^2)^0.5)):=acosh(x); simplify(log((1+x_)/(-1+x_))):= 2acoth(x); simplify(log((1+x_)/(1-x_))):= 2atanh(x); simplify(log((1+(x_^2+1)^0.5)/x_)):=2acsch(x); simplify(log((1+(1-x_^2)^0.5)/(1-(1-x_^2)^0.5))):=2asech(x); simplify(log(Gamma(x_))):=logGamma(x); #simplify(log(gamma(x_))):=loggamma(x); simplify(log(-1)):=pi*i; simplify((-a_)^n_):=if(iseven(n),a^n, if(isodd(n),-a^n )); simplify(erfi(x_)*exp(-x_^2)):= 2/sqrt(pi)*Dawson(x); simplify(erf(x_)*exp(x_^2)):= 2/sqrt(pi)*Dawsonminus(x); simplify(erf(x_^0.5)*exp(x_)):= E(1/2,x^(1/2))-exp(x); simplify((1+erf(x_^0.5))*exp(x_)):= E(1/2,x^(1/2)); simplify(exp(x_)+erf(x_^0.5)*exp(x_)):= E(1/2,x^(1/2)); simplify((1+erf(x_))*exp(x_^2)):= E(1/2,x); simplify(exp(x_^2)+2*Dawsonminus(x_)*pi^(-0.5)):=E(1/2,x); simplify(exp(x_^2)+erf(x_)*exp(x_^2)):= E(1/2,x); simplify(A_*Ei(a_*x_)+B_*Ei(b_*x_)):= If(a+b==0, if(A==B, 2A*chi(abs(b)*x), if(A+B==0, 2B*shi(abs(b)*x) ))); simplify(A_*Ei(x_)+B_*Ei(-x_)):= if(A==B, 2A*chi(x), if(A+B==0, 2A*shi(x) )); simplify(A_*Ei(-x_)-A_*Ei(x_)):= -2A*shi(x); simplify(A_*Ei(x_)-A_*Ei(-x_)):= 2A*shi(x); simplify(A_*Ei(x_)+A_*Ei(-x_)):= 2A*chi(x); simplify(Ei(-x_)+Ei(x_)):= 2chi(x); simplify(Ei(x_)-Ei(-x_)):= 2shi(x); simplify(Ei(-x_)-Ei(x_)):= -2shi(x); simplify(A_*exp(a_*x_)+B_*exp(b_*x_)):= If(a+b==0, if(A==B, 2A*cosh(abs(b)*x), if(A+B==0, 2B*sinh(abs(b)*x) ))); simplify(a_*exp(x_)+b_*exp(-x_)):= if(a==b, 2a*cosh(x), If(a+b==0, 2a*sinh(x) )); simplify(a_*exp(-x_)-a_*exp(x_)):= -2a*sinh(x); simplify(a_*exp(x_)-a_*exp(-x_)):= 2a*sinh(x); simplify(a_*exp(-x_)+a_*exp(x_)):= 2a*cosh(x); simplify(exp(-x_)+exp(x_)):= 2cosh(x); simplify(exp(x_)-exp(-x_)):= 2sinh(x); simplify(exp(-x_)-exp(x_)):= -2sinh(x); simplify(a_*exp(-i*x_)-a_*exp(i*x_)):= -2a*i*sin(x); simplify(a_*exp(i*x_)-a_*exp(-i*x_)):= 2a*i*sin(x); simplify(a_*exp(-i*x_)+a_*exp(i*x_)):= 2a*cos(x); simplify(x_+(1+x_^2)^0.5):=exp(asinh(x)); simplify(x_+(-1+x_^2)^0.5):=exp(acosh(x)); simplify((1+2*x_+x_^2)^0.5):=abs(1+x); simplify((1+2*x_+x_^2)^(-0.5)):=1/abs(1+x); simplify((1+sinh(x_)^2)^(0.5)):= cosh(x); simplify((1+cosh(x_)^2)^(0.5)):= sinh(x); simplify((1-sin(x_)^2)^(0.5)):= cos(x); simplify((1-cos(x_)^2)^(0.5)):= sin(x); simplify((-a_-b_)^n_):=(-1)^n*(a+b)^n; simplify(1/(x_^2-x_*y_)*(x_-y_)):=1/x; simplify((a_-x_)*(b_+x_)^n_):= if(a+b==0, -(b+x)^(n+1)); simplify((a_-x_)/(b_+x_)):= if(a+b==0, a); simplify((a_+x_)/(b_+x_)):= 1+(a-b)/(x+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(1/(exp(a_)+exp(b_))):=exp(-a)/(exp(b-a)+1); simplify(1/(exp(-x_)+exp(x_))) := sech(x); simplify(1/(exp(x_)-exp(-x_))) := csch(x); 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/sinh(x_)):=csch(x); simplify(1/cosh(x_)):=sech(x); simplify(1/tanh(x_)):=coth(x); simplify(1/coth(x_)):=tanh(x); simplify(1/csch(x_)):=sinh(x); simplify(1/sech(x_)):=cosh(x); simplify(sec(x_)*sin(x_)):=tan(x); simplify(1/cos(x_)*sin(x_)):=tan(x); simplify(cos(x_)*csc(x_)):=cot(x); simplify(cos(x_)/sin(x_)):=cot(x); simplify(1/cosh(x_)*sinh(x_)):=tanh(x); simplify(cosh(x_)/sinh(x_)):=coth(x); simplify(asin(1/x_)):=acsc(x); simplify(acos(1/x_)):=asec(x); simplify(atan(1/x_)):=acot(x); simplify(acot(1/x_)):=atan(x); simplify(acsc(1/x_)):=asin(x); simplify(asec(1/x_)):=acos(x); simplify(asinh(1/x_)):=acsch(x); simplify(acosh(1/x_)):=asech(x); simplify(atanh(1/x_)):=acoth(x); simplify(acoth(1/x_)):=atanh(x); simplify(acsch(1/x_)):=asinh(x); simplify(asech(1/x_)):=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(asin(sin(x_))):=x; simplify(acos(cos(x_))):=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(asinh(sinh(x_))):=x; simplify(acosh(cosh(x_))):=x; simplify(csgn(x_)^2):=1; simplify(sgn(x_)^2):=1; simplify(sgn(x_)*abs(x_)):=x; simplify(x_/abs(x_)):=sgn(x); simplify(x_/sgn(x_)):=abs(x); simplify(exp(a_*log(x_)+y_)):=x^a*exp(y); simplify(exp(log(x_)+y_)):=x*exp(y); simplify(exp(a_+log(x_))):=x*exp(a); simplify(exp(a_+log(x_)+y_)):=x*exp(a+y); simplify(exp(a_+c_*log(x_)+y_)):=x^c*exp(a+y); simplify(exp(a_*log(x_))):=x^a; simplify(exp(log(x_))):=x; simplify(tanh(x_)*cosh(x_)) := sinh(x); simplify(coth(x_)*sinh(x_)) := cosh(x); simplify(tan(x_)*cos(x_)) := sin(x); simplify(cot(x_)*sin(x_)) := cos(x); simplify(cos(x_)*sin(x_)) := sin(2x)/2; simplify(csc(x_)*sin(x_)) :=1; simplify(cos(x_)*sec(x_)) :=1; 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(cosh(x_)+sinh(x_)):=exp(x); simplify(cosh(x_)-sinh(x_)):=exp(-x); simplify(cosh(a_,x_^a_)+sinh(a_,x_^a_)):=E(a,x^a); simplify(cosh(a_,x_^a_)-sinh(a_,x_^a_)):=E(a,-x^a); simplify(a_*cosh(a_,x_)^2*y_+b_*sinh(a_,x_)^2*y_) :=if(a+b==0,b); simplify(b_*cos(a_,x_)^2+b_*sin(a_,x_)^2):=b; simplify(cosh(a_,x_)^2-sinh(a_,x_)^2):=1; simplify(cos(a_,x_)^2+sin(a_,x_)^2):=1; simplify(b_*sech(x_)^2+b_*tanh(x_)^2) :=b; simplify(b_*sec(x_)^2+a_*tan(x_)^2) :=if(a+b==0,b); simplify(cos(x_)^2+sin(x_)^2) :=1; simplify(csc(x_)^2-cot(x_)^2) :=1; simplify(tan(x_)^2-sec(x_)^2) := -1; simplify(sec(x_)^2-tan(x_)^2) :=1; simplify(sech(x_)^2+tanh(x_)^2) :=1; simplify(-cosh(x_)^2+sinh(x_)^2):= -1; simplify(a_-cosh(x_)^2+sinh(x_)^2):=a-1; simplify(cosh(x_)^2-sinh(x_)^2):=1; simplify(a_+cosh(x_)^2-sinh(x_)^2):=1+a; simplify(pow(a_,b_)):=a^b; simplify(1/exp(x_)):=exp(-x); simplify(cbrt(x_)):=x^(1/3); simplify(sqrt(x_)):=x^(1/2); simplify(cbrt(x_)^3):=x; simplify(sqrt(x_)^2):=x; simplify((1+sinh(x_)^2)^0.5):=cosh(x); simplify((1+sinh(0.5,x_^0.5)^2)^0.5):=cosh(0.5,x^0.5); simplify((-1+cosh(x_)^2)^0.5):=sinh(x); simplify((-1+cosh(0.5,x_^0.5)^2)^0.5):=sinh(0.5,x^0.5); simplify(Complex(a_,b_)):=a+b*i;