# gsolution is general solution of linear differential equation; gsolution(b_,n_,c_,m_,0,y_,x_,p_):= if(isconstant(b,c), gsolution(b,n-m,c,y,x,p-m),int(gsolution(b,n-m,c,y,x,p-m),x,m) )+C_3; gsolution(b_,p_,c_,y_,x_,q_):=if(isfree(b,c,y) and isfree(b,c,x), if(2p==q, if(b*b== -4c, if(p>=1 or b>0, C_1*exp((b/2)^(1/p)*x)+C_2*exp((b/2)^(1/p)*x)*x,0), if(b*b< -4c, if(p>=0.8 or b>0, C_1*exp(((b-sqrt(b^2+4c))/2)^(1/p)*x)+C_2*exp(((b+sqrt(b^2+4c))/2)^(1/p)*x),0), if(b>(b^2+4c)^0.5, C_1*exp(((b-sqrt(b^2+4c))/2)^(1/p)*x),0)+if(b+(b^2+4c)^0.5>0,C_2*exp(((b+sqrt(b^2+4c))/2)^(1/p)*x),0) )), if(b+c==1, C_2*exp(x),0)+C_1*exp(nsolve(x^q-b*x^p-c)*x) ), if(p==1 and -b==c*x, C_1*x) ); gsolution(b_,1,c_,y_,x_,2):=gsolution(b_,c_,y_,x_,2); gsolution(0,c_,y_,x_,n_):=gsolution(c,y,x,n); gsolution(b_,c_,y_,x_,2):=if(isfree(b,c,y) and isfree(b,c,x), if(b*b+4c==0, C_1*exp(b*x/2)+C_2*exp(b*x/2)*x, if(b*b+4c<0, C_1*exp(b*x/2)*cos(sqrt(-b^2-4c)/2*x)+C_2*exp(b*x/2)*sin(sqrt(-b^2-4c)/2*x), C_1*exp((b-sqrt(b^2+4c))/2*x)+C_2*exp((b+sqrt(b^2+4c))/2*x) )), if(-b==c*x, C_1*x+C_2*exp(integrate(b,x))+c*C_2*x*integrate(exp(integrate(b,x)),x), if(b==c*x, C_1*exp(integrate(b,x))*(1+C_2*integrate(exp(-integrate(b,x)),x)) ))); gsolution(b_/x_,c_,y_,x_,2):=if(c<0, C_1*besselJ((1+b)/2,sqrt(-c)*x)*x^((1+b)/2)+C_2*besselY((b+1)/2,sqrt(-c)*x)*x^((1+b)/2), if(c>0,C_1*besselI((b+1)/2,sqrt(c)*x)*x^((1+b)/2)+C_2*besselK((b+1)/2,sqrt(c)*x)*x^((1+b)/2))); gsolution(1/x_,c_,y_,x_,2):= if(c<0, C_1*besselJ(1,sqrt(-c)*x)*x+C_2*besselY(1,sqrt(-c)*x)*x, if(c>0,C_1*besselI(1,sqrt(c)*x)*x+C_2*besselK(1,sqrt(c)*x)*x)); gsolution(b_,x_,y_,x_,2):= if(hasnot(b,x) and hasnot(b,y), C_1* exp(b*x/2)* Ai(x + b^2/4) + C_2* exp(b*x/2)* Bi(x + b^2/4) ); gsolution(b_,c_*x_,y_,x_,2):= if(hasnot(b,c,x) and hasnot(b,c,y), C_1* exp(b*x/2)* Ai((c*x + b^2/4)/c^(2/3)) + C_2* exp(b*x/2)* Bi((c*x + b^2/4)/c^(2/3)) ); gsolution(b_,0,y_,x_,2):= if(isfree(b,x), C_1+C_2*exp(b*x), C_1+C_2*int(exp(int(b,x)),x) ); gsolution(b_*x_,b_*x_, y_,x_,2):= if(isconstant(b), C_1*exp(x+b*x^2/2)*(sqrt(2/b)-x/sqrt(2/b)) ); gsolution(b_/x_,c_*x_^(-2),y_,x_,2):= if(isfree(b,c,x), if((b+1)^2+4c==0, C_1*x^((b+1)/2)+C_2*x^((b+1)/2)*log(x), if((b+1)^2+4c<0, C_1*x^((b+1)/2)*cos(log(x)*sqrt(-(b+1)^2-4c)/2)+C_2*x^((b+1)/2)*sin(log(x)*sqrt(-(b+1)^2-4c)/2), C_1*x^((b+1-sqrt((b+1)^2+4c))/2)+C_2*x^((b+1+sqrt((b+1)^2+4c))/2) ))); gsolution(b_/x_,x_^(-2),y_,x_,2):= if(isfree(b,x), if((b+1)^2+4==0, C_1*x^((b+1)/2)+C_2*x^((b+1)/2)*log(x), if((b+1)^2+4<0, C_1*x^((b+1)/2)*cos(log(x)*sqrt(-(b+1)^2-4)/2)+C_2*x^((b+1)/2)*sin(log(x)*sqrt(-(b+1)^2-4)/2), C_1*x^((b+1-sqrt((b+1)^2+4))/2)+C_2*x^((b+1+sqrt((b+1)^2+4))/2) ))); gsolution(b_,c_/x_, y_,x_,2):= if(b== -c, C_1*x+C_2*(b*x*Ei(b*x)-exp(b*x))); gsolution(b_,b_/x_, y_,x_,2):= if(hasnot(b,x), C_1*x*exp(b*x)+C_2*(1+b*x*Ei(-b*x)*exp(b*x))); gsolution(x_,2,y_,x_,2):= C_1*(sqrt(2pi)*exp(x^2/2)*erf(x/sqrt(2))*x+2)+C_2*exp(x^2/2)*x; #gsolution(x_,1,y_,x_,2):= C_1*exp(x^2/2)*erf(x/sqrt(2))+C_2*exp(x^2/2); #gsolution(-x_,-1,y_,x_,2):= C_1*exp(-x^2/2)*erfi(x/sqrt(2))+C_2*exp(-x^2/2); #gsolution(-x_,1,y_,x_,2):= C_1* (sqrt(2 pi) *x* erf(x/sqrt(2)) + 2* exp(-x^2/2)) + C_2*x; #gsolution(x_,-1,y_,x_,2):= C_1* (sqrt(2 pi) *x *erfi(x/sqrt(2)) - 2 exp(x^2/2)) + C_2*x; gsolution(x_,x_, y_,x_,2):= C_1*exp(-x)*(1+x/2); gsolution(x_,-x_, y_,x_,2):= C_1*exp(x) *(1-x/2); gsolution(-x_,x_, y_,x_,2):= C_1* exp(-x - x^2/2)+C_2* exp(-x-x^2/2)* erfi((x + 2)/sqrt(2)); gsolution(-x_,-x_, y_,x_,2):= C_1* exp(x - x^2/2) +C_2* exp(x-x^2/2)* erfi((x - 2)/sqrt(2)); gsolution(b_/x_,c_/x_, y_,x_,2):= if(isconstant(b) and c<0, C_1*besselJ(abs(-b-1),2sqrt(-c*x))*x^((1+b)/2)+C_2*besselY(abs(-1-b),2sqrt(-c*x))*x^((1+b)/2), C_1*besselI(abs(1+b),2sqrt(c*x))*x^((1+b)/2)+C_2*besselK(abs(1+b),2sqrt(c*x))*x^((1+b)/2) ); gsolution(1/x_,c_/x_, y_,x_,2):= if(c<0, C_1*x*besselJ(2,2sqrt(-c*x))+C_2*x*besselY(2,2sqrt(-c*x)),C_1*x*besselI(2,2sqrt(c*x))+C_2*x*besselK(2,2sqrt(c*x)) ); gsolution(b_/x_,1/x_, y_,x_,2):= if(isconstant(b), C_1*besselI(abs(-1-b),2sqrt(x))*x^((1+b)/2)+C_2*besselK(abs(-1-b),2sqrt(x))*x^((1+b)/2) ); gsolution(1/x_,1/x_, y_,x_,2):= C_1*x*besselI(2,2sqrt(x))+C_2*x*besselK(2,2sqrt(x)); gsolution(1/(x_+d_)*x_,1/(x_+d_)*c_, y_,x_,2):= if(c==-1 and d==-1, C_1*exp(x)+C_2*x ); gsolution(1/x_,c_*x_^(-2),y_,x_,2):= if(isfree(c,x), if(c== -1, C_1*x+C_2*x*log(x), if(c< -1, C_1*x*cos(log(x)*sqrt(-1-c))+C_2*x*sin(log(x)*sqrt(-1-c)), C_1*x^(1-sqrt(1+c))+C_2*x^(1+sqrt(1+c)) ))); gsolution(1/x_,x_^(-2),y_,x_,2):= C_1*x^(1-sqrt(2))+C_2*x^(1+sqrt(2)); gsolution(1,1/x_, y_,x_,2):= C_1*x*exp(x)+C_2*(1+x*Ei(-x)*exp(x)); gsolution(0,c_, y_,x_,2) := if(isfree(c,x), if(c<0,C_1*cos(sqrt(-c)*x)+C_2*sin(sqrt(-c)*x),C_1*exp(-sqrt(c)*x)+C_2*exp(sqrt(c)*x)), E(2,2int(int(c,x),x)+C_1*x+C_2) ); gsolution(0,x_,y_,x_,2):= C_1*Ai(x)+C_2*Bi(x); gsolution(0,c_*x_, y_,x_,2):= if(isfree(c,x) and isfree(c,y), C_1*Ai(cbrt(c)*x)+C_2*Bi(cbrt(c)*x) ); gsolution(0,c_*x_^(-2),y_,x_,2):= if(isfree(c,x), if(1+4c==0, C_1*x^(1/2)+C_2*x^(1/2)*log(x), if(1+4c<0, C_1*x^(1/2)*cos(log(x)*sqrt(-1-4c)/2)+C_2*x^(1/2)*sin(log(x)*sqrt(-1-4c)/2), C_1*x^((1-sqrt(1+4c))/2)+C_2*x^((1+sqrt(1+4c))/2) ))); #gsolution(c_,y_,x_,n_):= if(n<0,0, if(n== -1, C_1*exp(integrate((1-d(c,x))/c,x)), sum(c(k+1)*x^k,k,0,ceil(n)-1,1)), if(c>0, C_1*exp(c^(1/n)*x)+if(iseven(n), C_2*exp(-c^(1/n)*x),0), if(c<0, mittag(n,sum(c(k+1)*x^k,k,0,ceil(n)-1,1)+c*x^n), mittag(n,d(c,x,-n)*(abs(n))!+sum(c(k+1)*x^k,k,0,ceil(n)-1,1)) ))); #gsolution(c_,y_,x_,n_):= if(c==0, if(n== -1, C_1*exp(integrate((1-d(c,x))/c,x)), sum(c(k+1)*x^k,k,0,ceil(abs(n))-1,1) ), if(c>0, sum(c(k)*exp(-(-1)^k*c^(1/n)*x),k,1,ceil(abs(n)),1), if(c<0, mittag(n,sum(c(k+1)*x^k,k,0,ceil(abs(n))-1,1)+c*x^n), mittag(n,d(c,x,-n)*((n))!+sum(c(k+1)*x^k,k,0,ceil(abs(n))-1,1)) ))); gsolution(c_,y_,x_,n_):= if(c==0, if(n== -1, C_1*exp(integrate((1-d(c,x))/c,x)), if(n<0,0,C_1+sum(c(k+1)*x^k,k,1,ceil(abs(n))-1) )), if(c>0,C_1*exp(c^(1/n)*x)+if(iseven(n),C_2*exp(-c^(1/n)*x),0), if(hasnot(c,x), C_1*mittag(n,c*x^n), C_1*mittag(n,int(c,x,n)*n!) )));