# differential equation solver; # solve differential equation and fractional differential equation for unknown y with independent variable x; # dsolve(eq,y) # there are 3 way to input derivative y: y', y(1,x), or ds(y,x,1) # there are 3 way to input second order derivative y: y'', y(2,x), or ds(y,x,2) # e.g. dsolve( y' = x*y, y) # dsolve( y(0.5,x)=y^2 ) #1; dsolve(1/b_, y_,x_,n_) := if(abs(n)<=1 and has(b,y),if(has(b,x), dsolve(replace(b,x,zz),zz,y,n)=x,C_1+int(b,y,n)=x^n/n! )); #dsolve(1/b_, y_,x_,n_) := if( has(b,y), dsolve(replace(b,x,zz),zz,y,n)=x); #dsolve(y_^2, y_,x_,p_) := (2p)!/p!/2*(-1/(C_1+x))^p; dsolve(log(y_), y_,x_,p_) := if(not(isinteger(p)), inverseli(p,x^p+gsolution(0,y,x,p)) ); dsolve(log(b_*y_), y_,x_,p_) := if(isconstant(b) and not(isinteger(p)), inverseli(p,b*x^p+gsolution(0,y,x,p))/b ); dsolve(log(b_*y_+c_), y_,x_,p_) := if(isconstant(b) and not(isinteger(p)) and d(c,x,p)==0, inverseli(p,b*x^p+gsolution(0,y,x,p))/b-c/b ); dsolve(1/log(y_), y_,x_,p_) :=if(not(isinteger(p)), exp(-inversegamma(1+p,c_1-x^p)) ); dsolve(y_^n_, y_,x_,q_) := block(f1:=fallingfactorial(q/(1-n),q)^(1/(n-1)),f2:=(if(n+q-1==0,0,C_1)+x)^(q/(1-n)), if(iseven(q),f1*(C_1-x)^(q/(1-n)) and f1*f2, f1*f2 and if(isodd(n),-f1*f2 ))); dsolve((c_+y_)^n_, y_,x_,q_) := if(d(c,x,q)==0,block(f1:=fallingfactorial(q/(1-n),q)^(1/(n-1)), f2:=(if(n+q-1==0,0,C_1)+x)^(q/(1-n)), if(iseven(q),f1*(C_1-x)^(q/(1-n))-c and f1*f2-c, f1*f2-c and if(isodd(n),-f1*f2-c )))); dsolve((c_+b_*y_)^n_, y_,x_,q_) := if(d(c,x,q)==0,block(f1:=fallingfactorial(q/(1-n),q)^(1/(n-1))*b^(n/(1-n)), f2:=(if(n+q-1==0,0,C_1)+x)^(q/(1-n)), if(iseven(q),f1*(C_1-x)^(q/(1-n))-c/b and f1*f2-c/b, f1*f2-c/b and if(isodd(n),-f1*f2-c/b )))); dsolve(exp(b_*y_+c_), y_,x_,p_) := if(isconstant(b), if(isinteger(p) and d(c,x,p)==0, log((-1)^p/b*p!/(C_1+x)^p)/b-c/b, ln(p,gsolution(0,y,x,p)+b*p!*int(exp(c),x,p))/b )); dsolve(exp(b_*y_+c_), y_,x_,1) := if(isconstant(b) and hasnot(c,y), -log(C_1-b*int(exp(c),x))/b); dsolve(exp(y_+c_), y_,x_,p_) := if(d(c,x,p)==0, dsolve(exp(y),y,x,p)-c,ln(p,int(exp(c),x,p)*p!+gsolution(0,y,x,p)) ); dsolve(exp(y_+c_), y_,x_,1) := -log(C_1-int(exp(c),x)); dsolve(exp(b_*y_), y_,x_,p_) := if(isconstant(b), if(isinteger(p), log((-1)^p/b*p!/(C_1+x)^p)/b and if(iseven(p), log((-1)^p/b*p!/(C_1-x)^p)/b ), ln(p,c_1+b*x^p)/b )); dsolve(exp(y_), y_,x_,p_) := if(isinteger(p), log((-1)^p*p!/(C_1+x)^p) and if(iseven(p),log((-1)^p*p!/(C_1-x)^p) ), ln(p,x^p+gsolution(0,y,x,p)) ); dsolve(exp(y_), y_,x_,2) := log(C_1*tanh(sqrt(2)/2C_1*x+C_2)^2-C_1); dsolve(y_, y_,x_,n_) := gsolution(1,y,x,n); dsolve(exp(x_/y_),y_,x_,1):=int(1/(exp(1/z)-z),z,1,y/x)=C_1+log(x); #dsolve(y(p_,x_)^n_,y_,x_,q_):= if(n== -1, C_2+1/sqrt(fallingfactorial((p+q)/2,p)*fallingfactorial((p+q)/2,q))*(C_1+x)^((p+q)/2), int(dsolve(y^n,y,x,q-p),x,p)+gsolution(0,y,x,p)); dsolve(y(p_,x_)^n_,y_,x_,q_):= int(dsolve(y^n,y,x,q-p),x,p)+gsolution(0,y,x,p); #dsolve(y(p_,x_)^n_,y_,x_,q_):= if(n>0,gsolution(0,y,x,min(p,q)) and gsolution(0,y,x,min(p,q))+int(dsolve(y^(n^(sgn(q-p))),y,x,abs(q-p)),x,min(p,q)), gsolution(0,y,x,min(p,q))+int(dsolve(y^(n^(sgn(q-p))),y,x,abs(q-p)),x,min(p,q)) ); #dsolve(y(p_,x_)^n_,y_,x_,p_):= if(n>0,gsolution(0,y,x,p)+(C_2+x)^p/p!, gsolution(0,y,x,p)+(C_2+x)^p/p!); #dsolve(y(1,x_)^n_,y_,x_,2) := C_2 - ((1-n)* (C_1 + x))^(1/(1 - n) + 1)/(n - 2); #dsolve(y(1,x_)^2,y_,x_,2):= C_2 - log(C_1 + x) and C_2 - log(C_1 - x); dsolve(y(1,x_)^p_,y_,x_,p_):= C_2 -(p-1)!^(1/(p-1))* log(C_1 + x) and C_2 -(p-1)!^(1/(p-1))* log(C_1 - x); #dsolve(1/y(p_,x_),y_,x_,q_) := C_2+1/sqrt(fallingfactorial((p+q)/2,p)*fallingfactorial((p+q)/2,q))*(C_1+x)^((p+q)/2); dsolve(y(p_,x_),y_,x_,q_):= C_1*exp(x)+gsolution(0,y,x,p); dsolve((y(p_,x_)+b_*x_*y(q_,x_))^n_,y_,x_,q_):= if(q-p==1 and isconstant(b), -b*int(C_1^n+C_1*x,x,p) ); dsolve(1/y(1,x_),y_,x_,3):= C_2-i*sqrt(pi)/2erf(sqrt(2)*inverseerf(C_1+x*sqrt(-2)/sqrt(pi))) and C_2+i*sqrt(pi)/2erf(sqrt(2)*inverseerf(C_1+x*sqrt(-2)/sqrt(pi))); dsolve(y(1,x_),y_,x_,3):= C_1+C_2*exp(x)+C_3*exp(-x); dsolve(y(2,x_),y_,x_,3):= C_1+C_2*exp(x)+C_3*x; dsolve((y_-x_*y(1,x_))^n_,y_,x_,1):= -C_1^n-C_1*x; dsolve((-y_+x_*y(1,x_))^n_,y_,x_,1):= C_1*x-C_1^n; dsolve((c_+y_-x_*y(1,x_))^n_,y_,x_,1):= if(isconstant(c),-C_1^n-C_1*x-c); dsolve((c_-y_+x_*y(1,x_))^n_,y_,x_,1):= if(isconstant(c),C_1*x-C_1^n+c); #2x; dsolve(a_*b_,y_,x_,1):= if(hasnot(a,y) and hasnot(b,x), solve(int(1/b,y)=int(a,x)+C_1,y), if(hasnot(b,y) and hasnot(a,x), solve(int(1/a,y)=int(b,x)+C_1,y) )); dsolve(b_*exp(c_+y_), y_,x_,p_) := if(hasnot(b,c,y), if(p==1, -log(C_1-int(b*exp(c),x)), if(p<1, ln(p,C_1+p!*int(b*exp(c),x,p)), if(d(b,x,p)==0 and d(c,x,p)==0, log((-1)^p*p!/b/(C_1+x)^p)-c and if(iseven(p),log((-1)^p*p!/b/(C_1-x)^p)-c) )))); dsolve(a_*log(x_/y_),y_,x_,1):=if(isconstant(a),int(1/(a*log(1/z)-z),z,1,y/x)=C_1+log(x) and a*W(1/a)*x); dsolve(a_*log(y_/x_),y_,x_,1):=if(isconstant(a),int(1/(a*log(z)-z),z,1,y/x)=C_1+log(x) and -a*W(-1/a)*x); dsolve(a_*exp(y_/x_),y_,x_,1):=if(isconstant(a),int(1/(a*exp(z)-z),z,1,y/x)=C_1+log(x) and -W(-a)*x); dsolve(a_*exp(x_/y_),y_,x_,1):=if(isconstant(a),int(1/(a*exp(1/z)-z),z,1,y/x)=C_1+log(x) and 1/W(1/a)*x); dsolve(a_*log(b_*y_/x_),y_,x_,1):=if(isconstant(a,b),int(1/(a*log(z)-z),z,1,b*y/x)=C_1+log(x) and -a*W(-1/a/b)*x); #dsolve(exp(c_+y_)*z_, y_,x_,p_) := if(hasnot(c,z,y), if(p==1, -log(C_1-int(exp(c)*z,x)), if(p<1, ln(p,C_1+p!*int(exp(c)*z,x,p)), if(d(c,x,p)==0 and d(z,x,p)==0, log((-1)^p*p!/z/(C_1+x)^p)-c and if(iseven(p),log((-1)^p*p!/z/(C_1-x)^p)-c) )))); dsolve(exp(c_+y_)*z_, y_,x_,p_) := if(hasnot(z,y) and d(c,x,p)==0, dsolve(exp(y)*z,y,x,p)-c); dsolve(exp(c_+b_*y_)*z_, y_,x_,p_) := if(hasnot(z,y) and d(c,x,p)==0, dsolve(exp(b*y)*z,y,x,p)-c/b); dsolve(exp(c_+x_)*z_, y_,x_,p_) := if(hasnot(z,x), replace(dsolve(exp(x)*z,y,x,p),x,x+c) ); dsolve(exp(y_)*z_, y_,x_,p_) := if(p<>1 and hasnot(z,y), ln(p,gsolution(0,y,x,p)+p!*int(z,x,p)) ); dsolve(exp(b_*y_)*z2_, y_,x_,p_) := if(p<>1 and hasnot(z2,y) and isconstant(b), ln(p,gsolution(0,y,x,p)+b*p!*int(z2,x,p))/b ); dsolve(b_*exp(y_), y_,x_,p_) := if(p<>1 and hasnot(b,y),if(isinteger(p), log((-1)^p*p!/b/(C_1+x)^p) and if(iseven(p),log((-1)^p*p!/b/(C_1-x)^p)), ln(p,gsolution(0,y,x,p)+p!*int(b,x,p)) )); #dsolve(exp(b_*y_)*x_, y_,x_,p_) := if(isconstant(b), if(isinteger(p),-log(if(p==1,C_1,0)+1/(-1)^p*b/((p-1)!+p!)*x^(1+p))/b, ln(p,gsolution(0,y,x,p)+p!*int(z,x,p)) )); #dsolve(exp(b_*y_)*(c_+x_), y_,x_,p_) := if(isconstant(b,c), -log(if(p==1,C_1,0)+1/(-1)^p*b/((p-1)!+p!)*(c+x)^(p+1))/b ); #dsolve(exp(b_*y_)*(c_+f1_*x_), y_,x_,p_) := if(isconstant(b,c,f1), -log(if(p==1,C_1,0)+1/(-1)^p*b*f1/((p-1)!+p!)*(c/f1+x)^(p+1))/b ); #dsolve(exp(b_*y_)*x_^n_, y_,x_,p_) := if(p+n<>0 and isconstant(b), -log(if(p==1,C_1,0)+1/(-1)^p*b/(n*(p-1)!+p!)*x^(n+p))/b ); #dsolve(exp(b_*y_)*(c_+x_)^n_, y_,x_,p_) := if(p+n<>0 and isconstant(b,c), -log(if(p==1,C_1,0)+1/(-1)^p*b/(n*(p-1)!+p!)*(c+x)^(n+p))/b ); #dsolve(exp(b_*y_)*(c_+f1_*x_)^n_, y_,x_,p_) := if(p+n<>0 and isconstant(b,c,f1), -log(if(p==1,C_1,0)+1/(-1)^p*b*f1^n/(n*(p-1)!+p!)*(c/f1+x)^(p+n))/b ); #dsolve(exp(y_)*x_, y_,x_,p_) := if(p<1,ln(p,c_1+x^(1+p)),-log(if(p==1,C_1,0)+1/(-1)^p/((p-1)!+p!)*x^(p+1)) ); #dsolve(exp(y_)*x_^n_, y_,x_,p_) := if(p+n<>0, -log(if(p==1,C_1,0)+1/(-1)^p/(n*(p-1)!+p!)*x^(n+p)) ); #dsolve(exp(y_)*(c_+x_), y_,x_,p_) := if(isconstant(c), -log(if(p==1,C_1,0)+1/(-1)^p/((p-1)!+p!)*(c+x)^(p+1)) ); #dsolve(exp(y_)*(c_+f1_*x_), y_,x_,p_) := if(isconstant(c,f1), -log(if(p==1,C_1,0)+1/(-1)^p*f1/((p-1)!+p!)*(c/f1+x)^(p+1)) ); #dsolve(exp(y_)*(c_+x_)^n_, y_,x_,p_) := if(p+n<>0 and isconstant(c), -log(if(p==1,C_1,0)+1/(-1)^p/(n*(p-1)!+p!)*(c+x)^(n+p)) ); dsolve(exp(g_*y_)*(c_+x_^2), y_,x_,2) := if(hasnot(c,f2,x), log(4/f2/(c-x^2)^2)/f2 ); dsolve(exp(g_*y_)*(b_*x_+x_^2), y_,x_,2) := if(hasnot(b,f2,x), log(4/f2/(b^2/2+b*x+x^2)^2)/f2 ); dsolve(exp(g_*y_)*(c_+b_*x_+x_^2), y_,x_,2) := if(hasnot(b,c,f2,x), log(4/f2/(b^2/2-c+b*x+x^2)^2)/f2 ); dsolve(exp(y_)*(c_+x_^2), y_,x_,2) := if(hasnot(c,x), log(4/(c-x^2)^2) ); dsolve(exp(y_)*(b_*x_+x_^2), y_,x_,2) := if(hasnot(b,x), log(4/(b^2/2+b*x+x^2)^2) ); dsolve(exp(y_)*(c_+b_*x_+x_^2), y_,x_,2) := if(hasnot(b,c,x), log(4/(b^2/2-c+b*x+x^2)^2) ); #dsolve(exp(xx_+y_)*z_, y_,x_,1) := if(hasnot(xx,z,y) and hasnot(y,x), solve(int(exp(-y),y)=int(exp(xx)*z,x)-C_1,y), if(hasnot(xx,y) and hasnot(y,z,x), solve(int(exp(-y)/z,y)=int(exp(xx),x)-C_1,y) )); #dsolve(a_*exp(xx_+y_), y_,x_,1) := if(hasnot(a,xx,y) and hasnot(y,x), solve(int(exp(-y),y)=int(a*exp(xx),x)-C_1,y), if(hasnot(xx,y) and hasnot(a,y,x), solve(int(exp(-y)/a,y)=int(exp(xx),x)-C_1,y) )); dsolve(b_*y_^n_, y_,x_,q_) := If(isfree(b,y),If(isfree(b,x), if(n==-1 and q==2, sqrt(-b)*exp(-inverseerf(sqrt(2)/sqrt(pi)*x+C_1)^2) and -sqrt(-b)*exp(-inverseerf(sqrt(2)/sqrt(pi)*x+C_1)^2), block(f1:=(1/b*fallingfactorial(q/(1-n),q))^(1/(n-1)),f2:=(if(n+q-1==0,0,C_1)+x)^(q/(1-n)), if(iseven(q), f1*(C_1-x)^(q/(1-n)) and f1*f2, f1*f2 and if(isodd(n), -f1*f2 )))), if(n==-1, block(f2:=d(b,x,q),if(f2<>0 and hasnot(f2,x), b/sqrt(f2) and -b/sqrt(f2) )), block(f2:=int(simplify(1/b),x,q),pp:=simplify(b^2*f2^n),if(pp==1,f2,if(pp==-1,-f2 ))) ))); #dsolve(b_*y_^n_, y_,x_,2) := If(isfree(b,y),If(isfree(b,x),((2n+2)/b)^(1/(n-1))/((n-1)*(C_1-x))^(2/(n-1)) and ((2n+2)/b)^(1/(n-1))/((n-1)*(C_1+x))^(2/(n-1)), (n/fallingfactorial(-n,2)*int(b,x,2))^(1/(2-n)) )); dsolve(b_*(c_+y_)^n_, y_,x_,p_) := if(hasnot(b,y) and d(c,x,p)==0, block(f1:=dsolve(b*y^n,y,x,p), if(-left(f1)==right(f1), left(f1)-c and right(f1)-c,f1-c ))); dsolve(b_*(c_+a_*y_)^n_, y_,x_,p_) := if(hasnot(b,y) and isconstant(a) and d(c,x,p)==0, block(f1:=dsolve(b*a^n*y^n,y,x,p), if(-left(f1)==right(f1), left(f1)-c/a and right(f1)-c/a,f1-c/a ))); #dsolve(b_*(c_+y_)^n_, y_,x_,q_) := if(q>1 and isconstant(b,c),block(p:=(1/b*fallingfactorial(q/(1-n),q))^(1/(n-1)),f2:=(x)^(q/(1-n)), if(iseven(q),p*(C_1-x)^(q/(1-n))-c and p*f2-c, p*f2-c and if(isodd(n),-p*f2-c )))); dsolve(b_/y_, y_,x_,p_) := if(hasnot(b,y), block(f2:=d(b,x,p),if(f2<>0 and hasnot(f2,x), b/sqrt(f2) and -b/sqrt(f2) ))); #dsolve(b_/y_, y_,x_,2) := if(isconstant(b), sqrt(-b)*exp(-inverseerf(sqrt(2)/sqrt(pi)*x+C_1)^2) and -sqrt(-b)*exp(-inverseerf(sqrt(2)/sqrt(pi)*x+C_1)^2) ); dsolve(b_/(c_+y_), y_,x_,p_) := if(hasnot(b,y) and d(c,x,p)==0,block(f2:=d(b,x,p),if(f2<>0 and hasnot(f2,x), b/sqrt(f2)-c and -b/sqrt(f2)-c, dsolve(b/y,y,x,p)-c ))); dsolve(b_/(c_+a_*y_), y_,x_,p_) := if(hasnot(b,y) and isconstant(a) and d(c,x,p)==0,block(f2:=d(b,x,p),if(f2<>0 and hasnot(f2,x), b/sqrt(a*f2)-c/a and -b/sqrt(a*f2)-c/a, dsolve(b/y,y,x,p)-c/a) )); dsolve(b_*(c_+y_), y_,x_,p_) := if(hasnot(b,y) and d(c,x,p)==0, block(f1:=dsolve(b*y,y,x,p), if(-left(f1)==right(f1), left(f1)-c and right(f1)-c,f1-c ))); dsolve(b*(c_+a_*y_), y_,x_,p_) := if(hasnot(b,y) and isconstant(a) and d(c,x,p)==0, block(f1:=dsolve(b*y,y,x,p), if(-left(f1)==right(f1), left(f1)/sqrt(a)-c/a and right(f1)/sqrt(a)-c/a,f1/sqrt(a)-c/a ))); dsolve(b_*y_, y_,x_,p_) := if(hasnot(b,y), gsolution(b,y,x,p) ); dsolve(x_^m_*y_^n_, y_,x_,q_) := if(q>1 and isconstant(m,n),block(p:=(fallingfactorial((m+q)/(1-n),q))^(1/(n-1))*x^((m+q)/(1-n)), p and if(isodd(n),-p ))); dsolve(x_*y_^n_, y_,x_,q_) := if(q>1 and isconstant(n),block(p:=(fallingfactorial((1+q)/(1-n),q))^(1/(n-1))*x^((1+q)/(1-n)), p and if(isodd(n),-p ))); dsolve((b_+x_)^m_*y_^n_, y_,x_,q_) := if(q>1 and isfree(b,x), block(p:=(fallingfactorial((m+q)/(1-n),q))^(1/(n-1))/((b+x)^((m+q)/(n-1))), p and if(isodd(n),-p ))); dsolve((b_+a_*x_)*y_^n_, y_,x_,q_) := if(q>1 and isfree(a,b,x), block(f2:=(fallingfactorial((1+q)/(1-n),q)/a)^(1/(n-1))/((b/a+x)^((1+q)/(n-1))), f2 and if(isodd(n),-f2 ))); dsolve((b_+x_)*y_^n_, y_,x_,q_) := if(q>1 and isfree(b,x), block(p:=(fallingfactorial((1+q)/(1-n),q))^(1/(n-1))/((b+x)^((1+q)/(n-1))), p and if(isodd(n),-p ))); dsolve((b_+c_*x_)*y_^n_, y_,x_,q_) := if(q>1 and isfree(b,c,x), block(p:=(1/c*fallingfactorial((1+q)/(1-n),q))^(1/(n-1))/((b/c+x)^((1+q)/(n-1))), p and if(isodd(n),-p ))); dsolve((c_+y_)*z_,y_,x_,q_) := if(isconstant(c),dsolve(y*z,y,x,q)-c); dsolve((c_+b_*y_)*z_,y_,x_,q_) := if(isconstant(b,c),dsolve(y*z,y,x,q)-c/b); dsolve((c_+y_)^n_*z_,y_,x_,q_) := if(isconstant(c),dsolve(y^n*z,y,x,q)-c); dsolve((c_+b_*y_)^n_*z_,y_,x_,q_) := if(isconstant(b,c),dsolve(y^n*z,y,x,q)-c/b); dsolve(a_/(b_+c_)*y_^n_,y_,x_,p_):= if(d(b+c,x,p)==a, C_1*x^p+p!*b/a*C_1, if(isconstant(a) and has(b+c,x) and has(b+c,y) and d(b+c,x,2)==0 and abs(p)<=1, x=dsolve(replace(b/a/y^n+c/a/y^n,x,zz),zz,y,p) )); dsolve(a_/(b_+c_)*y_,y_,x_,p_):= if(d(b+c,x,p)==a, C_1*x^p+p!*b/a*C_1, if(isconstant(a) and has(b+c,x) and has(b+c,y) and d(b+c,x,2)==0 and abs(p)<=1, x=dsolve(replace(b/a/y+c/a/y,x,zz),zz,y,p) )); dsolve(1/(b_+c_)*y_^n_,y_,x_,p_):= if(has(b+c,x) and has(b+c,y) and d(b+c,x,2)==0 and abs(p)<=1, x=dsolve(replace(b/y^n+c/y^n,x,zz),zz,y,p) ); dsolve(1/(b_+c_)*y_,y_,x_,p_):= if(has(b+c,x) and has(b+c,y) and d(b+c,x,2)==0 and abs(p)<=1, x=dsolve(replace(b/y+c/y,x,zz),zz,y,p) ); dsolve(y_^n_/(b_+z_),y_,x_,q_) := if(has(b+z,x) and has(b+z,y) and d(b+z,x,2)==0 and abs(q)<=1, dsolve(expand(b/y^n+z/y^n),x,y,q) ); dsolve(y_/(b_+z_), y_,x_,q_) := if(has(b+z,x) and has(b+z,y) and d(b+z,x,2)==0 and abs(q)<=1, x=replace(dsolve(replace(b/y+z/y,x,zz),zz,y,q),zz,x) ); dsolve(exp(xx_)*y_^n_, y_,x_,q_) := if(q<>1 and hasnot(xx,y) and d(xx,x,2)==0, block(f1:=(d(xx,x)/(1-n))^(q/(n-1))*exp(xx/(1-n)), f1 and if(isodd(n), -f1 )) ); dsolve(log(y_)^p_*y_, y_,x_,p_) := if(p<1, exp(exp(C_1+x)) ); dsolve(b_*log(y_)^p_*y_, y_,x_,p_) := if(p<1 and isconstant(b), exp(exp(C_1+b^(1/p)*x)) ); dsolve((c_+x_^2)*y_^4,y_,x_,2):= if(hasnot(c,x), 1.459839713295963/(x^2-7/3c)^(2/3) ); dsolve((c_+x_^2)*y_^3,y_,x_,2):= if(hasnot(c,x), 2.449489742783178/(x^2-3c) and (-2.449489742783178)/(x^2-3c) ); dsolve((c_+x_^2)*y_^2,y_,x_,2):= if(hasnot(c,x), 20/(x^2-5c)^2 ); dsolve((c_+x_^2)*y_^(0.5),y_,x_,2):= if(hasnot(c,x), 3.1887755102040814*10^(-4)*(x^2+7c)^4 ); dsolve((c_+x_^2)*y_^(1/3),y_,x_,2):= if(hasnot(c,x), 0.006085806194501846*(x^2+5c)^3 ); dsolve((c_+x_^2)*y_^(-1/3),y_,x_,2):= if(hasnot(c,x), 0.26084743001221455*(x^2+2c)^(3/2) ); dsolve((c_+x_^2)*y_^(-0.5),y_,x_,2):= if(hasnot(c,x), 0.3699318111495706*(x^2+5/3c)^(4/3) ); dsolve((c_+x_^2)*y_^(-2),y_,x_,2):= if(hasnot(c,x), 1.3103706971044482*(x^2+c/3)^(2/3) ); dsolve((c_+x_^2)*y_^(-4),y_,x_,2):= if(hasnot(c,x), (1.1671687416620735-0.8479977281759988*i)*(x^2-c/5)^(2/5) ); dsolve((x_^2+b_*x_)*y_^2,y_,x_,2):= if(hasnot(b,x), 20/(x^2+b*x+3/2b^2)^2 ); dsolve((x_^2+b_*x_)*y_^0.5,y_,x_,2):= if(hasnot(b,x), 3.1887755102040814*10^(-4)*(x^2+b*x-3/2b^2)^4 ); dsolve((b_*x_+x_^2)*y_^(-0.5),y_,x_,2):= if(hasnot(b,x), 0.3699318111495706*(x^2+b*x-b^2/6)^(4/3) ); dsolve((x_^2+b_*x_)*y_^(-2),y_,x_,2):= if(hasnot(b,x), 1.3103706971044482*(x^2+b*x+b^2/6)^(2/3) ); dsolve((x_^2+b_*x_+c_)*y_^2,y_,x_,2):= if(hasnot(b,c,x), 20/(x^2+b*x+3/2b^2-5c)^2 ); dsolve((x_^2+b_*x_+c_)*y_^0.5,y_,x_,2):= if(hasnot(b,c,x), 3.1887755102040814*10^(-4)*(x^2+b*x-3/2b^2+7c)^4 ); dsolve((c_+b_*x_+x_^2)*y_^(-0.5),y_,x_,2):= if(hasnot(b,c,x), 0.3699318111495706*(x^2+b*x-b^2/6+5/3c)^(4/3) ); dsolve((x_^2+b_*x_+c_)*y_^(-2),y_,x_,2):= if(hasnot(b,c,x), 1.3103706971044482*(x^2+b*x+b^2/6+c/3)^(2/3) ); dsolve(a_*sinh(y_), y_,x_,2) := if(isconstant(a), 2i*am(C_2*x+C_1,-a/C_2^2) ); dsolve(a_*cosh(y_), y_,x_,2) := if(isconstant(a), 2i*am(C_2*x+C_1,a*i/C_2^2)-i*pi/2 ); dsolve(a_*sin(y_), y_,x_,2) := if(isconstant(a), 2am(C_2*x+C_1,-a/C_2^2) ); dsolve(a_*cos(y_), y_,x_,2) := if(isconstant(a), 2am(C_2*x+C_1,a/C_2^2)+pi/2 ); dsolve(x_*y_, y_,x_,2) := C_1*Ai(x)+C_2*Bi(x); dsolve(1/(c_+y_), y_,x_,2) := if(d(c,x,2)==0, i* exp(-inverseerf(sqrt(2)/sqrt(pi)*(C_1 + x))^2)-c and -i*exp(-inverseerf(sqrt(2)/sqrt(pi)*(C_1 + x))^2)-c ); dsolve(1/y_, y_,x_,2) := i*exp(-inverseerf(sqrt(2)/sqrt(pi)*x+C_1)^2) and -i*exp(-inverseerf(sqrt(2)/sqrt(pi)*x+C_1)^2); dsolve(sinh(y_), y_,x_,2) := 2i*am(C_2*x+C_1,-1/C_2^2); dsolve(cosh(y_), y_,x_,2) := 2i*am(C_2*x+C_1,i/C_2^2)-i*pi/2; dsolve(sinh(a_*y_), y_,x_,2) := if(isconstant(a), 2i/a*am(sqrt(a)*C_2*(x+C_1),-1/C_2^2) ); dsolve(cosh(a_*y_), y_,x_,2) := if(isconstant(a), 2i/a*am(sqrt(a)*C_2*(x+C_1),i/C_2^2)-i*pi/2 ); dsolve(sin(y_), y_,x_,2) := 2am(C_2*x+C_1,-1/C_2^2); dsolve(cos(y_), y_,x_,2) := 2am(C_2*x+C_1,1/C_2^2)+pi/2; dsolve(sin(a_*y_), y_,x_,2) := if(hasnot(a,x), 2/a*am(sqrt(a)*C_2*(x+C_1),-1/C_2^2) ); dsolve(cos(a_*y_), y_,x_,2) := if(hasnot(a,x), 2/a*am(sqrt(a)*C_2*(x+C_1),1/C_2^2)+pi/2 ); dsolve(m_/n_,y_,x_,1) :=if(has(n,x) and has(m,y), if(hasnot(m,x),dsolve(expand(replace(n,x,zz)/m),zz,y,1)=x, block(f2:=d(m,y)+d(n,x), if(f2==0,block(f1:=int(n,y),f3:=d(f1,x),f1-int(m+f3,x)=C_1), if(hasnot(simplify(-f2/n),y),block(f1:=exp(int(simplify(-f2/n),x)),p:=int(f1*n,y),g:=d(p,x),expand(p-int(f1*m+g,x))=-C_1), if(hasnot(simplify(-f2/m),x),block(f1:=exp(int(simplify(-f2/m),y)),p:=int(f1*n,y),g:=d(p,x),expand(p-int(f1*m+g,x))=-C_1) )) )))); dsolve(1/m_*n_,y_,x_,1) :=if(has(m,x) and has(n,y), if(hasnot(n,x), dsolve(expand(replace(m,x,zz)/n),zz,y,1)=x, block(f2:=d(n,y)+d(m,x), if(f2==0,block(f1:=int(m,y),f3:=d(f1,x),f1-int(n+f3,x)=C_1), if(hasnot(simplify(-f2/m),y),block(f1:=exp(int(simplify(-f2/m),x)),p:=int(f1*m,y),g:=d(p,x),expand(p-int(f1*n+g,x))=-C_1), if(hasnot(simplify(-f2/n),x),block(f1:=exp(int(simplify(-f2/n),y)),p:=int(f1*m,y),g:=d(p,x),expand(p-int(f1*n+g,x))=-C_1) )) )))); #dsolve1(m_/n_,y_,x_,p_) :=if(p>0 and p<=1 and has(n,x) and has(n,y), block(f2:=(d(m,y,p)+d(n,x,p)), if(f2==0,block(f1:=int(n,y,p),f1-int(m+d(f1,x,p),x,p)=C_1), if(hasnot(simplify(-f2/n),y),block(f1:=exp(int(simplify(-f2/n),x,p)),pp:=int(f1*n,y), pp-int(f1*m+d(pp,x,p),x,p)=C_1), if(hasnot(simplify(-f2/m),x),block(f1:=exp(int(simplify(-f2/m),y,p)),pp:=int(f1*n,y), pp-int(f1*m+d(pp,x,p),x,p)=C_1) )) ))); #dsolve1(n_/m_,y_,x_,p_) :=if(p>0 and p<=1 and has(m,x) and has(m,y), block(f2:=(d(n,y,p)+d(m,x,p)), if(f2==0,block(f1:=int(m,y,p),f1-int(n+d(f1,x,p),x,p)=C_1), if(hasnot(simplify(-f2/m),y),block(f1:=exp(int(simplify(-f2/m),x,p)),pp:=int(f1*m,y), pp-int(f1*n+d(pp,x,p),x)=C_1), if(hasnot(simplify(-f2/n),x),block(f1:=exp(int(simplify(-f2/n),y,p)),pp:=int(f1*m,y), pp-int(f1*n+d(pp,x,p),x)=C_1) )) ))); dsolve(y_*(a_+b_*y_^n_),y_,x_,1):=If(isfree(a,b,y), exp(integrate(a,x))*(C_1-n*integrate(b*exp(n*integrate(a,x)),x))^(-1/n) ); dsolve(y_*(a_+y_^n_),y_,x_,1):=If(isfree(a,y), exp(integrate(a,x))*(C_1-n*integrate(exp(n*integrate(a,x)),x))^(-1/n) ); dsolve(y_*(a_+b_*y_),y_,x_,1):=If(isfree(a,b,y), exp(integrate(a,x))/(C_1-integrate(b*exp(integrate(a,x)),x)) ); dsolve(y_*(a_+y_),y_,x_,1):=If(isfree(a,y), exp(integrate(a,x))/(C_1-integrate(exp(integrate(a,x)),x)) ); #dsolve(b_*y_^n_, y_,x_,1) := If(isfree(b,y), block(f2:=(C_1+(1-n)*integrate(b,x))^(1/(1-n)), f2 and if(isodd(n), -f2) ) ); dsolve(b_*y_, y_,x_,1) := If(isfree(b,y),C_1*exp(integrate(b,x)) ); #dsolve(y_^n_, y_,x_,1) := if(isconstant(n), (C_1+(1-n)*x)^(1/(1-n)) and if(isodd(n),-(C_1+(1-n)*x)^(1/(1-n)) )); #dsolve((c_+y_)^2,y_,x_,1):= block(f1:=d(c,x),if(f1==0,1/(C_1-x)-c,if(hasnot(f1,x), if(f1<0,sqrt(-f1)*tanh(C_1-sqrt(-f1)*x)-c, sqrt(f1)*tan(C_1+sqrt(f1)*x)-c)))); dsolve(x_/(c_+y_), y_,x_,1) := block(a:=d(c,x),if(isconstant(a), -c+a*x-(a+sqrt(a*a+4))/2*x and (-a+sqrt(a*a+4))/2*x-c+a*x )); dsolve(x_/(c_+b_*y_), y_,x_,1) := block(a:=d(c,x),if(isconstant(a,b), (a*x-c)/b-(a+sqrt(a*a+4b))/2/b*x and (-a+sqrt(a*a+4b))/2/b*x+(a*x-c)/b )); dsolve((f1_+x_)/(c_+y_), y_,x_,1) := block(a:=d(c,x),if(isconstant(a,f1), a*x-c-(a+sqrt((a)^2+4))/2*(f1+x)+a*f1 and (-a+sqrt((a)^2+4))/2*(f1+x)+a*x-c+a*f1 )); dsolve((f1_*x_+f2_)/(c_+y_), y_,x_,1) := block(a:=d(c,x),if(isconstant(a,f1,f2), a*x-c-(a+sqrt((a)^2+4f))/2*(x+f2/f1)+a*f2/f1 and (-a+sqrt((a)^2+4f))/2*(x+f2/f1)+a*x-c+a*f2/f1 )); dsolve(f1_*x_/(c_+y_), y_,x_,1) := block(a:=d(c,x),if(isconstant(a,f1), a*x-c-(a+sqrt((a)^2+4f))/2*x and (-a+sqrt((a)^2+4f))/2*x+a*x-c )); dsolve(f1_*x_/(c_+b_*y_), y_,x_,1) := block(a:=d(c,x),if(isconstant(a,b,f1), (a*x-c)/b-(a+sqrt((a)^2+4b*f1))/2/b*x and (-a+sqrt((a)^2+4b*f1))/2/b*x+(a*x-c)/b )); dsolve((a_*x_+b_*y_)/(c_*x_+d_*y_),y_,x_,1) := if(isconstant(a,b,c,d), if(b+c==0,block(p:=c*x+d*y^2/2,p-int(a*x+b*y+d(p,x),x)=C_1), replace(int(expand((c+d*yx)/(a+(b-c)*yx-d*yx^2)),yx),yx,y/x)=C_1-log(x) )); dsolve((a_*x_+b_*y_)/(b_*x_+a_*y_),y_,x_,1) := x; dsolve((a_*x_+a_*y_)/(c_*x_+c_*y_),y_,x_,q_) := int(a/c,x,q)+C_1; dsolve((x_+y_)/(x_-y_),y_,x_,1):= log(x^2+y^2)/2-atan(y/x)+C_1=0; dsolve((c_-y_^n_)/(x_+y_),y_,x_,1):= -int(c,x)+x*y+y^(1+n)/(1+n)=C_1; dsolve((c_-y_^n_)/(b_+x_+y_),y_,x_,1):= -int(c,x)+x*y+y^(1+n)/(1+n)+b*y=C_1; dsolve((f_*y_-y_^n_)/(a_*x_+y_),y_,x_,1):= if(f+a-1==0, a*x*y+y^(1+n)/(1+n)=C_1 ); dsolve((f_*y_-y_^n_)/(b_+a_*x_+y_),y_,x_,1):= if(f+a-1==0, a*x*y+y^(1+n)/(1+n)+b*y=C_1 ); dsolve((c_+f_*y_-y_^n_)/(a_*x_+y_),y_,x_,1):= if(f+a-1==0, -int(c,x)+a*x*y+y^(1+n)/(1+n)=C_1 ); dsolve((c_+f_*y_-y_^n_)/(b_+a_*x_+y_),y_,x_,1):= if(f+a-1==0, -int(c,x)+a*x*y+y^(1+n)/(1+n)+b*y=C_1 ); #dsolve((a_*x_+b_*x_*y_)/(x_+d_*x_*y_),y_,x_,1) := if(isconstant(a,b,d), int((a+b*y)/(1+d*y),y)=C_1+x ); #dsolve((x_+b_*x_*y_)/(c_*x_+d_*x_*y_),y_,x_,1) := if(isconstant(b,c,d), int((1+b*y)/(c+d*y),y)=C_1+x ); #dsolve((a_*x_+b_*x_*y_)/(c_*x_+d_*x_*y_),y_,x_,1) := if(isconstant(a,b,c,d), int((a+b*y)/(c+d*y),y)=C_1+x ); dsolve((a_*y_+b_*x_*y_)/(x_+d_*x_*y_),y_,x_,1) := if(isconstant(a,b,d), log(y)+d*y=a*log(x)+b*x+C_1 ); dsolve((y_+b_*x_*y_)/(c_*x_+d_*x_*y_),y_,x_,1) := if(isconstant(b,c,d), c*log(y)+d*y=log(x)+b*x+C_1 ); dsolve((a_*y_+b_*x_*y_)/(c_*x_+d_*x_*y_),y_,x_,1) := if(isconstant(a,b,c,d), c*log(y)+d*y=a*log(x)+b*x+C_1 ); dsolve(x_/y_, y_,x_,1) := sqrt(C_1+x^2) and -sqrt(C_1+x^2); dsolve(b_*y(p_,x_)^n_,y_,x_,q_):= if(isfree(b,y),if(isfree(b,x), if(n== -1, gsolution(0,y,x,p)+sqrt(b/(fallingfactorial((p+q)/2,p)*fallingfactorial((p+q)/2,q)))*(C_1+x)^((p+q)/2), b^(1/(1-n))*int(dsolve(y^n,y,x,q-p),x,p)+gsolution(0,y,x,p) ), if(q-p==1,block(f2:=int(C_1-(n-1)*int(b,x)^(1/(1-n)),x,p), f2 and if(isodd(n), -f2)+gsolution(0,y,x,p)) )), if(hasnot(b,x) and n<>2, int(((2-n)*int(b,y,q-p)+C_1)^(1/(n-q)),y,p)=(C_2+x) )); #dsolve(b_*y(p_,x_)^n_,y_,x_,q_):= if(isfree(b,y),if(isfree(b,x), if(n== -1, gsolution(0,y,x,p)+sqrt(b/(fallingfactorial((p+q)/2,p)*fallingfactorial((p+q)/2,q)))*(C_1+x)^((p+q)/2), b^(1/(1-n))*int(dsolve(y^n,y,x,q-p),x,p)+gsolution(0,y,x,p) ), if(hasnot(b,x) and n<>2, int(((2-n)*int(b,y,q-p)+C_1)^(1/(n-q)),y,p)=(C_2+x) ))); #dsolve(b_/y(p_,x_),y_,x_,q_):= if(isconstant(b),C_2+sqrt(b/(fallingfactorial((p+q)/2,p)*fallingfactorial((p+q)/2,q)))*(C_1+x)^((p+q)/2), if(has(b,y) and hasnot(b,x), int(1/cbrt(C_1+int(b,y)),y)=cbrt(3)*x+C_2, if(has(b,x) and hasnot(b,y), C_2-int(sqrt(C_1+2int(b,x)),x,p) and C_2+int(sqrt(C_1+2int(b,x)),x,p) ))); #dsolve(a_/y(p_,x_),y_,x_,q_) := if(hasnot(a,y),-int(sqrt(C_1+2int(a,x,q-p)),x,p)+gsolution(0,y,x,p) and int(sqrt(C_1+2int(a,x,q-p)),x,p)+gsolution(0,y,x,p) ); dsolve(b_/y(p_,x_),y_,x_,q_) := if(has(b,y) and hasnot(b,x), int(1/cbrt(C_1+3int(b,y,p)),y)=x+C_2, if(hasnot(b,y), if(q-p==1, gsolution(0,y,x,p)-int(sqrt(C_1+2int(b,x)),x,p) and gsolution(0,y,x,p)+int(sqrt(C_1+2int(b,x)),x,p), int(dsolve(b/y,y,x,q-p),x,p)+gsolution(0,y,x,p) ))); dsolve(b_*y(1,x_)^2,y_,x_,2):=if(hasnot(b,y),if(hasnot(b,x), C_2 - log(C_1 - b*x)/b and C_2 - log(C_1 + b*x)/b, int(1/(C_1-int(b,x)),x)+C_2), int(exp(-int(b,y)),y)=C_2+C_1*x); #dsolve(f1_*y(1,x_)^2,y_,x_,2):= if(hasnot(f1,y), int(1/(C_1-int(f1,x)),x)+C_2, int(exp(-int(f1,y)),y)=C_2+C_1*x ); #dsolve(b_/y(1,x_),y_,x_,3):= if(isconstant(b), C_2-sqrt(-b*pi)/2erf(sqrt(2)*inverseerf(C_1+x*sqrt(2sgn(b))/sqrt(pi))) and C_2+sqrt(-b*pi)/2erf(sqrt(2)*inverseerf(C_1+x*sqrt(2sgn(b))/sqrt(pi))) ); dsolve(b_*y(p_,x_),y_,x_,q_):= gsolution(b,p,0,y,x,q); dsolve(exp(x_)*y(p_,x_)^n_,y_,x_,q_) := block(f1:=(1-n)^((q-n*p)/(1-n))*exp(x/(1-n)),f1+gsolution(0,y,x,p) and if(isodd(n),-f1+gsolution(0,y,x,p)) ); dsolve(a_*y(1,x_)^n_,y_,x_,2) := if(hasnot(a,y),int(solve(dsolve(a*y^n,y,x,1),y),x)+C_2 ); dsolve(exp(b_*y_+c_)/y(p_,x_),y_,x_,q_) := if(hasnot(b,x) and d(c,x,p)==0, block(f1:=(-1)^(p+q)*(p+q)^2*(p-1)!*(q-1)!/b^2, log(f1/(C_1+x)^(p+q))/b-c/b and if(iseven(p+q), log(f1/(C_1-x)^(p+q))/b-c/b ))); #dsolve(exp(y_+c_)/y(p_,x_),y_,x_,q_) := if(d(c,x,p)==0, block(f1:=(-1)^(p+q)*(p+q)^2*(p-1)!*(q-1)!, log(f1/(C_1+x)^(p+q))-c and if(iseven(p+q), log(f1/(C_1-x)^(p+q))-c ))); dsolve(exp(b_*y_)/y(p_,x_),y_,x_,q_) := if(hasnot(b,x), block(f1:=(-1)^(p+q)*(p+q)^2*(p-1)!*(q-1)!/b^2, log(f1/(C_1+x)^(p+q))/b and if(iseven(p+q), log(f1/(C_1-x)^(p+q))/b ))); dsolve(exp(y_)/y(p_,x_),y_,x_,q_) := block(f1:=(-1)^(p+q)*(p+q)^2*(p-1)!*(q-1)!, log(f1/(C_1+x)^(p+q)) and if(iseven(p+q), log(f1/(C_1-x)^(p+q)) )); dsolve(y_^m_*y(p_,x_)^n_,y_,x_,q_) := if(m+n-1==0,C_1*exp(x), (fallingfactorial((n*p-q)/(n+m-1),p)^(-n)*fallingfactorial((n*p-q)/(n+m-1),q))^(1/(n+m-1))*(C_1+x)^((n*p-q)/(n+m-1)) ); dsolve(y_*y(p_,x_)^n_,y_,x_,q_) := (fallingfactorial((n*p-q)/(n),p)^(-n)*fallingfactorial((n*p-q)/(n),q))^(1/(n))*(C_1+x)^((n*p-q)/(n) ); dsolve(y_/y(p_,x_),y_,x_,q_) := block(f1:=1/(fallingfactorial(p+q,p)*fallingfactorial(p+q,q)), f1*(C_1+x)^(p+q) and if(iseven(p+q), f1*(C_1-x)^(p+q) )); dsolve((c_+y_)/y(p_,x_),y_,x_,q_) := if(d(c,x,p)==0, block(f1:=1/(fallingfactorial(p+q,p)*fallingfactorial(p+q,q)), f1*(C_1+x)^(p+q)-c and if(iseven(p+q), f1*(C_1-x)^(p+q)-c)) ); dsolve((c_+y_)^m_/y(p_,x_),y_,x_,q_) := if(d(c,x,p)==0,if(m==2,C_1*exp(x)-c, (fallingfactorial((p+q)/(2-m),p)*fallingfactorial((p+q)/(2-m),q))^(1/(m-2))*(C_1+x)^((p+q)/(2-m))-c )); #dsolve(y_^n_*y(1,x_)^m_,y_,x_,2):= x^((m-2)/(m+n-1)) ; dsolve(y_*y(1,x_)^2,y_,x_,2):= sqrt(2)*inverseerf(C_1*x+C_2); dsolve(y_*y(1,x_),y_,x_,2):= 2C_1*tan(C_1*x+C_2) and -2C_1*tanh(C_1*x+C_2); dsolve(1/y_/y(1,x_),y_,x_,2):= -cbrt(3)*exp((-inversegamma(2/3,x))); dsolve(1/y_*y(1,x_)^2,y_,x_,2):=C_1*exp(C_2*x); dsolve(y(n_,x_)^a_*y(p_,x_)^b_,y_,x_,q_) := if(a+b-1==0, C_2*exp(C_1*x),int(dsolve(y^a*y(p-n,x)^b,y,x,q-n),x,n)+gsolution(0,y,x,n) ); dsolve(y(n_,x_)*y(p_,x_),y_,x_,q_) := int(dsolve(y*y(p-n,x),y,x,q-n),x,n)+gsolution(0,y,x,n); #3x; dsolve(b_*x_*y_^n_, y_,x_,q_) := if(q<>1 and isconstant(b,n), block(f2:=(1/b*fallingfactorial((1+q)/(1-n),q))^(1/(n-1))/(x^((1+q)/(n-1))), f2 and if(isodd(n),-f2 ))); dsolve(b_*x_^m_*y_^n_, y_,x_,q_) := if(q<>1 and isconstant(b,n), block(f2:=(1/b*fallingfactorial((m+q)/(1-n),q))^(1/(n-1))/(x^((m+q)/(n-1))), f2 and if(isodd(n),-f2 ))); dsolve(a_*exp(y_)*z_, y_,x_,p_) := if(hasnot(a,x) and hasnot(z,y) and p<>1, ln(p,gsolution(0,y,x,p)+a*p!*int(z,x,p)) ); dsolve(a_*exp(b_*y_)*z_, y_,x_,p_) := if(hasnot(a,b,x) and hasnot(z,y), dsolve(exp(b*y)*z,y,x,p)-log(a)/b ); dsolve(a_*exp(c_+y_)*z_, y_,x_,p_) := if(hasnot(a,x) and hasnot(z,y) and d(c,x,p)==0, ln(p,gsolution(0,y,x,p)+a*p!*int(z,x,p))-c ); dsolve(a_*exp(c_+b_*y_)*z_, y_,x_,p_) := if(hasnot(a,x) and hasnot(z,y) and d(c,x,p)==0, dsolve(exp(b*y)*z,y,x,p)-c/b-log(a)/b ); dsolve(a_*exp(c_+x_)*z_, y_,x_,p_) := if(hasnot(a,c,z,x), replace(dsolve(a*exp(x)*z,y,x,p),x,x+c) ); dsolve(a_*exp(xx_)*y_^n_, y_,x_,q_) := if(q<>1 and isconstant(a) and hasnot(xx,y) and d(xx,x,2)==0, block(f1:=a^(1/(1-n))*(d(xx,x)/(1-n))^(q/(n-1))*exp(xx/(1-n)), f1 and if(isodd(n), -f1 ))); #dsolve(a_*exp(y_)*x_, y_,x_,p_) := if(p<>-1 and isconstant(a), -log((-1)^(-p)*a/((p-1)!+p!)*x^(p+1)) ); #dsolve(a_*exp(y_)*x_^n_, y_,x_,p_) := if(p<>-n and isconstant(a), -log((-1)^(-p)*a/(n*(p-1)!+p!)*x^(n+p)) ); #dsolve(b_*exp(c_*y_), y_,x_,n_) := if(n>0 and isconstant(b,c), log((-1)^(n)/b/c*n!/(C_1+x)^n)/c and if(iseven(n),log((-1)^(n)*n!/b/c/(C_1-x)^n)/c )); #dsolve(b_*exp(c_+y_), y_,x_,n_) := if(n>0 and isconstant(b) and d(c,x,n)==0, log((-1)^(n)*n!/b/(C_1+x)^n)-c,if(n==1 and d(c,x,2)==0, -log(C_1-b*exp(c)/d(c,x)) )); #dsolve(b_*exp(c_+f1_*y_), y_,x_,n_) := if(n>0 and isconstant(b,f1) and d(c,x,n)==0, log((-1)^(n)*n!/b/f1/(C_1+x)^n)/f1-c/f1 ); #dsolve(a_*exp(b_*y_)*x_^n_, y_,x_,p_) := if(p<>-n and isconstant(a,b), -log((-1)^(-p)*a*b/(n*(p-1)!+p!)*x^(n+p))/b ); #dsolve(a_*exp(b_*y_)*(c_+x_)^n_, y_,x_,p_) := if(p<>-n and isconstant(a,b,c), -log((-1)^(-p)*a*b/(n*(p-1)!+p!)*(c+x)^(n+p))/b ); #dsolve(a_*exp(y_)*(c_+x_), y_,x_,p_) := if(p<>-1 and isconstant(a,c), -log((-1)^(-p)*a/((p-1)!+p!)*(c+x)^(p+1)) ); #dsolve(a_*exp(b_*y_)*x_, y_,x_,p_) := if(p<>-1 and isconstant(a,b), -log((-1)^(-p)*a*b/((p-1)!+p!)*x^(1+p))/b ); #dsolve(a_*exp(b_*y_)*(c_+x_), y_,x_,p_) := if(p<>-1 and isconstant(a,b,c), -log((-1)^(-p)*a*b/((p-1)!+p!)*(c+x)^(1+p))/b ); #dsolve(b_*x_^m_*(f1_+y_)^n_, y_,x_,q_) := If(isconstant(b,f1), block(f2:=(1/b*fallingfactorial((m+q)/(1-n),q))^(1/(n-1))*(x)^((m+q)/(1-n)), f2-f1 and if(isodd(n),-f2-f1 )) ); dsolve(b_*(c_+x_)^m_*y_^n_, y_,x_,q_) := If(isconstant(b,c,n), block(f2:=(1/b*fallingfactorial((m+q)/(1-n),q))^(1/(n-1))/(C_1+(c+x)^((m+q)/(n-1))), f2 and if(isodd(n),-f2 )) ); #dsolve(b_*(c_+x_)^m_*(f1_+y_)^n_, y_,x_,q_) := If(isconstant(b,c,f1,n), block(f2:=(1/b*fallingfactorial((m+q)/(1-n),q))^(1/(n-1))*(c+x)^((m+q)/(1-n)), f2-f1 and if(isodd(n),-f2-f1 )) ); dsolve(a_*exp(xx_+y_)*z_, y_,x_,1) := if(hasnot(a,xx,z,y) and hasnot(y,x), solve(int(exp(-y),y)=int(a*exp(xx)*z,x)-C_1,y), if(hasnot(xx,y) and hasnot(a,y,z,x), solve(int(exp(-y)/a/z,y)=int(exp(xx),x)-C_1,y) )); dsolve(b_*exp(y_+c_)/y(p_,x_),y_,x_,q_) := if(isconstant(b) and d(c,x,p)==0, log((-1)^(p+q)*(p+q)^2*(p-1)!*(q-1)!/b/(C_1+x)^(p+q))-c and if(iseven(p+q), log((-1)^(p+q)*(p+q)^2*(p-1)!*(q-1)!/b/(C_1-x)^(p+q))-c )); dsolve(b_*exp(y_)/y(p_,x_),y_,x_,q_) := if(isconstant(b), log((-1)^(p+q)*(p+q)^2*(p-1)!*(q-1)!/b/(C_1+x)^(p+q)) and if(iseven(p+q), log((-1)^(p+q)*(p+q)^2*(p-1)!*(q-1)!/b/(C_1-x)^(p+q)) )); dsolve(b_*y_/y(p_,x_),y_,x_,q_) := if(isconstant(b), block(f1:=b/(fallingfactorial(p+q,p)*fallingfactorial(p+q,q)), f1*(C_1+x)^(p+q) and if(iseven(p+q), f1*(C_1-x)^(p+q) ))); dsolve(b_*y_^m_*y(p_,x_)^n_,y_,x_,q_) := if(m+n-1==0,C_1*exp(cbrt(b)*x), (b*fallingfactorial((n*p-q)/(n+m-1),p)^(-n)*fallingfactorial((n*p-q)/(n+m-1),q))^(1/(n+m-1))*(C_1+x)^((n*p-q)/(n+m-1)) ); dsolve(a_*y(n_,x_)*y(p_,x_),y_,x_,q_) := if(hasnot(a,y), int(dsolve(a*y*y(p-n,x),y,x,q-n),x,n)+gsolution(0,y,x,n),gsolution(0,y,x,p) ); dsolve(c_*y(n_,x_)*y(p_,x_)^b_,y_,x_,q_) := int(dsolve(c*y*y(p-n,x)^b,y,x,q-n),x,n); dsolve(c_*y(n_,x_)^a_*y(p_,x_)^b_,y_,x_,q_) := int(dsolve(c*y^a*y(p-n,x)^b,y,x,q-n),x,n); dsolve(b_/y_/y(1,x_),y_,x_,2):= if(isconstant(b), -cbrt(3b)*exp((-inversegamma(2/3,x))) ); dsolve(b_/y_*y(1,x_)^2,y_,x_,2) := if(hasnot(b,x), (C_2 + C_1 *x)^(1/(1 - b)) ); dsolve(b_*y_*y(1,x_)^2,y_,x_,2):= if(hasnot(b,x), (2/b)^0.5* inverseerf(x+C_1) ); dsolve(b_*y_*y(1,x_),y_,x_,2):= if(hasnot(b,x), 2/b*C_1*tan(C_2+C_1*x) and -2/b*C_1*tanh(C_2+C_1*x) ); dsolve(-x_^n_*y_^m_/y(p_,x_),y_,x_,q_) := if(m<>2,-(fallingfactorial((n+p+q)/(2-m),p)*fallingfactorial((n+p+q)/(2-m),q))^(1/(m-2))*x^((n+p+q)/(2-m)) ); dsolve(-x_^n_*y_/y(p_,x_),y_,x_,q_) := -1/(fallingfactorial(n+p+q,p)*fallingfactorial(n+p+q,q))*x^(n+p+q); dsolve(-x_*y_^m_/y(p_,x_),y_,x_,q_) := if(m<>2,(-fallingfactorial((1+p+q)/(2-m),p)*fallingfactorial((1+p+q)/(2-m),q))^(1/(m-2))*x^((1+p+q)/(2-m)) ); dsolve(-x_*y_/y(p_,x_),y_,x_,q_) := -1/(fallingfactorial(1+p+q,p)*fallingfactorial(1+p+q,q))*x^(1+p+q); dsolve(x_^n_*y_^m_/y(p_,x_),y_,x_,q_) := if(m<>2,(fallingfactorial((n+p+q)/(2-m),p)*fallingfactorial((n+p+q)/(2-m),q))^(1/(m-2))*x^((n+p+q)/(2-m)) ); dsolve(x_^n_*y_/y(p_,x_),y_,x_,q_) := 1/(fallingfactorial(n+p+q,p)*fallingfactorial(n+p+q,q))*x^(n+p+q); dsolve(x_*y_^m_/y(p_,x_),y_,x_,q_) := if(m<>2,(fallingfactorial((1+p+q)/(2-m),p)*fallingfactorial((1+p+q)/(2-m),q))^(1/(m-2))*x^((1+p+q)/(2-m)) ); dsolve(x_*y_/y(p_,x_),y_,x_,q_) := 1/(fallingfactorial(1+p+q,p)*fallingfactorial(1+p+q,q))*x^(1+p+q); dsolve(exp(x_)/y_/y(p_,x_),y_,x_,q_) := 3exp(x/3); dsolve(exp(-x_)/y_/y(p_,x_),y_,x_,q_) := -3exp(-x/3); dsolve(exp(x_)/y(m_,x_)/y(n_,x_),y_,x_,q_) := cbrt(C_1+3^(m+n+q)*exp(x))+gsolution(0,y,x,m); dsolve(exp(-x_)/y(m_,x_)/y(n_,x_),y_,x_,q_):= cbrt(C_1+3^(m+n+q)*exp(-x))+gsolution(0,y,x,m); dsolve(exp(x_)*y(n_,x_)*y(p_,x_),y_,x_,q_) := (-1)^(q-p-n)*exp(-x)+gsolution(0,y,x,n); #dsolve(exp(x_)/y(p_,x_)*y(n_,x_),y_,x_,q_) := exp(x)+gsolution(0,y,x,min(p,n)); #dsolve(exp(x_)/y(m_,x_)*y(n_,x_),y_,x_,q_) := exp(x)+gsolution(0,y,x,min(m,n)); dsolve(1/y_*y(n_,x_)*y(p_,x_),y_,x_,q_) := C_1*exp(C_2*x); #dsolve(y(a_,x_)*y(b_,x_)/y(c_,x_),y_,x_,q_) := C_3*exp(x)+gsolution(0,y,x,a); #dsolve(y(a_,x_)/y(b_,x_)*y(c_,x_),y_,x_,q_) := C_3*exp(x)+gsolution(0,y,x,a); #dsolve(1/y(a_,x_)*y(b_,x_)*y(c_,x_),y_,x_,q_) := C_3*exp(x)+gsolution(0,y,x,a); dsolve((x_+n_)/x_*y(1,x_),y_,x_,2):= if(isconstant(n), C_1*Gamma(1+n,-x)+C_2); dsolve(-(x_+n_)/x_*y(1,x_),y_,x_,2):= if(isconstant(n), C_1*Gamma(1-n,x)+C_2); #4x; dsolve(a_*exp(x_)*y_/y(p_,x_),y_,x_,q_) := if(isconstant(a), a*exp(x) ); dsolve(a_*exp(x_)/y_/y(p_,x_),y_,x_,q_) := if(isconstant(a), 3cbrt(a)*exp(x/3) ); dsolve(a_*exp(x_)*y(n_,x_)*y(p_,x_),y_,x_,q_) := if(isconstant(a), (-1)^(q-p-n)/a*exp(-x)+gsolution(0,y,x,n) ); dsolve(a_*exp(x_)/y(m_,x_)/y(n_,x_),y_,x_,q_) := if(isconstant(a), cbrt(C_1+3^(m+n+q)*a*exp(x))+gsolution(0,y,x,m) ); #2+; dsolve(a_ and b_, y_,x_,p_) := dsolve(a, y,x,p) and dsolve(b, y,x,p); dsolve(a_ and b_ and c_ and d_, y_,x_,p_) := dsolve(a, y,x,p) and dsolve(b, y,x,p) and dsolve(c, y,x,p) and dsolve(d, y,x,p); dsolve(a_+y_, y_,x_,q_) := if(hasnot(a,y), gsolution(1,y,x,q)+If(q>0 and isfree(a,x),-a,psolution(1,a,y,x,q)) ); dsolve(a_+b_*y_, y_,x_,q_) := if(hasnot(a,y), gsolution(b,y,x,q)+psolution(b,a,y,x,q)); #dsolve(a_+y_^2, y_,x_,p_) := if(a>0 and p<>2, tan(p,sqrt(a)*x^p+c_1)*sqrt(a), if(a<0 and p<>2, -tanh(p,sqrt(-a)*x^p+c_1)*sqrt(-a) )); dsolve(a_*x_^p_+y_^2,y_,x_,p_):= if(isconstant(a), cbrt(a)*AiPrime(p,-cbrt(a)*x^p)/Ai(p,-cbrt(a)*x^p) ); dsolve(a_+y_, y_,x_,2) := if(isfree(a,y),if(isfree(a,x), C_1*exp(x)+C_2*exp(-x)-a, C_1*exp(x)+C_2*exp(-x)+psolution(1,a,y,x,2) )); dsolve(a_+y_^2,y_,x_,2):= if(hasnot(a,y), weierstrassP(x+C_1,-2a,C_2) ); dsolve(a_+c_*y_^2,y_,x_,2):= if(hasnot(a,y) and d(c,x)==0, weierstrassP(x+C_1,-2a*c,C_2)/c ); dsolve(a_+y_^2, y_,x_,1) := if(a>0, tan(sqrt(a)*x+C_1)*sqrt(a), if(a<0, -tanh(sqrt(-a)*x+C_1)*sqrt(-a), if(hasnot(a,y),block(u:=gsolution(-a,y,x,2), -d(u,x)/u) ))); dsolve(a_+c_*y_^2, y_,x_,1) := if(isconstant(a,c), if(sgn(a*c)<0,tanh(sgn(a)*sqrt(-a*c)*x+C_1)*sqrt(-a/c),tan(sgn(a)*sqrt(a*c)*x+C_1)*sqrt(a/c)), if(hasnot(a,y),block(u:=gsolution(d(c,x)/c,-a*c,y,x,2), -d(u,x)/u/c) )); dsolve(a_*c_+c_*y_^2, y_,x_,p_) := if(isconstant(a), if(a<0,-tanh(p,sqrt(-a)*p!*int(c,x,p)+gsolution(0,y,x,p))*sqrt(-a), tan(p,sqrt(a)*p!*int(c,x,p)+gsolution(0,y,x,p))*sqrt(a) )); dsolve(a_*c_+b_*c_*y_^2, y_,x_,p_) := if(isconstant(a,b), if(a*b<0,sgn(a)*tanh(p,(-a/b)*p!*int(c,x,p)+gsolution(0,y,x,p))*sqrt(-a/b), sgn(a)*tan(p,(a/b)*p!*int(c,x,p)+gsolution(0,y,x,p))*sqrt(a/b) )); dsolve(y_+b_*y_^n_,y_,x_,p_) := if(p<=1, -E(p,C_2+x^p)*(C_1+(n-1)*integrate(b*E(p,(n-1)*C_2+(n-1)*x^p),x,p))^(1/(1-n)) ); dsolve(a_*y_+y_^n_,y_,x_,p_):= if(p<=1, block(dsolve:=p!*integrate(a,x,p),f1:=(C_1+(1-n)*integrate(E(p,(n-1)*C_2+(n-1)*dsolve),x,p)),E(p,C_2+dsolve)*f1^(1/(1-n)) )); dsolve(a_*y_+b_*y_^n_,y_,x_,p_):= if(p<=1, block(dsolve:=p!*integrate(a,x,p),f1:=(C_1+(1-n)*integrate(b*E(p,(n-1)*C_2+(n-1)*dsolve),x,p)),E(p,C_2+dsolve)*f1^(1/(1-n)) )); dsolve(y_+y_^n_,y_,x_,p_) := -E(p,C_2+x^p)*(C_1+E(p,(n-1)*C_2+(n-1)*x^p))^(1/(1-n)) ; dsolve(a_*x_+b_*y_^0.5,y_,x_,p_):= if(isconstant(a,b) and p>2 and sgn(a*b)+1==0, (a/b)^2*x^2 ); dsolve(a_*x_+b_*y_^0.5,y_,x_,2):= if(isconstant(a,b), (a/b)^2*(x-2a/b^2)^2 ); dsolve(x_+b_*y_^0.5,y_,x_,2):= if(isconstant(b), 1/b^2*(x-2/b^2)^2 ); dsolve(a_*x_+y_^0.5,y_,x_,2):= if(isconstant(a), a^2*(x-2a)^2 ); #dsolve(x_-y_^0.5,y_,x_,2):= (x-2)^2; #dsolve(-x_+y_^0.5,y_,x_,2):= (x+2)^2; dsolve(x_+b_*y_, y_,x_,2) := if(isfree(b,x), gsolution(b,y,x,2)-x/b, gsolution(b,y,x,2)+psolution(b,x,y,x,2) ); dsolve(x_+y_, y_,x_,2) := C_1*exp(x)+C_2*exp(-x)-x; dsolve(y_^3+b_*y_, y_,x_,2) := if(b<0,sqrt(-2b)*sec(C_1+sqrt(-b)*x),sqrt(2b)*csch(C_1+sqrt(b)*x) ); dsolve(a_*y_^3+y_, y_,x_,2) := sqrt(2/a)*csch(C_1+x); dsolve(a_*y_^3+b_*y_, y_,x_,2) := if(b<0,sqrt(-2b/a)*sec(C_1+sqrt(-b)*x),sqrt(2b/a)*csch(C_1+sqrt(b)*x) ); dsolve(-y_+y_^3, y_,x_,2) := sqrt(2)*sec(C_1+x); dsolve(y_-y_^3, y_,x_,2) := sqrt(2)*sech(C_1+x); #dsolve(-y_-y_^3, y_,x_,2) := sqrt(-2)*sec(C_1+x); dsolve(y_+y_^3, y_,x_,2) := sqrt(2)*csch(C_1+x); dsolve(y_+y_^2, y_,x_,2) := weierstrassP(x+C_1,1/2,C_2)-1/2; dsolve(b_*y_+y_^2, y_,x_,2) := if(d(b,x,2)==0,weierstrassP(x+C_1,b^2/2,C_2)-b/2 ); dsolve(y_+c_*y_^2, y_,x_,2) := if(d(c,x)==0, weierstrassP(x+C_1,1/2,C_2)/c-1/c/2 ); dsolve(b_*y_+c_*y_^2, y_,x_,2) := if(d(b,x,2)==0 and d(c,x)==0, weierstrassP(x+C_1,b^2/2,C_2)/c-b/c/2 ); dsolve(b_+b_*y_^n_,y_,x_,1):=if(isconstant(b),hypergeometric2F1( 1,1/n,1+1/n, -y )*y=C_1+b*x); dsolve(1+y_^n_,y_,x_,1):=hypergeometric2F1( 1,1/n,1+1/n, -y )*y=C_1+x; dsolve(a_+y_^0.5,y_,x_,1):= if(isconstant(a),a^2 *(W(C_1*exp(-x/(2a))) + 1)^2); dsolve(a_+b_*y_^0.5,y_,x_,1):= if(isconstant(a,b),(-a/b*(W(C_1*exp(-x*b^2/(2a)))+1))^2); dsolve(a_*x_+y_^0.5,y_,x_,1):= if(isconstant(a),(sqrt(8a+1)+4a+1)/8*x^2); dsolve(a_*x_+b_*y_^0.5,y_,x_,1):= if(isconstant(a,b),if(b>0,(sqrt(8a*b^2+b^4)+4a+b^2)/8*x^2, (-sqrt(8a*b^2+b^4)+4a+b^2)/8*x^2 )); dsolve(a_+b_*y_,y_,x_,1):=If(isfree(a,b,y), If(isfree(a,b,x), C_1*exp(b*x)-a/b, C_1*exp(integrate(b,x))+psolution(b,a,y,x,1) )); #dsolve(a_+y_/x_,y_,x_,1):=replace(int(1/replace(a,y/x,zz),zz),zz,y/x)-log(x)=C_1; dsolve(a_/x_+y_/x_,y_,x_,1):= if(isconstant(a),C_1*x-a, if(isfunction(a) and has(argument(a,1),y(1,x)),C_1*x-replace(a,y(1,x),C_1),if(hasnot(a,y), C_1*x+int(a/x^2,x)*x ))); dsolve(a_*b_/x_+y_/x_,y_,x_,1):= if(isconstant(a,b),C_1*x+a*b, if(isfunction(b) and has(argument(b,1),y(1,x)),C_1*x-a*replace(b,y(1,x),C_1),if(hasnot(a,b,y), C_1*x-int(a*b/x^2,x)*x ))); dsolve(c_+x_*y_^2, y_,x_,1) := if(isconstant(c), -Ai(-cbrt(c)*x)/AiPrime(-cbrt(c)*x)*abs(c)^(2/3) and -Bi(-cbrt(c)*x)/BiPrime(-cbrt(c)*x)*abs(c)^(2/3) ); dsolve(c_+b_*x_*y_^2, y_,x_,1) := if(isconstant(b,c), -Ai(-cbrt(b*c)*x)/AiPrime(-cbrt(b*c)*x)*abs(b*c)^(2/3)/b and -Bi(-cbrt(b*c)*x)/BiPrime(-cbrt(b*c)*x)*abs(b*c)^(2/3)/b ); dsolve(a_+a_*y_^2, y_,x_,1) := tan(int(a,x)+C_1); dsolve(a_+x_/y_,y_,x_,1):=if(has(x/y),replace(int(1/(zz-1/zz-replace(a,x/y,zz)),zz),zz,y/x)-log(x)=C_1 ); dsolve(y_+b_*y_^n_,y_,x_,1):=If(isfree(b,y), exp(x)*(C_1+(1-n)*integrate(b*exp((n-1)*x),x))^(1/(1-n)) ); dsolve(a_*y_+y_^n_,y_,x_,1):=If(isfree(a,y), exp(integrate(a,x))*(C_1+(1-n)*integrate(exp((n-1)*integrate(a,x)),x))^(1/(1-n)) ); dsolve(a_*y_+b_*y_^n_,y_,x_,1):=If(isfree(a,b,y), exp(integrate(a,x))*(C_1+(1-n)*integrate(b*exp((n-1)*integrate(a,x)),x))^(1/(1-n)) ); dsolve(x_+b_/y_, y_,x_,1) := if(isconstant(b),(2^(1/3)* x *Ai((x^2 - 2 y)/(2 *2^(1/3) *b^(2/3))) - 2 b^(1/3)* AiPrime((x^2 - 2 y)/(2 *2^(1/3)* b^(2/3))))/(2^(1/3) *x *Bi((x^2 - 2y )/(2 *2^(1/3) *b^(2/3))) - 2 b^(1/3) *BiPrime((x^2 - 2 *y)/(2 *2^(1/3) *b^(2/3)))) + C_1 = 0); dsolve(b_+b_/y_, y_,x_,1) := -W(C_1*exp(-int(b,x))) - 1; dsolve(1+1/y_, y_,x_,1) := -W(C_1*exp(-x)) - 1; dsolve(1+x_/y_, y_,x_,1) := ((5 + sqrt(5))* log(-2 y/x + sqrt(5) + 1) - (sqrt(5) - 5) *log(2 y/x + sqrt(5) - 1)) = C_1 -10 log(x); dsolve(y_/x_+x_/y_,y_,x_,1):= 2log(x)-x^(-2)*y^2=C_1; dsolve(b_*x_+y_^2, y_,x_,1) := if(isconstant(b), cbrt(b)* AiPrime(cbrt(-b) *x)/Ai(cbrt(-b) *x) and cbrt(b) *BiPrime(cbrt(-b) *x)/Bi(cbrt(-b) *x) ); dsolve(c_*x_^n_+b_*y_^2, y_,x_,1) := if(isconstant(b,c),if(n==-2,(sqrt(1 - 4 b *c) *((2 C_1)/(x^sqrt(1 - 4 b* c) + C_1) - 1) - 1)/(2 b* x), -sqrt(b*c)*besselJ((-n-1)/(n+2),2/(n+2)*sqrt(b*c)*x^(n/2+1))/besselJ(1/(n+2),2/(n+2)*sqrt(b*c)*x^(n/2+1))*x^(n/2) )); dsolve(x_^n_+y_^2, y_,x_,1) := if(n==-2, (-1 + i *sqrt(3)* (-1 + (2 C_1)/(C_1 + x^(i* sqrt(3)))))/(2 x), besselJ((-n-1)/(n+2),2/(n+2)*x^(n/2+1))/besselJ(1/(n+2),2/(n+2)*x^(n/2+1))*x^(n/2) and -besselJ((n+1)/(n+2),2/(n+2)*x^(n/2+1))/besselJ(-1/(n+2),2/(n+2)*x^(n/2+1))*x^(n/2) ); dsolve(x_^2+y_^2, y_,x_,1) := (x^2 *(-C_1* besselJ(-5/4,x^2/2) + C_1*besselJ(3/4,x^2/2) - 2 besselJ(-3/4,x^2/2)) - C_1*besselJ(-1/4,x^2/2))/(2 x *(C_1*besselJ(-1/4,x^2/2) + besselJ(1/4,x^2/2))); dsolve(x_+y_^2, y_,x_,1) := (AiPrime(-x)+C_1*BiPrime(-x))/(Ai(-x)+C_1*Bi(-x)); dsolve(1+y_^2, y_,x_,1) := tan(x+C_1); dsolve(b_*exp(-x_)+a_*exp(x_)*y_^2,y_,x_,1):= if(isconstant(a,b),(2 atan((2 a *exp(x)*y + 1)/sqrt(4 a *b - 1)))/sqrt(4 a *b - 1)=C_1+x ); dsolve(b_*exp(x_)+a_*exp(-x_)*y_^2,y_,x_,q_):= if(isconstant(a,b) and q<=1,(-2 atan(1-q,(-2 a *exp(-x)*y + 1)/sqrt(4 a *b - 1)))/sqrt(4 a *b - 1)=C_1+x^q ); dsolve(b_*exp(-x_)+exp(x_)*y_^2,y_,x_,1):= if(isconstant(b),(2 atan((2exp(x)*y + 1)/sqrt(4b - 1)))/sqrt(4b - 1)=C_1+x ); dsolve(b_*exp(x_)+exp(-x_)*y_^2,y_,x_,q_):= if(isconstant(b) and q<=1,(-2 atan(1-q,(-2exp(-x)*y + 1)/sqrt(4b - 1)))/sqrt(4b - 1)=C_1+x^q ); dsolve(exp(-x_)+exp(x_)*y_^2,y_,x_,1):= 1.1547005383792515*atan(0.5773502691896257*(1+2*exp(x)*y))=C_1+x; dsolve(exp(x_)+exp(-x_)*y_^2,y_,x_,q_):= if(q<=1, -1.1547005383792515*atan(1-q,0.5773502691896257*(1-2*exp(-x)*y))=C_1+x^q); dsolve(exp(x_)+y_^2,y_,x_,1):= (C_1* sqrt(exp(x))*besselJ(1,2 sqrt(exp(x))) + 2 sqrt(exp(x))* besselY(1,2 sqrt(exp(x))))/(C_1*besselJ(0,2 sqrt(exp(x))) + 2besselY(0,2 sqrt(exp(x)))); dsolve(a_+exp(y_),y_,x_,1):= int(a,x)-log(C_1-int(exp(int(a,x)),x)); dsolve(exp(y_)+z_,y_,x_,1):= if(hasnot(z,y),int(z,x)-log(C_1-int(exp(int(z,x)),x)) ); dsolve(exp(x_+y_)+z_, y_,x_,p_) := if(hasnot(z,y), int(z,x)-log(C_1-int(exp(int(z,x)+x),x)) ); dsolve(b_*exp(x_+y_)+z_, y_,x_,p_) := if(hasnot(z,b,y), int(z,x)-log(C_1-b*int(exp(int(z,x)+x),x)) ); dsolve(b_*exp(y_)+g_,y_,x_,1):=if(isconstant(b), int(g,x)-log(C_1-b*int(exp(int(g,x)),x)), -log(dsolve(-b-g*y,y,x,1)) ); dsolve(exp(y_)*f1_+f2_,y_,x_,1):=if(isconstant(f1) and hasnot(f2,y),int(f2,x)-log(C_1-f1*int(exp(int(f2,x)),x)), -log(dsolve(-f1-f2*y,y,x,1)) ); dsolve(a_+exp(y_)*f1_,y_,x_,1):=if(isconstant(f1),int(a,x)-log(C_1-f1*int(exp(int(a,x)),x)), -log(dsolve(-f1-a*y,y,x,1)) ); dsolve(a_+b_*exp(y_),y_,x_,1):=if(isconstant(b),int(a,x)-log(C_1-b*int(exp(int(a,x)),x)), -log(dsolve(-b-a*y,y,x,1)) ); dsolve(a_+b_*exp(y_)*f_,y_,x_,1):=-log(dsolve(-b*f-a*y,y,x,1)); dsolve(b_*exp(y_)*f_+g_,y_,x_,1):=-log(dsolve(-b*f-g*y,y,x,1)); dsolve(b_*exp(x_*y_)/x_-y_/x_,y_,x_,1):= -log(C_1-b*x)/x; dsolve(a_+exp(y_/x_),y_,x_,1):=if(isconstant(a),int(1/(exp(z)-z+a),z,1,y/x)=C_1+log(x) ); dsolve(a_+exp(x_/y_),y_,x_,1):=if(isconstant(a),int(1/(exp(1/z)-z+a),z,1,y/x)=C_1+log(x) ); dsolve(a_+b_*exp(y_/x_),y_,x_,1):=if(isconstant(a,b),int(1/(b*exp(z)-z+a),z,1,y/x)=C_1+log(x) and (-a-W(-b*exp(-a)))*x ); dsolve(a_+b_*exp(x_/y_),y_,x_,1):=if(isconstant(a,b),int(1/(b*exp(1/z)-z+a),z,1,y/x)=C_1+log(x) ); dsolve(log(y_)-log(x_),y_,x_,1):= -W(-1)*x; dsolve(-log(y_)+log(x_),y_,x_,1):= W(1)*x; dsolve(a_*log(y_)+b_*log(x_),y_,x_,1):= if(a+b==0, b*W(1/b)*x ); #dsolve(c_+y(1,x_),y_,x_,2):=if(isfree(c,y),if(isfree(c,x), C_1+C_2*e^x-c*x, C_1+C_2*exp(x)-integrate(exp(x)*int(exp(-x)*c,x),x) )); #dsolve(c_+b_*y(1,x_),y_,x_,2):=if(isfree(b,c,y),if(isfree(b,c,x), C_1+C_2*exp(b*x)-c*x/b, integrate(dsolve(c+b*y,y,x),x)+C_2 )); #dsolve(c_+b_*y(1,x_),y_,x_,2):=if(isfree(b,c,y),if(isfree(b,c,x), C_1+C_2*exp(b*x)-c*x/b, C_1+C_2*exp(b*x)-integrate(exp(b*x)*int(exp(-b*x)*c,x),x) )); #dsolve(c_+b_*y(1,x_),y_,x_,2):=if(isfree(b,c,y),if(isfree(b,c,x), C_1+C_2*exp(b*x)-c*x/b, C_1+C_2*int(exp(int(b,x)),x)+psolution(b,1,0,c,y,x,2) )); #dsolve(b_/x_*y(1,x_)+y(1,x_),y_,x_,2):= if(isconstant(b), C_1*Gamma(1+b,-x)+C_2); #dsolve(a_*y(1,x_)+b_/x_*y(1,x_),y_,x_,2):= if(isconstant(a,b), C_1*(-a)^(-1-b)*Gamma(1+b,-a*x)+C_2); #dsolve(y_*y(1,x_)+x_, y_,x_,p_):= (-1)^(p+1)*(2*(p-1))!/(p-1)!/(C_1+x)^(p-1)-i*x and (-1)^(p+1)*(2*(p-1))!/(p-1)!/(C_1+x)^(p-1)+i*x; #dsolve(y_*y(1,x_)+c_*x_, y_,x_,p_):= if(c<0,-sqrt(-c)*x and sqrt(-c)*x, 2C_1*tan(C_1*x+C_2)-sqrt(-c)*x and -2C_2/(C_1+C_2*x) +sqrt(-c)*x ); #dsolve(y_*y(1,x_)+c_*x_, y_,x_,p_):= if(c<0,-sqrt(-c)*x and sqrt(-c)*x-2/x, -2C_2/(C_1+C_2*x)-sqrt(-c)*x and -2C_2/(C_1+C_2*x) +sqrt(-c)*x ); #dsolve(b_*y_*y(1,x_)+x_, y_,x_,p_):= if(b<0,-sqrt(-1/b)*x and sqrt(-1/b)*x-2/b/x, -2/b*C_2/(C_1+C_2*x)-sqrt(-1/b)*x and -2/b*C_2/(C_1+C_2*x) +sqrt(-1/b)*x ); #dsolve(b_*y_*y(1,x_)+c_*x_, y_,x_,p_):= if(isconstant(b,c),if(sgn(b)==sgn(c), (-1)^(p-1)*(2*(p-1))!/(p-1)!*(C_2/(C_1+C_2*x))^(p-1)/(b)-sqrt(-c/b)*x and (-1)^(p-1)*(2*(p-1))!/(p-1)!*(C_2/(C_1+C_2*x))^(p-1)/(b)+sqrt(-c/b)*x, -sqrt(-c/b)*x and sqrt(-c/b)*x-(-1)^p*(2*(p-1))!/(p-1)!/b/x^(p-1) )); dsolve(y(p_,x_)^n_+c_,y_,x_,q_):= if(hasnot(c,y),int(dsolve(y^n+c,y,x,q-p),x,p)+gsolution(0,y,x,p) ); dsolve(b_*y(p_,x_)^n_+c_,y_,x_,q_):= if(isfree(b,c,y),if(isfree(b,x),int(dsolve(b*y^n+c,y,x,q-p),x,p)+gsolution(0,y,x,p) )); dsolve(y(p_,x_)+c_,y_,x_,q_):= if(hasnot(c,y), int(dsolve(y+c,y,x,q-p),x,p)+gsolution(0,y,x,p)); dsolve(b_*y(p_,x_)+c_,y_,x_,q_):= if(isconstant(b) and hasnot(c,y), int(dsolve(b*y+c,y,x,q-p),x,p)+gsolution(0,y,x,p) ); dsolve(b_*y(1,x_)+c_,y_,x_,q_):=if(isfree(b,c,y),if(isfree(b,c,x), C_1+C_2*exp(b*x)-c*x/b, gsolution(b,1,0,y,x,q)+psolution(b,1,0,c,y,x,q)), if(hasnot(b,x) and hasnot(c,y), dsolve(int(b,y)+int(c,x),y,x,q-1) )); dsolve(a_*y(n_,x_)*y(p_,x_)+c_,y_,x_,q_) := if(hasnot(a,c,y), block(f2:=int(dsolve(a*y*y(p-n,x)+c,y,x,q-n),x,n),if(hasnot(f2,y) and hasnot(f2,C_1), gsolution(0,y,x,n)+f2) )); dsolve(y(1,x_)+c_,y_,x_,q_):=if(isfree(c,y),if(isfree(c,x), C_1+C_2*exp(x)-c*x, C_1+C_2*exp(x)+psolution(1,1,0,c,y,x,q) )); dsolve(1/x_*y(p_,x_)+c_,y_,x_,q_):= if(hasnot(c,y) and q-p==1, int(int(c/x,x)*x,x,p)+C_1*x^q+C_2 ); dsolve(y(n_,x_)*y(p_,x_)+c_,y_,x_,q_) := if(hasnot(c,y), block(f2:=int(dsolve(y*y(p-n,x)+c,y,x,q-n),x,n),if(hasnot(f2,y) and hasnot(f2,C_1), gsolution(0,y,x,n)+f2) )); dsolve(b_*y_*y(1,x_)+c_, y_,x_,2):= if(hasnot(c,y), dsolve(b/2*y^2+int(c,x)+C_2,y,x,1) ); #dsolve(y_*y(1,x_)+c_, y_,x_,2):= if(hasnot(c,y), dsolve(1/2y^2+int(c,x)+C_2,y,x,1) ); dsolve(y_*y(1,x_)+c_, y_,x_,2):= if(hasnot(c,y), block(u:=gsolution(-int(c,x)/2+C_2,y,x,2), -2d(u,x)/u) ); dsolve(-y(1,x_)^2+c_*exp(-y_)*f1_, y_,x_,2):= log(int(c*f1,x,2)); dsolve(-y(1,x_)^2+c_*exp(-y_), y_,x_,2):= log(int(c,x,2)); dsolve(-y(1,x_)^2+c_*exp(a_-y_), y_,x_,2):= log(int(c*exp(a),x,2)); dsolve(-y(1,x_)^2*1/y_+c_/y_, y_,x_,2):= sqrt(2int(c,x,2)+C_1*x+C_2) and -sqrt(2int(c,x,2)+C_1*x+C_2); dsolve(y(1,x_)^2+c_*exp(y_)*f1_, y_,x_,2):= -log(-int(c*f1,x,2)); dsolve(y(1,x_)^2+c_*exp(y_), y_,x_,2):= -log(-int(c,x,2)); dsolve(y(1,x_)^2+c_*exp(a_+y_), y_,x_,2):= -log(-lint(c*exp(a),x,2)); dsolve(y(1,x_)^2+y_,y_,x_,2):= sqrt(2)*int(1/(C_1*exp(2y)-2y-1),y)=C_2+x and -sqrt(2)*int(1/(C_1*exp(2y)-2y-1),y)=C_2+x; dsolve(y(1,x_)^2*1/y_+c_/y_, y_,x_,2):= if(c>0, sqrt(c)*cosh(C_2+C_1*x)/C_1 and -sqrt(c)*cosh(C_2+C_1*x)/C_1, if(c<0, sqrt(-c)*sinh(C_2+C_1*x)/C_1 and sqrt(-c)*sin(C_2+C_1*x)/C_1 and sqrt(-c)*cos(C_2+C_1*x)/C_1 )); dsolve(y(1,x_)^2*1/y_+exp(x_)/y_, y_,x_,2):= exp(x/2)*cosh(C_1*x+C_2)/C_1 and -exp(x/2)*cosh(C_1*x+C_2)/C_1; dsolve(y(1,x_)^2*1/y_+exp(a_*x_)/y_, y_,x_,2):= if(hasnot(a,x),-exp(a*x/2)*cosh(C_1*x+C_2)/C_1 and exp(a*x/2)*cosh(C_1*x+C_2)/C_1); dsolve(0.5y(1,x_)^2*1/y_+c_/y_, y_,x_,2):= dsolve(d(c,x)/y,y,x,3); dsolve(y(1,x_)^2*1/y_+1/y_, y_,x_,2):= cosh(C_2+C_1*x)/C_1 and -cosh(C_2+C_1*x)/C_1; dsolve(g_*y(p_,x_)+c_*g_, y_,x_,q_):= if(isinteger(p) and d(c,x,q-p)==0,C_1-int(c,x,p) ); dsolve(a_*g_*y(p_,x_)+c_*g_, y_,x_,q_):= if(isconstant(a) and isinteger(p) and d(c,x,q-p)==0,C_1-int(c/a,x,p) ); #dsolve(b_*x_*y(p_,x_)+a_*x_, y_,x_,q_) := If(isfree(a,b,x) and isfree(a,b,y), C_1*int(mittag(q-p,b*x^(1+q-p)/(1+q-p)!)-a/b,x,p)); dsolve(b_*y_*y(1,x_)+x_, y_,x_,p_):= if(isconstant(b), if(p==2,sqrt(-1/b)*x and sqrt(-1/b)*x-2/b/x, -sqrt(-1/b)*x and sqrt(-1/b)*x )); dsolve(b_*y_*y(1,x_)+c_*x_, y_,x_,p_):= if(isconstant(b,c), if(p==2,sqrt(-c/b)*x and sqrt(-c/b)*x-2/b/x, -sqrt(-c/b)*x and sqrt(-c/b)*x )); dsolve(y(p_,x_)+y_, y_,x_,q_) := gsolution(1,p,1,y,x,q); dsolve(y(p_,x_)+c_*y_, y_,x_,q_) := if(p<0,gsolution(c,-p,b,y,x,q-p), gsolution(1,p,c,y,x,q) ); dsolve(b_*y(p_,x_)+y_, y_,x_,q_) := if(p<0,gsolution(1,-p,b,y,x,q-p), if(hasnot(b,y),gsolution(b,p,1,y,x,q) )); dsolve(b_*y(p_,x_)+c_*y_, y_,x_,q_) := if(p<0,gsolution(c,-p,b,y,x,q-p), if(hasnot(b,y),gsolution(b,p,c,y,x,q) )); dsolve(y(m_,x_)+y(n_,x_),y_,x_,p_):= gsolution(1,n,1,m,0,y,x,p); dsolve(y(m_,x_)+c_*y(n_,x_),y_,x_,p_):= if(hasnot(c,y),gsolution(c,n,1,m,0,y,x,p) ); dsolve(b_*y(m_,x_)+y(n_,x_),y_,x_,p_):= if(hasnot(b,y),gsolution(1,n,b,m,0,y,x,p) ); dsolve(b_*y(m_,x_)+c_*y(n_,x_),y_,x_,p_):= if(hasnot(b,c,y),gsolution(c,n,b,m,0,y,x,p) ); #dsolve(y_*y(m_,x_)+c_, y_,x_,p_):= block(f1:=d(c,x,m),if(f1<>0 and isconstant(f1), c/sqrt(-f1) and -c/sqrt(-f1) ) ); dsolve(y_*y(1,x_)+c_*x_, y_,x_,p_):= if(isconstant(c), if(p==2,sqrt(-c)*x and sqrt(-c)*x-2/x, sqrt(-c)*x and -sqrt(-c)*x )); dsolve(y_*y(1,x_)+x_, y_,x_,p_):= if(p==2, i*x and i*x-2/x, i*x and -i*x); dsolve(y_*y(p_,x_)-y(m_,x_)^2,y_,x_,q_):=exp(x)+1; dsolve(y_*y(m_,x_)-y(p_,x_)^2,y_,x_,q_):=exp(x)+1; dsolve(y_*y(m_,x_)-y(n_,x_)*y(p_,x_),y_,x_,q_):=exp(x)+1; dsolve(y_*y(1,x_)+x_, y_,x_,2):=i*x and -i*x and i*x-2/x; dsolve(b_*y(1,x_)+y_,y_,x_,2):= if(hasnot(b,y),gsolution(b,1,1,y,x,2) ); dsolve(b_*y(1,x_)+c_*y_,y_,x_,2):= if(hasnot(b,y),gsolution(b,1,c,y,x,2) ); dsolve(y(1,x_)*y_+y_,y_,x_,2):= -int(1/(W(C_1*exp(-y^2/2))+1),y)=C_2+x; dsolve(y(1,x_)+y_,y_,x_,2):= C_1*exp((1-sqrt(5))/2*x)+C_2*exp((1+sqrt(5))/2*x); #3+; dsolve(x_+xx_+z_,y_,x_,p_):=if(has(xx,y) and hasnot(z,y), block(f:=solve(xx+x,y),if(d(f,x,p)==z,f)), if(has(z,y) and hasnot(xx,y), block(f:=solve(z+x,y),if(d(f,x,p)==xx,f)) )); dsolve(c_*x_+xx_+z_,y_,x_,p_):=if(has(xx,y) and hasnot(z,y), block(f:=solve(xx+c*x,y),if(d(f,x,p)==z,f)), if(has(z,y) and hasnot(xx,y), block(f:=solve(z+c*x,y),if(d(f,x,p)==xx,f)) )); dsolve(a_+x_+z_,y_,x_,p_):=if(has(a,y) and hasnot(z,y), block(f:=solve(a+x,y),if(d(f,x,p)==z,f)), if(has(z,y) and hasnot(a,y), block(f:=solve(z+x,y),if(d(f,x,p)==a,f)) )); dsolve(a_+b_+x_,y_,x_,p_):=if(has(a,y) and hasnot(b,y), block(f:=solve(a+x,y),if(d(f,x,p)==b,f)), if(has(b,y) and hasnot(a,y), block(f:=solve(b+x,y),if(d(f,x,p)==a,f)) )); dsolve(a_+b_+c_*x_,y_,x_,p_):=if(has(a,y) and hasnot(b,y), block(f:=solve(a+c*x,y),if(d(f,x,p)==b,f)), if(has(b,y) and hasnot(a,y) and isconstant(c), block(f:=solve(b+c*x,y),if(d(f,x,p)==a,f)) )); dsolve(a_+c_*x_+z_,y_,x_,p_):=if(has(a,y) and hasnot(z,y), block(f:=solve(a+c*x,y),if(d(f,x,p)==z,f)), if(has(z,y) and hasnot(a,y) and isconstant(c), block(f:=solve(z+c*x,y),if(d(f,x,p)==a,f)) )); dsolve(b_+a_*x_+c_*y_^n_,y_,x_,p_):= if(isconstant(a,b,c),replace(dsolve(a*x+c*y^n,y,x,p),x,x+b/a) ); dsolve(b_+a_*x_+y_^n_,y_,x_,p_):= if(isconstant(a,b),replace(dsolve(a*x+y^n,y,x,p),x,x+b/a) ); dsolve(b_+x_+y_^n_,y_,x_,p_):= if(isconstant(b),replace(dsolve(x+y^n,y,x,p),x,x+b) ); dsolve(b_+x_^p_+y_^2,y_,x_,p_):= if(isconstant(b), AiPrime(p,-b-x^p)/Ai(p,-b-x^p) ); dsolve(b_+a_*x_^p_+y_^2,y_,x_,p_):= if(isconstant(a,b), cbrt(a)*AiPrime(p,-b-cbrt(a)*x^p)/Ai(p,-b-cbrt(a)*x^p) ); dsolve(a_+b_*y_+y_^2, y_,x_,p_) := if(b*b==4a, dsolve((y+b/2)^2,y,x,p) ); dsolve(a_+y_+c_*y_^2, y_,x_,p_) := if(4a*c-1==0, dsolve(c*(y+1/2/c)^2,y,x,p) ); dsolve(a_+b_*y_+c_*y_^2, y_,x_,p_) := if(b*b==4a*c, dsolve(c*(y+b/2/c)^2,y,x,p), if(p==1 and hasnot(a,y), block(u:=gsolution(b+d(c,x)/c,-a*c,y,x,2), -d(u,x)/u/c) )); dsolve(a_+x_-y_^0.5, y_,x_,2) :=if(isconstant(a),(x+2+a)^2 ); dsolve(a_-x_+y_^0.5, y_,x_,2) :=if(isconstant(a),(x+2-a)^2 ); dsolve(a_+b_*x_+c_*y_^0.5, y_,x_,2) :=if(isconstant(a,b,c) and b+c==0,(x+(2-a)/c)^2 ); dsolve(a_+y_+y_^2, y_,x_,2) := weierstrassP(x+C_1,1/2-2a,C_2)-1/2; dsolve(a_+b_*y_+y_^2, y_,x_,2) := if(b*b-4a==0, 6/(C_1+x)^2-b/2 and 6/(C_1-x)^2-b/2, if(d(b,x,2)==0, weierstrassP(x+C_1,b^2/2-2a,C_2)-b/2 )); dsolve(a_+y_+c_*y_^2, y_,x_,2) := if(4a*c-1==0, 6/c/(C_1+x)^2-1/c/2 and 6/c/(C_1-x)^2-1/c/2, if(isconstant(c), weierstrassP(x+C_1,1/2-2a*c,C_2)/c-1/c/2 )); dsolve(a_+b_*y_+c_*y_^2, y_,x_,2) := if(b*b-4a*c==0, 6/c/(C_1+x)^2-b/c/2 and 6/c/(C_1-x)^2-b/c/2, if(isconstant(c) and d(b,x,2)==0, weierstrassP(x+C_1,b^2/2-2a*c,C_2)/c-b/c/2 )); dsolve(c_+y_^2-x_^2, y_,x_,1) := if(isconstant(c), exp(c*x^2)/(C_1 - 1/2 sqrt(pi)*erfi(sqrt(c)*x)/sqrt(c)) + c*x ); dsolve(c_+b_*x_+a_*y_^2, y_,x_,1) := if(isconstant(a,b,c), (cbrt(a*b)/a*BiPrime((-a*c-a*b*x)/(a*b)^(2/3))*C_1+AiPrime((-a*c-a*b*x)/(a*b)^(2/3))*cbrt(a*b)/a)/(Ai((-a*c-a*b*x)/(a*b)^(2/3)) + C_1*Bi((-a*c-a*b*x)/(a*b)^(2/3))) ); dsolve(c_+b_*x_+y_^2, y_,x_,1) := if(isconstant(b,c), cbrt(b)*AiPrime((-b*x - c)/abs(b)^(2/3))/Ai((-b *x - c)/abs(b)^(2/3)) and cbrt(b) *BiPrime((-b *x - c)/abs(b)^(2/3))/Bi((-b *x - c)/abs(b)^(2/3)) ); dsolve(c_+x_+y_^2, y_,x_,1) := if(isconstant(c), (AiPrime(-x-c)+C_1*BiPrime(-x-c))/(Ai(-x-c)+C_1*Bi(-x-c)) ); dsolve(a_*x_+b_*x_^(-0.5)+y_^2,y_,x_,1):=if(a+4b^2==0,sqrt(-a*x)); dsolve(a_*x_+x_^(-0.5)+c_*y_^2,y_,x_,1):=if(a/c+4==0,sqrt(-a/c*x)); dsolve(a_*x_+b_*x_^(-0.5)+c_*y_^2,y_,x_,1):=if(a/c+4b^2==0,sqrt(-a/c*x)); dsolve(a_+y_+c_*y_^2, y_,x_,1) := if(has(a,x),block(u:=gsolution(1+d(c,x)/c,-a*c,y,x,2), -d(u,x)/u/c) ); #dsolve(a_+b_*y_+y_^2, y_,x_,1) := if(isconstant(a,b), if(b*b==4a, 1/(C_1-x)-b/2, block(u:=gsolution(b,-a,y,x,2), -d(u,x)/u) )); dsolve(a_+b_*y_+y_^2, y_,x_,1) := if(has(a,x) or has(b,x),if(b*b==4a, sqrt(b/2/x)*tan(C_1+sqrt(b/2/x)*x)-b/2, block(u:=gsolution(b,-a,y,x,2), -d(u,x)/u) )); dsolve(a_+b_*y_+c_*y_^2, y_,x_,1) := if(has(a,x) or has(b,x),if(b*b==4a*c, sqrt(b/(2c*x))*tan(C_1+sqrt(b/(2c*x))*x)-b/2*sqrt(1/c), block(u:=gsolution(b+d(c,x)/c,-a*c,y,x,2), -d(u,x)/u/c) )); dsolve(b_*x_+y_+y_^2, y_,x_,1) := if(isconstant(b), AiPrime((-b*x+1/4)/abs(b)^(2/3))/Ai((-b*x+1/4)/abs(b)^(2/3))*cbrt(b)-1/2 and BiPrime((-b*x+1/4)/abs(b)^(2/3))/Bi((-b*x+1/4)/abs(b)^(2/3))*cbrt(b)-1/2 ); dsolve(x_+y_+y_^2, y_,x_,1) := AiPrime(-x+1/4)/Ai(-x+1/4)-1/2 and BiPrime(-x+1/4)/Bi(-x+1/4)-1/2 ; dsolve(a_/x_+exp(x_*y_)*1/x_-1/x_*y_,y_,x_,1):= if(isconstant(a),-log((exp(C_1 - a*x)-1)/a)/x ); dsolve(a_*log(y_)+b_*log(x_)+c_,y_,x_,1):= if(a+b==0 and isconstant(c), b*W(exp(c/b)/b)*x ); dsolve(log(y_)-log(x_)+c_,y_,x_,1):= if(isconstant(c), -W(-exp(-c))*x ); dsolve(-log(y_)+log(x_)+c_,y_,x_,1):= if(isconstant(c), W(exp(c))*x ); dsolve(b_*log(x_)/x_+b_*log(y_)/x_-1/x_*y_,y_,x_,1):= if(isconstant(b),inverseli(C_1+b*x)/x ); dsolve(y_*log(x_)/x_+y_*log(y_)/x_-1/x_*y_,y_,x_,1):= exp(C_1*x)/x; dsolve(log(x_)/x_+log(y_)/x_-1/x_*y_,y_,x_,1):= inverseli(C_1+x)/x; dsolve(y(p_,x_)+y_+d_, y_,x_,q_) := if(isfree(d,y),if(isfree(d,x), gsolution(1,p,1,y,x,q)-d, gsolution(1,p,1,y,x,q)+psolution(1,p,1,d,y,x,q) )); dsolve(y(p_,x_)+c_*y_+d_, y_,x_,q_) := if(isfree(c,d,y),if(isfree(c,d,x), gsolution(1,p,c,y,x,q)-d/c, gsolution(1,p,c,y,x,q)+psolution(1,p,c,d,y,x,q) )); dsolve(b_*y(p_,x_)+y_+d_, y_,x_,q_) := if(isfree(b,d,y),if(isfree(b,d,x), gsolution(b,p,1,y,x,q)-d, gsolution(b,p,1,y,x,q)+psolution(b,p,1,d,y,x,q) )); dsolve(b_*y(p_,x_)+c_*y_+d_, y_,x_,q_) := if(isfree(b,c,d,y),if(isfree(b,c,d,x), gsolution(b,p,c,y,x,q)-d/c, gsolution(b,p,c,y,x,q)+psolution(b,p,c,d,y,x,q) )); #dsolve(a_*y(p_,x_)+b_*y_+c_*y_,y_,x_,q_):= gsolution(a,p,b+c,y,x,q); #dsolve(y(p_,x_)+b_*y_+c_*y_,y_,x_,q_):= gsolution(1,p,b+c,y,x,q); dsolve(b_*y(1,x_)+y_+d_,y_,x_,2):= if(hasnot(d,y), gsolution(b,1,1,y,x,2) +psolution(b,1,1,d,y,x,2)); dsolve(b_*y(1,x_)+c_*y_+d_,y_,x_,2):= if(hasnot(d,y), gsolution(b,1,c,y,x,2)+psolution(b,1,c,d,y,x,2)); dsolve(y(1,x_)+y_+d_,y_,x_,2):= gsolution(1,1,1,y,x,2)+psolution(1,1,1,d,y,x,2); dsolve(y(1,x_)+c_*y_+d_,y_,x_,2):= gsolution(1,1,c,y,x,2)+psolution(1,1,c,d,y,x,2); dsolve(a_+y(m_,x_)+y(n_,x_),y_,x_,p_):=if(isconstant(a), -a*x^m/m!,psolution(1,n,1,m,0,a,y,x,p))+gsolution(1,n,1,m,0,y,x,p); dsolve(a_+y(m_,x_)+c_*y(n_,x_),y_,x_,p_):=if(isconstant(a,c), -a*x^m/m!,psolution(1,n,c,m,0,a,y,x,p))+gsolution(1,n,c,m,0,y,x,p); dsolve(a_+b_*y(m_,x_)+y(n_,x_),y_,x_,p_):=if(isconstant(a,b), -a/b*x^m/m!,psolution(b,n,1,m,0,a,y,x,p))+gsolution(b,n,1,m,0,y,x,p); dsolve(a_+b_*y(m_,x_)+c_*y(n_,x_),y_,x_,p_):=if(isconstant(a,b,c), -a/b*x^m/m!,psolution(b,n,c,m,0,a,y,x,p))+gsolution(b,n,c,m,0,y,x,p); dsolve(y(p_,x_)+y(m_,x_)+c_*y_, y_,x_,q_) := gsolution(1,p,1,m,c,y,x,q); dsolve(y(p_,x_)+b_*y(m_,x_)+y_, y_,x_,q_) := gsolution(1,p,b,m,1,y,x,q); dsolve(y(p_,x_)+b_*y(m_,x_)+c_*y_, y_,x_,q_) := gsolution(1,p,b,m,c,y,x,q); dsolve(a_*y(p_,x_)+y(m_,x_)+c_*y_, y_,x_,q_) := gsolution(a,p,1,m,c,y,x,q); dsolve(a_*y(p_,x_)+b_*y(m_,x_)+y_, y_,x_,q_) := gsolution(a,p,b,m,1,y,x,q); dsolve(a_*y(p_,x_)+b_*y(m_,x_)+c_*y_, y_,x_,q_) := gsolution(a,p,b,m,c,y,x,q); #4+; dsolve(f1_+a_*y_+b_*y(n_,x_)+c_*y(m_,x_),y_,x_,p_):=if(hasnot(b,c,f1,y), gsolution(b,n,c,m,a,y,x,p)+psolution(b,n,c,m,a,f1,y,x,p) ); dsolve(f1_+y_+b_*y(n_,x_)+c_*y(m_,x_),y_,x_,p_):=if(hasnot(b,c,f1,y), gsolution(b,n,c,m,1,y,x,p)+psolution(b,n,c,m,1,f1,y,x,p) ); dsolve(c_+a_*x_^p_+b_*y_+y_^2,y_,x_,p_):= if(isconstant(a,b,c), cbrt(a)*AiPrime(p,b*b/4-c-cbrt(a)*x^p)/Ai(p,b*b/4-c-cbrt(a)*x^p)-b/2 ); dsolve(c_+x_+y_+y_^2, y_,x_,1) := if(isconstant(c), AiPrime(-x+1/4-c)/Ai(-x+1/4-c)-1/2 and BiPrime(-x+1/4-c)/Bi(-x+1/4-c)-1/2 ); dsolve(c_+b_*x_+y_+y_^2, y_,x_,1) := if(isconstant(b,c), AiPrime((-b*x+1/4-c)/abs(b)^(2/3))/Ai((-b*x+1/4-c)/abs(b)^(2/3))*cbrt(b)-1/2 and BiPrime((-b*x+1/4-c)/abs(b)^(2/3))/Bi((-b*x+1/4-c)/abs(b)^(2/3))*cbrt(b)-1/2 ); #0; dsolve(a_=b_,u_):=dsolve(replace(toy(a-b),u,y),y); dsolve(a_=b_,y(x_)):=dsolve(replace(toy(a-b),y(x),y),y); #dsolve(b_=a_*y(n_,x_),y_):=dsolve(b/a,y,x,n); dsolve(x(n_,t_)=a_,x_):= dsolve(tox(a),x,t,n); dsolve(x(n_,t_)+a_,x_):= dsolve(-tox(a),x,t,n); #dsolve(a_*y(n_,x_)=b_,y_):=dsolve(b/a,y,x,n); dsolve(y(n_,x_)^m_=b_,y_):= dsolve(b^(1/m),y,x,n); dsolve(y(n_,x_)=b_,y_):= dsolve(b,y,x,n); #dsolve(b_+x(n_,t_),d_+y(n_,t_)):= (x=pdsolve(-b,x,t,n), y=pdsolve(-d,y,t,n)); #dsolve(b_+x(n_,t_),d_+x_+y(n_,t_)):= block(f:=pdsolve(-b,x,t,n), x=f, y=pdsolve(-d-f,y,t,n)); #dsolve(b_+x(n_,t_),d_+y(m_,t_)):= if(hasnot(b,y(t)) and hasnot(d,x(t)), (x=pdsolve(-b,x(t),t,n), y=pdsolve(-d,y(t),t,m)), if(hasnot(b,y(t)),block(f:=pdsolve(-b,x(t),t,n), (x=f, y=pdsolve(-replace(d,x(t),f),y(t),t,m))), if(hasnot(d,x(t)),block(f:=pdsolve(-d,y(t),t,m), (y=f, x=pdsolve(-replace(b,y(t),f),x(t),t,n))) ))); dsolve(a_=b_,c_=d_):= dsolve(tox(a=b),toyt(c=d),x,y); dsolve(ds(x_,t_)=f1_,ds(y_,t_)=g_):= dsolve(x(1,t)=f1,y(1,t)=g,x,y); dsolve(dx/dt=f1_,dy/dt=g_):= dsolve(x(1,t)=f1,y(1,t)=g,x,y); dsolve(x(m_,t_)=a_,y(n_,t_)=c_,x_,y_):= if(hasnot(a,y), block(f:=solve(dsolve(a,x,t,m),x), (x=f, y=dsolve(replace(c,x,f),y,t,n))), if(hasnot(c,x), block(yy:=solve(dsolve(c,y,t,n),y), (x=dsolve(replace(a,y,yy),x,t,m),y=yy)), if(hasnot(a,c,t) and m==n, dsolve(c/a,y,x,n), if(hasnot(c,t), y=dsolve(c,y,x,n), if(hasnot(a,t), swap(y=dsolve(swap(a,x,y),y,x,m),x,y) ))))); dsolve(x(m_,t_)=c1_,y(n_,t_)=c2_+x_,x_,y_):= block(yy:=dsolve(d(c2,t,m)+replace(c1,x,y(n,t)-c2),y,t,m+n), (x=d(yy,t,n)-c2, y=yy) ); dsolve(x(m_,t_)=c1_,y(n_,t_)=c2_+x_+y_,x_,y_):= block(yy:=dsolve(y(m,t)+d(c2,t,m)+replace(c1,x,y(n,t)-y-c2),y,t,m+n), (x=d(yy,t,n)-c2-yy, y=yy) ); dsolve(x(m_,t_)=c1_,y(n_,t_)=c2_+x_+b_*y_,x_,y_):= block(yy:=dsolve(b*y(m,t)+d(c2,t,m)+replace(c1,x,y(n,t)-b*y-c2),y,t,m+n), (x=d(yy,t,n)-c2-b*yy, y=yy) ); #dsolve(x(m_,t_)=c1_,y(n_,t_)=x_+b_*y_,x_,y_):= block(yy:=dsolve(b*y(m,t)+replace(c1,x,y(n,t)-b*y),y,t,m+n), (x=d(yy,t,n)-b*yy, y=yy) ); dsolve(x(m_,t_)=c1_+y_,y(n_,t_)=a_+y_,x_,y_):= block(f:=dsolve(y(m,t)+toyt(d(replace(c1,x,y(t)),t,n))+replace(a-c1,x,y),y,t,m+n), (x=f,y=expand(d(f,t,m)-replace(c1,x,f))) ); dsolve(x(m_,t_)=c1_+y_,y(n_,t_)=a_+b_*y_,x_,y_):= block(f:=dsolve(b*y(m,t)+toyt(d(replace(c1,x,y(t)),t,n))+replace(a-b*c1,x,y),y,t,m+n), (x=f,y=expand(d(f,t,m)-replace(c1,x,f))) ); dsolve(x(m_,t_)=c1_+f1_*y_,y(n_,t_)=a_+y_,x_,y_):= block(f:=dsolve(y(m,t)+toyt(d(replace(c1,x,y(t)),t,n))+replace(f1*a-c1,x,y),y,t,m+n), (x=f,y=expand(d(f,t,m)/f1-replace(c1,x,f)/f1)) ); #dsolve(x(m_,t_)=c1_+f1_*y_,y(n_,t_)=a_+b_*y_,x_,y_):= block(f:=dsolve(b*y(m,t)+toyt(d(replace(c1,x,y(t)),t,n))+replace(f1*a-b*c1,x,y),y,t,m+n), (x=f,y=expand(d(f,t,m)/f1-replace(c1,x,f)/f1)) ); dsolve(x(m_,t_)=a_*x_+b_*y_,y(m_,t_)=c_*x_+d_*y_,x_,y_):= if(isconstant(a,b,c,d) and (a-d)^2==4*b*c,(x=C_1*mittag(m,(a+d)/2*t^m), y=C_1*mittag(m,(a+d)/2*t^m)), dsolve((c*x+d*y)/(a*x+b*y),y,x,m) ); dsolve(x(m_,t_)=a_*x_+y_,y(m_,t_)=x_+a_*y_,x_,y_):= if(isconstant(a),(x=C_1*mittag(m,(a+1)*t^m), y=C_1*mittag(m,(a+1)*t^m)) ); dsolve(x(m_,t_)=x_+b_*y_,y(m_,t_)=b_*x_+y_,x_,y_):= if(isconstant(b),(x=C_1*mittag(m,(1+b)*t^m), y=C_1*mittag(m,(1+b)*t^m)) ); dsolve(x(m_,t_)=a_*x_+b_*y_,y(m_,t_)=b_*x_+a_*y_,x_,y_):= if(isconstant(a,b),(x=C_1*mittag(m,(a+b)*t^m), y=C_1*mittag(m,(a+b)*t^m)) ); dsolve(x(m_,t_)=a_*x_+a_*y_,y(m_,t_)=b_*x_+b_*y_,x_,y_):= if(isconstant(a,b),(x=C_1*(a*mittag(m,(a+b)*t^m)+b), y=b*C_1*(mittag(m,(a+b)*t^m)-1)) ); #dsolve(integrate(f1_,t_,a_,b_)=z_,y_) := dsolve((replace(f1,t,b)-replace(f1,t,a)-d(z,x))); dsolve(c_+integrate(f1_,t_,a_,b_),y_) := if(hasnot(c,y(x)),solve(replace(f1,t,b)-replace(f1,t,a)+d(c,x),y(x)), dsolve(replace(f1,t,b)-replace(f1,t,a)+d(c,x))); dsolve(integrate(f1_,t_,a_,b_)+z_,y_) := if(hasnot(z,y(x)),solve(replace(f1,t,b)-replace(f1,t,a)+d(z,x),y(x)), dsolve(replace(f1,t,b)-replace(f1,t,a)+d(z,x))); dsolve(c_+integrates(f1_,t_,a_,b_),y_) := if(hasnot(c,y(x)),solve(replace(f1,t,b)-replace(f1,t,a)+d(c,x),y), dsolve(replace(f1,t,b)-replace(f1,t,a)+d(c,x))); dsolve(integrates(f1_,t_,a_,b_)+z_,y_) := if(hasnot(z,y(x)),solve(replace(f1,t,b)-replace(f1,t,a)+d(z,x),y), dsolve(replace(f1,t,b)-replace(f1,t,a)+d(z,x))); dsolve(c_+integrates(f1_,t_,a_,b_)+z_,y_) := if(hasnot(c,z,y(x)),solve(replace(f1,t,b)-replace(f1,t,a)+d(c+z,x),y), dsolve(replace(f1,t,b)-replace(f1,t,a)+d(c+z,x))); dsolve(c_+integrate(f1_,t_,a_,b_)+z_,y_) := if(hasnot(c,z,y(x)),solve(replace(f1,t,b)-replace(f1,t,a)+d(c+z,x),y(x)), dsolve(replace(f1,t,b)-replace(f1,t,a)+d(c+z,x))); dsolve(y(p_,x_)^m_+b_,y_):= if(hasnot(b,y), block(f1:=int((-b)^(1/m),x,p)+gsolution(0,y,x,p), f1 and if(iseven(m), -f1)), dsolve((expand(-b))^(1/m),y,x,p) ); #dsolve(y(p_,x_)^n_+b_,y_):= dsolve(solve(replace(b,y(p,x),yy)+yy^n,yy),y,x,p); #dsolve(a_*y(p_,x_)^n_+b_,y_):= dsolve(solve(expand(replace(b,y(p,x),yy)/a)+yy^n,yy),y,x,p); dsolve(a_*y(p_,x_)^m_+b_,y_):= if(hasnot(a,b,y), block(f1:=int((-b/a)^(1/m),x,p)+gsolution(0,y,x,p), f1 and if(iseven(m), -f1)), dsolve(y(p_,x_)^m_+expand(b/a),y) ); dsolve(a_*y(q_,x_)^m_+b_*y(p_,x_),y_):=if(hasnot(b,y),int(dsolve((-b/a*y)^(1/m),y,x,q-p),x,p), dsolve((-b/a)^(1/m)*y(p,x)^(1/m),y,x,q) ); dsolve(a_*y(p_,x_)^m_+b_*y(p_,x_),y_):= if(hasnot(b,y), int((-b/a)^(1/(m-1)),x,p)+gsolution(0,y,x,p), dsolve((-b/a)^(1/(m-1)),y,x,p) ); dsolve(y(q_,x_)^m_+b_*y(p_,x_),y_):= if(hasnot(b,y), int(dsolve((-b*y)^(1/m),y,x,q-p),x,p)+gsolution(0,y,x,p), dsolve((-b)^(1/m)*y(p,x)^(1/m),y,x,q) ); dsolve(y(p_,x_)^m_+b_*y(p_,x_),y_):= if(hasnot(b,y), int((-b)^(1/(m-1)),x,p)+gsolution(0,y,x,p), dsolve((-b)^(1/(m-1)),y,x,p) ); dsolve(a_+y(q_,x_),y_):= dsolve(-a,y,x,q); dsolve(a_+b_*y(q_,x_),y_):= dsolve(-a/b,y,x,q); #dsolve(a_+b_*y(q_,x_),y_):= if(hasnot(a,y) and hasnot(b,x), d(b,y,-q)=gsolution(0,y,x,q)-d(a,x,-q), if(q<0, dsolve(y+expand(d(a/b,x,-q)),y), dsolve(-expand(a/b),y,x,q) )); dsolve(a_*y(p_,x_)+b_*y_^n_+c_, y_):= dsolve(-b/a*y^n-c/a,y,x,p); dsolve(a_*y(p_,x_)+b_*y_+c_, y_):= dsolve(-b/a*y-c/a,y,x,p); dsolve(a_*y(p_,x_)+b_*y_+c_*y_^n_, y_):= dsolve(-b/a*y-c/a*y^n,y,x,p); dsolve(a_+b_*y(1,x_),y_):= if(has(b,x) and has(a,y), if(d(a,y)==d(b,x), block(f1:=int(a,x),f2:=d(f1,y), f1+int(b-f2,y)=C_1), if(d(a*x,y)==d(b*x,x), block(f1:=int(a*x,x),f2:=d(f1,y), expand(f1+int(b*x-f2,y))=-C_1), if(d(a*y,y)==d(b*y,x), block(f1:=int(a*y,x),f2:=d(f1,y), expand(f1+int(b*y-f2,y))=-C_1), if(d(a*exp(x),y)==d(b*exp(x),x), block(f1:=int(a*exp(x),x),f2:=d(f1,y), expand(f1+int(b*exp(x)-f2,y))=-C_1), if(d(a*exp(y),y)==d(b*exp(y),x), block(f1:=int(a*exp(y),x),f2:=d(f1,y), expand(f1+int(b*exp(y)-f2,y))=-C_1), dsolve(-a/b,y,x,1) ))))), dsolve(-a/b,y,x,1) ); #dsolve(a_*y_+b_*y(1,x_),y_):= if(hasnot(a,b,y), C_1*exp(int(-a/b,x)),dsolve(-a*y/b,y,x,1) ); #3; dsolve(a_*y(q_,x_)^m_+b_*y(p_,x_)+c_,y_):= dsolve(y(p_,x_)^m_+b/a*y(p,x)+expand(c/a),y) ; dsolve(a_*y(1,x_)^2+b_*y(2,x_)+c_,y_):= if(d(b,y)==a, if(hasnot(c,y), solve(int(b,y)=C_1*x+C_2-int(c,x,2),y), if(hasnot(c,x), int(b/sqrt(-2int(c*b,y)),y)=x+C_1)), dsolve(-c/b-a/b*y(1,x)^2,y,x,2) ); #dsolve(y(p_,x_)^m_+y(p_,x_)+c_,y_):= C_1+int(solve(y^m+y+c,y),x,p); #dsolve(y(p_,x_)^m_+b_*y(p_,x_)+c_,y_):= C_1+dsolve(solve(yy^m+b*yy+c,yy),y,x,p); dsolve(y(q_,x_)^m_+b_*y(p_,x_)+c_,y_):= if(q-p>1, dsolve(b*y(p,x)+c,y) ); dsolve(y(p_,x_)^2+b_*y(p_,x_)+c_,y_):= if(hasnot(b,c,y) and hasnot(b,c,y(1,x)), C_1+int(-b/2+sqrt(b*b-4c)/2,x,p) and C_1-int(b/2+sqrt(b*b-4c)/2,x,p), dsolve((-b-(b*b-4c)^0.5)/2,y,x,p) and dsolve((-b+(b*b-4c)^0.5)/2,y,x,p)); dsolve(y(1,x_)^2+y_*y(2,x_)+c_, y_):= if(hasnot(c,y), sqrt(-2int(c,x,2)+C_1*x+C_2) and -sqrt(-2int(c,x,2)+C_1*x+C_2), if(hasnot(c,x), int(y/sqrt(-2int(c*y,y)),y)=x+C_1 )); dsolve(-y(1,x_)^2+y_*y(2,x_)+c_, y_):=if(c>0, sqrt(c)*sin(C_1*x+C_2)/C_1 and sqrt(c)*sinh(C_1*x+C_2)/C_1,if(c<0, sqrt(-c)*cosh(C_1*x+C_2)/C_1 )); dsolve(-y(1,x_)^2+y_*y(2,x_)+c_*y_, y_):=if(isconstant(c), c/2*sin(C_1*x+C_2)^2/C_1^2 and c/2*sinh(C_1*x+C_2)^2/C_1^2, if(hasnot(c,x), int(1/sqrt(-2int(c*y^(-2),y))/y,y)=x+C_1 )); dsolve(-y(1,x_)^2+y_*y(2,x_)+c_*y_^n_, y_):= if(hasnot(c,y) and n==2, C_1*exp(C_2*x-int(c,x,2)), if(hasnot(c,x), int(1/sqrt(-2int(c*y^(n-3),y))/y,y)=x+C_1 )); dsolve(y(p_,x_)^m_+b_*y(p_,x_)+c_*y_,y_):= if(d(b,x,p)==-c, C_1*x^p-p!^m/c*C_1^m); dsolve(y(1,x_)^2+b_*y(1,x_)+c_*y_,y_):= if(isconstant(b,c), -b^2/c/4 W(-exp(C_1-c/b*x))^2 - b^2/c/2 W(-exp(C_1-c/b*x)) ); dsolve(y(q_,x_)^m_+b_*x_*y(1,x_)+c_*y_,y_):= if(b+c==0,if(q==1,C_1^m/b+C_1*x,if(q>1,C_1*x ))); dsolve(a_*y(1,x_)^m_+x_*y(1,x_)-y_,y_):=if(isconstant(a), C_1*x+a*C_1^m ); dsolve(a_*y(1,x_)^m_-x_*y(1,x_)+y_,y_):=if(isconstant(a), C_1*x-a*C_1^m ); dsolve(y(1,x_)^m_-x_*y(1,x_)+y_,y_):= -C_1^m+C_1*x; dsolve(y(1,x_)^m_+x_*y(1,x_)-y_,y_):= C_1^m+C_1*x; dsolve(y(p_,x_)^2+b_*y_*y(p_,x_)+c_*y_^2,y_):= if(b*b==4c, C_1*mittag(p,-p!/2*int(b,x,p)), C_1*mittag(p,p!/2*int((-b+sqrt(b*b-4c)),x,p)) and C_2*mittag(p,-p!/2*int((b+(b*b-4c)^0.5),x,p)) ); dsolve(y(q_,x_)^2+b_*x_*y(1,x_)+y_,y_):= if(q==1 or q>2 and isconstant(b),-(2b+1)/4x^2); dsolve(y(1,x_)^2+b_*x_*y(1,x_)+c_*y_,y_):= if(isconstant(b,c),-(2b+c)/4x^2 and if(b+c==0, C_1^2/b+C_1*x)); dsolve(y(q_,x_)^2-x_*y(1,x_)+y_,y_):= if(q==1,x^2/4 and -C_1^2+C_1*x, if(q>1,C_1*x )); dsolve(y(q_,x_)^2+x_*y(1,x_)+c_*y_,y_):= if(q==1 or q>2 and isconstant(c),-(2+c)/4x^2 ); dsolve(y(q_,x_)^2+x_*y(1,x_)-y_,y_):= if(q==1,C_1^2+C_1*x and -x^2/4, if(q>1,C_1*x )); dsolve(y(q_,x_)^2+x_*y(1,x_)+y_,y_):= if(q==1 or q>2,-3/4x^2); dsolve(y(1,x_)^2+y(1,x_)+y_,y_):= -1/4 W(-exp(C_1-x))^2 - 1/2 W(-exp(C_1-x)); dsolve(a_*y(q_,x_)+b_*y(p_,x_)+c_,y_):= dsolve(-b/a*y(p,x)-c/a,y,x,q); dsolve(y(1,x_)+x_*y(2,x_)+c_, y_):= if(hasnot(c,y), C_1+C_2*log(x)-int(int(c,x)/x,x), dsolve(-y(1,x)/x-c/x,y,x,2) ); #dsolve((1-x_^2)*y(2,x_)+2*x_*y(1,x_)+c_*y_,y_):= C_1*legendreP(sqrt(4c+1)/2-1/2,x)+C_2*legendreQ(sqrt(4c+1)/2-1/2,x); dsolve((b_+x_^2)*y(2,x_)+x_*y(1,x_)+y_,y_):= if(isconstant(b), C_1*cos(asinh(x/sqrt(b)))+C_2*sin(asinh(x/sqrt(b)))); #dsolve(y(q_,x_)^2+b_*x_*y(q_,x_)+y(p_,x_),y_):= if(isconstant(b) and q-p==1, gsolution(0,y,x,p)-int((2b+1)/4x^2,x,p) and if(b+c==0, C_1^2/b*x^(q-p)/(q-p)!+C_1*x^^(1+q-p)/(q-p)!) ); #dsolve(y(q_,x_)^2+b_*x_*y(q_,x_)+c_*y(p_,x_),y_):= if(isconstant(b,c) and q-p==1, gsolution(0,y,x,p)-int((2b+c)/4x^2,x,p) and if(b+c==0, C_1^2/b*x^(q-p)/(q-p)!+C_1*x^(1+q-p)/(q-p)!) ); #4; #dsolve(a_*y(p_,x_)^m_+y(p_,x_)+c_*y_+d_,y_):= if(d(d,x,p)==0, dsolve(y(p,x)^m+1/a*y(p,x)+c/a*y,y)-d/c ); #dsolve(a_*y(p_,x_)^m_+b_*y(p_,x_)+c_*y_+d_,y_):= if(d(d,x,p)==0, dsolve(y(p,x)^m+b/a*y(p,x)+c/a*y,y)-d/c ); #dsolve(y(p_,x_)^m_+b_*y(p_,x_)+c_*y_+d_,y_):= if(d(d,x,p)==0, dsolve(y(p,x)^m+b*y(p,x)+c*y,y)-d/c ); #dsolve(y(1,x_)^2+b_*x_*y(1,x_)+c_*y_+d_,y_):= if(isconstant(b,c,d),-(2b+c)/4x^2-d/c and if(b+c==0, C_1^2/b+C_1*x-d/c) ); #dsolve(y(1,x_)^n_+b_*x_*y(1,x_)+c_*y_+d_*y(1,x_)^m_,y_):= if(b+c==0,C_1^n/b+d/b*C_1^m+C_1*x ); #dsolve(-y_+a_*y(1,x)^m_+x_*y(1,x)+y(1,x)^n_,y_):= if(hasnot(a,x), C_1^n+a*C_1^m+C_1*x ); #dsolve(b_-y_+a_*y(1,x)^m_+x_*y(1,x)+y(1,x)^n_,y_):= if(hasnot(a,b,x), C_1^n+a*C_1^m+b+C_1*x ); dsolve(x_*y(1,x_)+b_*exp(x_*y_)+y_+a_,y_):= if(isconstant(a),-log((-b-exp(C_1+a*x))/a)/x ); dsolve(y(q_,x_)+b_*y(p_,x_)+y_+d_,y_):= dsolve(-b*y(p,x)-y-d,y,x,q); dsolve(y(q_,x_)+b_*y(p_,x_)+c_*y_+d_,y_):= dsolve(-b*y(p,x)-c*y-d,y,x,q); dsolve(a_*y(q_,x_)+b_*y(p_,x_)+c_*y_+d_,y_):= dsolve(-b/a*y(p,x)-c/a*y-d/a,y,x,q); #1; dsolve(a_):=dsolve(replace(toy(a),y(x),y),y); dsolve(ds(x_,y_)=c_):= dsolve(c,x,y,1); dsolve(ds(x,y)=m_/n_):= dsolve(n/m,y,x,1); dsolve(dx/dy=m_/n_):= dsolve(n/m,y,x,1); dsolve(dy/dx=c_):=dsolve(c,y,x,1); dsolve(x(p_,t_)=c_):=dsolve(c,x,t,p); dsolve(x(p_,t_)+c_):=dsolve(-c,x,t,p);