# gsolution is general solution of linear differential equation; 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*e^(b*x/2)*cos(sqrt(-b^2-4c)/2*x)+c_2*e^(b*x/2)*sin(sqrt(-b^2-4c)/2*x), c_1*e^((b-sqrt(b^2+4c))/2*x)+c_2*e^((b+sqrt(b^2+4c))/2*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,a_*x_, y_,x_,2):= if(isfree(a,x) and isfree(a,y), c_1*Ai(cbrt(a)*x)+c_2*Bi(cbrt(a)*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_,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)*erfi(x/sqrt(2))+c_2*exp(-x^2/2); gsolution(1/x_,c_,y_,x_,2):= if(hasnot(c,x), c_1*J(1,sqrt(-c)*x)*x+c_2*J2(1,sqrt(-c)*x)*x); gsolution(-1/x_,c_,y_,x_,2):=if(hasnot(c,x), c_1*J(0,sqrt(-c)*x)+c_2*J2(0,sqrt(-c)*x)); gsolution(1,x_,y_,x_,2):= c_1* e^(x/2)* Ai(x + 1/4) + c_2* e^(x/2)* Bi(x + 1/4); gsolution(b_,0,y_,x_,2):= if(isfree(b,y),if(isfree(b,x), c_1+c_2*e^(b*x), c_1*integrate(exp(int(b,x)),x)+c_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(1/x_,x_^(-2),y_,x_,2):= c_1*x^(1-sqrt(2))+c_2*x^(1+sqrt(2)); 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(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(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(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)*(abs(n))!+sum(c(k+1)*x^k,k,0,ceil(abs(n))-1,1)) )));