Update of /cvsroot/maxima/maxima/share/contrib/diffequations/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32407/d/d/d Modified Files: Makefile testsuite.lisp Added Files: rtestode_murphy_1_1.mac rtestode_murphy_1_2.mac rtestode_murphy_1_3.mac rtestode_murphy_1_4.mac rtestode_murphy_1_5.mac rtestode_murphy_1_6.mac rtestode_murphy_2_1.mac rtestode_murphy_2_2.mac rtestode_murphy_2_3.mac rtestode_murphy_2_4.mac rtestode_murphy_2_5.mac Removed Files: rtestode_murphy1.mac rtestode_murphy2.mac Log Message: Divide rtestode_murphy1.mac iand rtestode_murphy2.mac into multile files. --- NEW FILE: rtestode_murphy_1_1.mac --- /* ODE tests - Murphy equations 1.1 - 1.100 Reference: G M Murphy, Ordinary Differential Equations and Their Solutions, Van Nostrand, 1960 First Order and of First Degree, p 224 ff */ /* Don't kill(all); It messes up trigsimp */ /* Print ode number*/ (pn_(n_):=print("Murphy ODE 1.",n_),true); true; /* 1 */ (pn_(1),ans:contrib_ode(eqn:'diff(y,x)=a*f(x),y,x)); [y=a*'integrate(f(x),x)+%c]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 2 */ (pn_(2),ans:contrib_ode(eqn:'diff(y,x)=x+sin(x)+y,y,x)); [y=%c*exp(x)-1-x-(cos(x)+sin(x))/2]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 3 */ (pn_(3),ans:contrib_ode(eqn:'diff(y,x)=x^2+3*cosh(x)+2*y,y,x)); [y=%e^(2*x)*(-%e^-(3*x)*(3*%e^(2*x)+1)/2-(2*x^2+2*x+1)*%e^-(2*x)/4+%c)]; ans:expand(ans[1]); y = %c*%e^(2*x)-3*%e^x/2-%e^-x/2-x^2/2-x/2-1/4; [method,trigrat(ode_check(eqn,ans))]; [linear,0]; /* 4 */ (pn_(4),ans:contrib_ode(eqn:'diff(y,x)=a+b*x+c*y,y,x)); [y=(-b*(c*x+1)*%e^-(c*x)/c^2-a*%e^-(c*x)/c+%c)*%e^(c*x)]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 5 */ (pn_(5),ans:contrib_ode(eqn:'diff(y,x)=a*cos(b*x+c)+k*y,y,x)); [y=%e^(k*x)*(a*%e^-(k*x)*(b*sin(b*x+c)-k*cos(b*x+c))/(k^2+b^2)+%c)]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 6 */ (pn_(6),ans:contrib_ode(eqn:'diff(y,x)=a*sin(b*x+c)+k*y,y,x)); [y=%e^(k*x)*(a*%e^-(k*x)*(-k*sin(b*x+c)-b*cos(b*x+c))/(k^2+b^2)+%c)]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 7 */ (pn_(7),assume(c>0,k>c),ans:contrib_ode(eqn:'diff(y,x)=a+b*exp(k*x)+c*y,y,x),forget(c>0,k>c),ans); [y = %e^(c*x)*(b*%e^((k-c)*x)/(k-c)-a*%e^-(c*x)/c+%c)]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 8 */ (pn_(8),ans:contrib_ode(eqn:'diff(y,x)=x*(x^2-2*y),y,x)); [y = %e^-x^2*((x^2-1)*%e^x^2/2+%c)]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 9 NOTE: Case a=2 is special */ (pn_(9),ans:contrib_ode(eqn:'diff(y,x)=x*(exp(-x^2)-a*y),y,x)); [y = %e^-(a*x^2/2)*(%e^(a*x^2/2-x^2)/(a-2)+%c)]; [method,ode_check(eqn,ans[1])]; [linear,0]; ans:contrib_ode(eqn:'diff(y,x)=x*(exp(-x^2)-2*y),y,x); [y=(x^2/2+%c)*%e^-x^2]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 10 */ (pn_(10),ans:contrib_ode(eqn:'diff(y,x)=x^2*(a*x^3+b*y),y,x)); [y = (%c-a*(3*b*x^3+9)*%e^-(b*x^3/3)/(3*b^2))*%e^(b*x^3/3)]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 11(i) n#-1*/ (pn_(11),assume(not equal(n,-1)),ans:contrib_ode(eqn:'diff(y,x)=a*x^n*y,y,x),forget(not equal(n,-1)),ans); [y = %c*%e^(a*x^(n+1)/(n+1))]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 11(ii) n=-1*/ ans:contrib_ode(eqn:'diff(y,x)=a*x^-1*y,y,x); [y = %c*%e^(a*log(x))]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 12 */ (pn_(12),ans:contrib_ode(eqn:'diff(y,x)=cos(x)*sin(x)+y*cos(x),y,x)); [y = (%e^-sin(x)*(-sin(x)-1)+%c)*%e^sin(x)]; ans:expand(ans[1]); y = %c*%e^sin(x)-sin(x)-1; [method,ode_check(eqn,ans)]; [linear,0]; /* 13 */ (pn_(13),ans:contrib_ode(eqn:'diff(y,x)=exp(sin(x))+y*cos(x),y,x)); [y = (x+%c)*%e^sin(x)]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 14 */ (pn_(14),ans:contrib_ode(eqn:'diff(y,x)=y*cot(x),y,x)); [y = %c*sin(x)]; [method,trigsimp(ode_check(eqn,ans[1]))]; [linear,0]; /* 15 */ (pn_(15),ans:contrib_ode(eqn:'diff(y,x)=1-y*cot(x),y,x)); [y = (%c-cos(x))/sin(x)]; [method,trigsimp(ode_check(eqn,ans[1]))]; [linear,0]; /* 16 */ (pn_(16),ans:contrib_ode(eqn:'diff(y,x)=x*csc(x)-y*cot(x),y,x)); [y = (x^2/2+%c)/sin(x)]; [method,trigsimp(ode_check(eqn,ans[1]))]; [linear,0]; /* 17 */ (pn_(17),ans:contrib_ode(eqn:'diff(y,x)=(2*csc(2*x)+cot(x))*y,y,x)); [y = %c*sin(x)/(csc(2*x)+cot(2*x))]; [method,trigsimp(ode_check(eqn,ans[1]))]; [linear,0]; /* 18 */ (pn_(18),ans:contrib_ode(eqn:'diff(y,x)=sec(x)-y*cot(x),y,x)); [y = (%c-log(1-sin(x)^2)/2)/sin(x)]; ans:subst(cos(x)^2,1-sin(x)^2,ans[1]); y = (%c-log(cos(x)))/sin(x); [method,trigsimp(ode_check(eqn,ans))]; [linear,0]; /* 19 */ (pn_(19),ans:contrib_ode(eqn:'diff(y,x)=exp(x)*sin(x)+y*cot(x),y,x)); [y = (%e^x+%c)*sin(x)]; [method,trigsimp(ode_check(eqn,ans[1]))]; [linear,0]; /* 20 */ (pn_(20),ans:contrib_ode(eqn:'diff(y,x)+csc(x)+2*y*cot(x)=0,y,x)); [y = (cos(x)+%c)/sin(x)^2]; [method,trigsimp(ode_check(eqn,ans[1]))]; [linear,0]; /* 21 */ (pn_(21),ans:contrib_ode(eqn:'diff(y,x)=2*csc(2*x)*sec(x)^2-2*y*cot(2*x),y,x)); [y=(4*sin(2*x)/(sin(2*x)^2+cos(2*x)^2+2*cos(2*x)+1)+%c)/sin(2*x)]; [method,trigrat(ode_check(eqn,ans[1]))]; [linear,0]; /* 22 This is wrong. The error is also seen in ode2, and is due to an error evaluating integrate(2*COT(x)^2*COS(2*x)/(CSC(2*x)+COT(2*x)),x) This is bug # 1051437 */ /* (pn_(22),ans:contrib_ode(eqn:'diff(y,x)=2*(cot(x)^2*cos(2*x)-y*csc(2*x)),y,x)); [y=(csc(2*x)+cot(2*x))*((2*log(sin(x)^2+cos(x)^2+2*cos(x)+1)+2*log(sin(x)^2+cos(x)^2-2*cos(x)+1)+cos(2*x)/2+%c)]; trigrat(ode_check(eqn,ans[1])); cos(2*x)+1; */ /* 23 */ (pn_(23),ans:contrib_ode(eqn:'diff(y,x)=2*csc(2*x)*(sin(x)^3+y),y,x)); [y=(2*((sin(x)*sin(2*x)+cos(x)*cos(2*x)+cos(x))/(2*sin(2*x)^2+2*cos(2*x)^2+4*cos(2*x)+2)-(sin(2*x)*sin(3*x)+(cos(2*x)+1)*cos(3*x)+3*sin(x)*sin(2*x)+5*cos(x)*cos(2*x)+5*cos(x))/(4*sin(2*x)^2+4*cos(2*x)^2+8*cos(2*x)+4))+%c)/(csc(2*x)+cot(2*x))]; ans:map(trigrat,ans[1]); y=-(sin(2*x)-2*%c*sin(x))/(2*cos(x)); [method,trigrat(ode_check(eqn,ans))]; [linear,0]; /* 24 */ (pn_(24),ans:contrib_ode(eqn:'diff(y,x)=2*csc(2*x)*(1-tan(x)^2+y),y,x)); [y=(-2*((3*cos(4*x)+3*cos(2*x)+2)*sin(6*x)+(-3*sin(4*x)-3*sin(2*x))*cos(6*x)+3*sin(4*x)+3*sin(2*x))/(3*sin(6*x)^2+(18*sin(4*x)+18*sin(2*x))*sin(6*x)+3*cos(6*x)^2+(18*cos(4*x)+18*cos(2*x)+6)*cos(6*x)+27*sin(4*x)^2+54*sin(2*x)*sin(4*x)+27*cos(4*x)^2+(54*cos(2*x)+18)*cos(4*x)+27*sin(2*x)^2+27*cos(2*x)^2+18*cos(2*x)+3)-2*((3*cos(2*x)+1)*sin(6*x)-3*sin(2*x)*cos(6*x)+(9*cos(2*x)+3)*sin(4*x)-9*sin(2*x)*cos(4*x))/(3*sin(6*x)^2+(18*sin(4*x)+18*sin(2*x))*sin(6*x)+3*cos(6*x)^2+(18*cos(4*x)+18*cos(2*x)+6)*cos(6*x)+27*sin(4*x)^2+54*sin(2*x)*sin(4*x)+27*cos(4*x)^2+(54*cos(2*x)+18)*cos(4*x)+27*sin(2*x)^2+27*cos(2*x)^2+18*cos(2*x)+3)-2*(cos(2*x)*sin(4*x)-sin(2*x)*cos(4*x)+sin(2*x))/(sin(4*x)^2+cos(4*x)^2-2*cos(4*x)+1)-2*sin(4*x)/(sin(4*x)^2+cos(4*x)^2-2*cos(4*x)+1)+%c)/(csc(2*x)+cot(2*x))]; ans:map(trigrat,ans[1]); y=(%c*sin(2*x)-2)/(cos(2*x)+1); [method,trigrat(ode_check(eqn,ans))]; [linear,0]; /* 25 */ (pn_(25),ans:contrib_ode(eqn:'diff(y,x)=y*sec(x),y,x)); [y = %c*(tan(x)+sec(x))]; [method,trigsimp(ode_check(eqn,ans[1]))]; [linear,0]; /* 26 */ (pn_(26),ans:contrib_ode(eqn:'diff(y,x)+tan(x)=(1-y)*sec(x),y,x)); [y=(x+%c)/(tan(x)+sec(x))]; [method,trigrat(ode_check(eqn,ans[1]))]; [linear,0]; /* 27 */ (pn_(27),ans:contrib_ode(eqn:'diff(y,x)=y*tan(x),y,x)); [y=%c*sec(x)]; [method,trigrat(ode_check(eqn,ans[1]))]; [linear,0]; /* 28 */ (pn_(28),ans:contrib_ode(eqn:'diff(y,x)=cos(x)+y*tan(x),y,x)); [y=sec(x)*((sin(2*x)/2+x)/2+%c)]; [method,trigrat(ode_check(eqn,ans[1]))]; [linear,0]; /* 29 */ (pn_(29),ans:contrib_ode(eqn:'diff(y,x)=cos(x)-y*tan(x),y,x)); [y=(x+%c)/sec(x)]; [method,trigrat(ode_check(eqn,ans[1]))]; [linear,0]; /* 30 */ (pn_(30),ans:contrib_ode(eqn:'diff(y,x)=sec(x)-y*tan(x),y,x)); [y=(tan(x)+%c)/sec(x)]; [method,trigrat(ode_check(eqn,ans[1]))]; [linear,0]; /* 31 */ (pn_(31),ans:contrib_ode(eqn:'diff(y,x)=sin(2*x)+y*tan(x),y,x)); [y=(%c-2*cos(x)^3/3)*sec(x)]; [method,trigrat(ode_check(eqn,ans[1]))]; [linear,0]; /* 32 */ (pn_(32),ans:contrib_ode(eqn:'diff(y,x)=sin(2*x)-y*tan(x),y,x)); [y=(%c-2*cos(x))/sec(x)]; [method,trigrat(ode_check(eqn,ans[1]))]; [linear,0]; /* 33 */ (pn_(33),ans:contrib_ode(eqn:'diff(y,x)=sin(x)+2*y*tan(x),y,x)); [y=(%c-cos(x)^3/3)*sec(x)^2]; [method,trigrat(ode_check(eqn,ans[1]))]; [linear,0]; /* 34 */ (pn_(34),ans:contrib_ode(eqn:'diff(y,x)=2*(1+sec(2*x)+y*tan(2*x)),y,x)); [y=sec(2*x)*(sin(2*x)+2*x+%c)]; [method,trigrat(ode_check(eqn,ans[1]))]; [linear,0]; /* 35 */ (pn_(35),ans:contrib_ode(eqn:'diff(y,x)=csc(x)+3*y*tan(x),y,x)); [y=sec(x)^3*(log(sin(x))-sin(x)^2/2+%c)]; [method,trigrat(ode_check(eqn,ans[1]))]; [linear,0]; /* 36 */ (pn_(36),ans:contrib_ode(eqn:'diff(y,x)=(a+cos(log(x))+sin(log(x)))*y,y,x)); [y=%c*%e^(x*(sin(log(x))+cos(log(x)))/2+x*(sin(log(x))-cos(log(x)))/2+a*x)]; (assume(x>0),ans:map(trigrat,ans[1]),forget(x>0),ans); y=%c*%e^(x*sin(log(x))+a*x); [method,trigrat(ode_check(eqn,ans))]; [linear,0]; /* 37 */ (pn_(37),ans:contrib_ode(eqn:'diff(y,x)=6*exp(2*x)-y*tanh(x),y,x)); [y=(%e^(3*x)+3*%e^x+%c)/cosh(x)]; [method,trigrat(ode_check(eqn,ans[1]))]; [linear,0]; /* 38 - too general*/ /* 39 - too general */ /* 41 Riccati */ /* 42 Riccati */ (pn_(42),ans:contrib_ode(eqn:'diff(y,x)+1-x=(x+y)*y,y,x)); [[y = -'diff(%u,x,1)/%u,-'diff(%u,x,1)*x+%u*(x-1)+'diff(%u,x,2) = 0]]; method; riccati; /* 43 Riccati */ (pn_(43),ans:contrib_ode(eqn:'diff(y,x)=(x+y)^2,y,x)); [[x=%c-atan(sqrt(%t)),y=-x-sqrt(%t)],[x=atan(sqrt(%t))+%c,y=sqrt(%t)-x]]; solve(ans[1][1],sqrt(%t)); [sqrt(%t)=-tan(x-%c)]; ans[1]:ev(ans[1][2],%[1]); y=tan(x-%c)-x; solve(ans[2][1],sqrt(%t)); [sqrt(%t)=tan(x-%c)]; ans[2]:ev(ans[2][2],%[1]); y=tan(x-%c)-x; [method,trigsimp(ode_check(eqn,ans[1])),trigsimp(ode_check(eqn,ans[2]))]; [lagrange,0,0]; /* 44 Riccati */ (pn_(44),ans:contrib_ode(eqn:'diff(y,x)=(x-y)^2,y,x)); [[x = log(sqrt(%t)+1)/2-log(sqrt(%t)-1)/2+%c,y = x-sqrt(%t)],[x=-log(sqrt(%t)+1)/2+log(sqrt(%t)-1)/2+%c,y=x+sqrt(%t)]]; solve(ans[1][2],sqrt(%t)); [sqrt(%t) = x-y]; ans[1][1],%[1]; x=log(-y+x+1)/2-log(-y+x-1)/2+%c; expand(2*(%-%c)); 2*x-2*%c = log(-y+x+1)-log(-y+x-1); map(exp,%); %e^(2*x-2*%c) = (-y+x+1)/(-y+x-1); ans[1]:first(solve(%,y)); y=((x-1)*%e^(2*x-2*%c)-x-1)/(%e^(2*x-2*%c)-1); solve(ans[2][2],sqrt(%t)); [sqrt(%t) = y-x]; ans[2][1],%[1]; x=-log(y-x+1)/2+log(y-x-1)/2+%c; expand(2*(%-%c)); 2*x-2*%c = log(y-x-1)-log(y-x+1); map(exp,%); %e^(2*x-2*%c)=(y-x-1)/(y-x+1); ans[2]:first(solve(%,y)); y=((x-1)*%e^(2*x-2*%c)-x-1)/(%e^(2*x-2*%c)-1); [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [lagrange,0,0]; /* 45 */ (pn_(45),ans:contrib_ode(eqn:'diff(y,x)=3*(1-x+y)+(x-y)^2,y,x)); [-log(-y+x-1)+log(-y+x-2)+x=%c]; map(exp,ans[1]-x); (-y+x-2)/(-y+x-1)=%e^(%c-x); ans:first(solve(%,y)); y=((x-1)*%e^(%c-x)-x+2)/(%e^(%c-x)-1); [method,ode_check(eqn,ans)]; [lie,0]; /* 46 riccati */ (pn_(46),ans:contrib_ode(eqn:'diff(y,x)=2*x-(1+x^2)*y+y^2,y,x)); [y = ((x^2+1)*'integrate(%e^(x^3/3+x),x)-%e^(x^3/3+x)+%c*x^2+%c)/('integrate(%e^(x^3/3+x),x)+%c)]; [method,ode_check(eqn,ans[1])]; [riccati,0]; /* 47 Riccati */ (pn_(47),ans:contrib_ode(eqn:'diff(y,x)=x*(2+x^3)-(2*x^2-y)*y,y,x)); [(x*y-x^3+1)/(y-x^2) = %c]; ans:first(solve(ans[1],y)); y = (x^3-%c*x^2-1)/(x-%c); [method,ode_check(eqn,ans)]; [lie,0]; /* 48 Riccati Fails as can't solve -'diff(z,x,2) + 2*x^2*'diff(z,x) + (-x^4+2*x+1)*z = 0 but Lie works */ (pn_(48),ans:contrib_ode(eqn:'diff(y,x)=1+x*(2-x^3)+(2*x^2-y)*y,y,x)); [(log(-y+x^2+1)-log(-y+x^2-1)+2*x)/2=%c]; (ans:map(exp,2*ans[1]-2*x),ans:solve(ans,y)); [y=((x^2-1)*%e^(2*%c-2*x)-x^2-1)/(%e^(2*%c-2*x)-1)]; [method,ode_check(eqn,ans[1])]; [lie,0]; /* 49 Riccati */ (pn_(49),ans:contrib_ode(eqn:'diff(y,x)=cos(x)-(sin(x)-y)*y,y,x)); [y = (%e^cos(x)*sin(x)*'integrate(%e^-cos(x),x)+%c*%e^cos(x)*sin(x)-1)/(%e^cos(x)*'integrate(%e^-cos(x),x)+%c*%e^cos(x))]; [method,ode_check(eqn,ans[1])]; [riccati,0]; /* 50 Riccati Fails as can't solve 'diff(z,x,2) - sin(2*x)*'diff(z,x) + cos(2*x)*z = 0 */ (pn_(50),ans:contrib_ode(eqn:'diff(y,x)=cos(2*x)+(sin(2*x)+y)*y,y,x)); [[y=-'diff(%u,x,1)/%u,-'diff(%u,x,1)*sin(2*x)+%u*cos(2*x)+'diff(%u,x,2) = 0]]; /* 51 Riccati */ /* 52 Riccati ode1_riccati fails but ode1_lie succeeds */ (pn_(52),ans:contrib_ode(eqn:'diff(y,x)=(3+x-4*y)^2,y,x)); [-(log(-8*y+2*x+7)-log(-8*y+2*x+5)-4*x)/4=%c]; (ans:-4*ans[1]+4*x,ans:map(exp,ans),ans:first(solve(ans,y))); y = ((2*x+5)*%e^(4*x-4*%c)-2*x-7)/(8*%e^(4*x-4*%c)-8); [method,ode_check(eqn,ans)]; [lie,0]; /* 53 Riccati */ (pn_(53),ans:contrib_ode(eqn:'diff(y,x)=(1+4*x+9*y)^2,y,x)); [-(atan((27*y+12*x+3)/2)-6*x)/6=%c]; ans:first(solve(-6*ans[1]+6*x,y)); y=(2*tan(6*x-6*%c)-12*x-3)/27; [method,trigsimp(ode_check(eqn,ans))]; [lie,0]; /* 54 Riccati */ /* 55 Riccati and separable*/ assume(a>0,b>0); [a>0,b>0]; (pn_(55.1),ans:contrib_ode(eqn:'diff(y,x)=a+b*y^2,y,x)); [atan(sqrt(b)*y/sqrt(a))/(sqrt(a)*sqrt(b)) = x+%c]; solve(ans[1],y); [y = sqrt(a)*tan(sqrt(a)*sqrt(b)*x+%c*sqrt(a)*sqrt(b))/sqrt(b)]; [method,trigsimp(ode_check(eqn,%[1]))]; [separable,0]; forget(a>0,b>0); [a>0,b>0]; assume(a>0,b<0); [a>0,b<0]; (pn_(55.2),ans:contrib_ode(eqn:'diff(y,x)=a+b*y^2,y,x)); [log(-(sqrt(a)*sqrt(-b)-b*y)/(b*y+sqrt(a)*sqrt(-b)))/(2*sqrt(a)*sqrt(-b))=x+%c]; solve(%[1],y); [y=-(sqrt(a)*sqrt(-b)*%e^(2*sqrt(a)*sqrt(-b)*x+2*%c*sqrt(a)*sqrt(-b))+sqrt(a)*sqrt(-b))/(b*%e^(2*sqrt(a)*sqrt(-b)*x+2*%c*sqrt(a)*sqrt(-b))-b)]; [method,ode_check(eqn,%[1])]; [separable,0]; forget(a>0,b<0); [a>0,b<0]; /* 57 Riccati */ /* 58 Riccati */ /* 61 Riccati */ /* 62 Riccati */ (pn_(62),ans:contrib_ode(eqn:'diff(y,x)=1+a*(x-y)*y,y,x)); [y = (sqrt(2)*sqrt(%pi)*a*x*%e^(a*x^2/2)*erf(sqrt(a)*x/sqrt(2))+sqrt(a)*(2*%c*a*x*%e^(a*x^2/2)+2))/(sqrt(2)*sqrt(%pi)*a*%e^(a*x^2/2)*erf(sqrt(a)*x/sqrt(2))+2*%c*a^(3/2)*%e^(a*x^2/2))]; [method,ode_check(eqn,ans[1])]; [riccati,0]; /* 63 Riccati */ /* 64 */ (pn_(64),ans:contrib_ode(eqn:'diff(y,x)=x*y*(3+y),y,x)); [-(log(y+3)-log(y))/3=x^2/2+%c]; map(exp,3*ans[1]); y/(y+3) = %e^(3*(x^2/2+%c)); ans:first(solve(%,y)); y=-3*%e^(3*x^2/2+3*%c)/(%e^(3*x^2/2+3*%c)-1); [method,ode_check(eqn,%)]; [separable,0]; /* 65 Riccati - Can't solve 2nd order ode */ (pn_(65),ans:contrib_ode(eqn:'diff(y,x)=1-x-x^3+(1+2*x^2)*y-x*y^2,y,x)); [[y='diff(%u,x,1)/(%u*x),%u*x^2*(-x^3-x+1)-'diff(%u,x,1)*(-x*(2*x^2+1)-1)-'diff(%u,x,2)*x=0]]; /* 66 Riccati - Can't solve 2nd order ode */ (pn_(66),ans:contrib_ode(eqn:'diff(y,x)=x*(2+x^2*y-y^2),y,x)); [[y='diff(%u,x,1)/(%u*x),-'diff(%u,x,1)*(-x^4-1)+2*%u*x^3-'diff(%u,x,2)*x=0]]; /* 67 Riccati - Can't solve 2nd order ode */ (pn_(67),ans:contrib_ode(eqn:'diff(y,x)=x+(1-2*x)*y-(1-x)*y^2,y,x)); [[y=-'diff(%u,x,1)/(%u*(x-1)),%u*(x-1)^2*x+'diff(%u,x,2)*(x-1)-'diff(%u,x,1)*((1-2*x)*(x-1)+1)=0]]; /* 68 */ (pn_(68),ans:contrib_ode(eqn:'diff(y,x)=a*x*y^2,y,x)); [-1/(a*y)=x^2/2+%c]; ans:first(solve(ans[1],y)); y=-2/(a*x^2+2*%c*a); [method,ode_check(eqn,ans)]; [separable,0]; /* 70 Riccati */ /* 72 Riccati */ (pn_(72),ans:contrib_ode(eqn:'diff(y,x)=sin(x)*(2*sec(x)^2-y^2),y,x)); [[y='diff(%u,x,1)/(%u*sin(x)),2*%u*sec(x)^2*sin(x)^3-'diff(%u,x,2)*sin(x)+'diff(%u,x,1)*cos(x)=0]]; /* 73 Riccati */ (pn_(73),ans:contrib_ode(eqn:'diff(y,x)+4*csc(x)=(3-cot(x))*y+sin(x)*y^2,y,x)); [[y=-'diff(%u,x,1)/(%u*sin(x)),-4*%u*csc(x)*sin(x)^2-'diff(%u,x,1)*((3-cot(x))*sin(x)+cos(x))+'diff(%u,x,2)*sin(x)=0]]; /* 74 */ (pn_(74),ans:contrib_ode(eqn:'diff(y,x)=y*sec(x)+(sin(x)-1)^2,y,x)); [y = (tan(x)+sec(x))*(-8*(log(sin(x)^2/(cos(x)+1)^2+1)/4-log(sin(x)/(cos(x)+1)+1)/2+sin(x)/((cos(x)+1)*(2*sin(x)^2/(cos(x)+1)^2+2)))+8*(-log(sin(x)^2/(cos(x)+1)^2+1)/8+log(sin(x)/(cos(x)+1)+1)/4-(sin(x)^3/(cos(x)+1)^3-sin(x)^2/(cos(x)+1)^2+sin(x)/(cos(x)+1))/(4*sin(x)^4/(cos(x)+1)^4+8*sin(x)^2/(cos(x)+1)^2+4))+2*(log(sin(x)/(cos(x)+1)+1)-log(sin(x)^2/(cos(x)+1)^2+1)/2)+%c)]; /* y = (tan(x)+sec(x))/(%c+sin(x)) ??? */ [method,trigrat(ode_check(eqn,ans[1]))]; [linear,0]; /* 75 */ (pn_(75),ans:contrib_ode(eqn:'diff(y,x)+tan(x)*(1-y^2)=0,y,x)); [-(log(y+1)-log(y-1))/2 = log(sec(x))+%c]; map(exp,2*ans[1]); (y-1)/(y+1)=%e^(2*(log(sec(x))+%c)); ans:first(solve(%,y)); y=-(%e^(2*%c)*sec(x)^2+1)/(%e^(2*%c)*sec(x)^2-1); [method,trigrat(ode_check(eqn,ans))]; [separable,0]; /* 76 Riccati */ /* 78 Abel */ (pn_(78),ans:contrib_ode(eqn:'diff(y,x)+(a*x+y)*y^2=0,y,x)); false; /* 79 Abel */ (pn_(79),ans:contrib_ode(eqn:'diff(y,x)+(a*exp(x)+y)*y^2=0,y,x)); false; /* 88 */ (pn_(88),ans:contrib_ode(eqn:'diff(y,x)+2*x*y*(1+a*x^2*y^2)=0,y,x)); [y=%e^-x^2/sqrt(%c-a*(2*x^2+1)*%e^-(2*x^2)/2)]; [method,ode_check(eqn,ans[1])]; [bernoulli,0]; /* 91 */ (pn_(91),ans:contrib_ode(eqn:'diff(y,x)+(tan(x)+y^2*sec(x))*y=0,y,x)); [y=1/(sec(x)*sqrt(2*sin(x)+%c))]; [method,trigrat(ode_check(eqn,ans[1]))]; [bernoulli,0]; /* 92 */ (pn_(92),ans:contrib_ode(eqn:'diff(y,x)+y^3*sec(x)*tan(x)=0,y,x)); [1/(2*y^2)=1/cos(x)+%c]; ans:first(solve(ans[1],y)); y=-sqrt(cos(x)/(%c*cos(x)+1))/sqrt(2); [method,trigrat(ode_check(eqn,ans))]; [separable,0]; /* 93 - Generic Abel equation */ /* 94 */ (pn_(94),ans:contrib_ode(eqn:'diff(y,x)=(tan(x)+y^3*sec(x))*y,y,x)); [y=sec(x)/(%c-3*(tan(x)^3/3+tan(x)))^(1/3)]; [method,trigrat(ode_check(eqn,ans[1]))]; [bernoulli,0]; /* 95 */ /* (pn_(95),ans:contrib_ode(eqn:'diff(y,x)=a*x^(n/(1-n))+b*y^n,y,x)); */ /* 96 - Too general */ /* 97 - Too general */ /* 98 - Too general */ /* 99 */ (pn_(99),ans:contrib_ode(eqn:'diff(y,x)=sqrt(y),y,x)); [2*sqrt(y)=x+%c]; [method,ode_check(eqn,ans[1])]; [separable,0]; /* 100 */ (pn_(100),ans:contrib_ode(eqn:'diff(y,x)=a+by+sqrt(c+d*y),y,x)); [((-2*by-2*a)*log(sqrt(d*y+c)+by+a)+2*sqrt(d*y+c))/d = x+%c]; [method,ode_check(eqn,ans[1])]; [separable,0]; --- NEW FILE: rtestode_murphy_1_2.mac --- /* ODE tests - Murphy equations 1.101 - 1.200 Reference: G M Murphy, Ordinary Differential Equations and Their Solutions, Van Nostrand, 1960 First Order and of First Degree, p 224 ff */ /* Don't kill(all); It messes up trigsimp */ /* Print ode number*/ (pn_(n_):=print("Murphy ODE 1.",n_),true); true; /* 101 CHECKME*/ /* assume((b^2+8*a)>0,x>0); [b^2+8*a > 0,x > 0]; (pn_(101),ans:contrib_ode(eqn:'diff(y,x)=a*x+b*sqrt(y),y,x)); [x=%c*%e^-((b*sqrt(b^2+8*a)*log(-(-16*y^2+sqrt(b^2+8*a)*(sqrt(y)*(8*x*y+(-b^2-4*a)*x^3)+2*b*x^2*y+a*b*x^4)+2*b^2*x^2*y+(-b^3-8*a*b)*x^3*sqrt(y)+(a*b^2+4*a^2)*x^4)/(16*y^2+(-4*b^2-16*a)*x^2*y+4*a^2*x^4))+(b^2+8*a)*log(-(-2*y+b*x*sqrt(y)+a*x^2)/x^2))/(2*b^2+16*a))]; forget((b^2+8*a)>0,x>0); [b^2+8*a>0,x>0]; method; genhom; */ /* 102 */ (pn_(102),ans:contrib_ode(eqn:'diff(y,x)+x^3=x*sqrt(x^4+4*y),y,x)); [x = %c*%e^-(log((sqrt(4*y+x^4)-x^2)/x^2)/2)]; (ans[1]/%c)^(-2)*x^2; %c^2 = sqrt(4*y+x^4)-x^2; (assume(x^2+%c^2>0),ans:first(solve(%,y)),forget(x^2+%c^2>0),ans); y=(2*%c^2*x^2+%c^4)/4; /* This is correct */ method; genhom; /* 103 */ (pn_(103),ans:contrib_ode(eqn:'diff(y,x)+2*y*(1-x*sqrt(y))=0,y,x)); [y = %e^-(2*x)/(%c-(-x-1)*%e^-x)^2]; map(ratsimp,ans[1]); y=1/(%c^2*%e^(2*x)+(2*%c*x+2*%c)*%e^x+x^2+2*x+1); ans:map(factor,%); y=1/(%c*%e^x+x+1)^2; /* This is correct */ method; bernoulli; /* 104 - There are three cases. Just do first */ assume(a>0,b>0); [a>0,b>0]; (pn_(104),ans:contrib_ode(eqn:'diff(y,x)=sqrt(a+b*y^2),y,x)); [asinh(sqrt(b)*y/sqrt(a))/sqrt(b)=x+%c]; ans:first(solve(ans[1],y)); y=sqrt(a)*sinh(sqrt(b)*(x+%c))/sqrt(b); [method,trigsimp(ode_check(eqn,%))]; [separable,0]; forget(a>0,b>0); [a>0,b>0]; /* 105 CHECKME*/ /*assume(a>0); [a>0]; (pn_(105),ans:contrib_ode(eqn:'diff(y,x)=y*sqrt(a+b*y),y,x)); [log(-(2*sqrt(a)*sqrt(b*y+a)-b*y-2*a)/(b*y))/sqrt(a) = x+%c]; /* a+b*y = a*tanh(%c-x*sqrt(a)/2)^2 */ [method,ode_check(eqn,ans[1])]; [separable,0]; forget(a>0); [a>0]; */ /* 109 CHECK THIS */ (pn_(109),ans:contrib_ode(eqn:'diff(y,x)=cos(x)^2*cos(y),y,x)); [(log(sin(y)+1)-log(sin(y)-1))/2 = (sin(2*x)+2*x)/4+%c]; map(exp,2*ans[1]); (sin(y)+1)/(sin(y)-1) = %e^(2*((sin(2*x)+2*x)/4+%c)); /* ans:first(solve(%,y)); y=asin(%e^(sin(2*x)/2+x+2*%c)/(%e^(sin(2*x)/2+x+2*%c)-1)+1/(%e^(sin(2*x)/2+x+2*%c)-1)); [method,trigrat(ode_check(eqn,ans))]; [separable,0]; */ /* 110 */ (pn_(110),ans:contrib_ode(eqn:'diff(y,x)=sec(x)^2*cot(y)*cos(y),y,x)); [1/cos(y)=tan(x)+%c]; solve(ans[1],y); [y=acos(1/(tan(x)+%c))]; [method,trigrat(ode_check(eqn,%[1]))]; [separable,0]; /* 114 CHECKME - Different results interactively */ /* assume(4*a^2>4*b^2); [4*a^2>4*b^2]; (pn_(114),ans:contrib_ode(eqn:'diff(y,x)=a+b*cos(y),y,x)); [-2*sqrt(a^2-b^2)*atan(sqrt(a^2-b^2)*sin(y)/((b+a)*cos(y)+b+a))/(b^2-a^2)=x+%c]; /* Take this on faith at present */ forget(4*a^2>4*b^2); [4*a^2>4*b^2]; */ /* assume(4*a^2<4*b^2); [4*b^2>4*a^2]; ans:contrib_ode(eqn,y,x); [-log(-((a-b)*sin(y)^2+sqrt(b^2-a^2)*(2*cos(y)+2)*sin(y)+(-b-a)*cos(y)^2+(-2*b-2*a)*cos(y)-b-a)/((b-a)*sin(y)^2+(-b-a)*cos(y)^2+(-2*b-2*a)*cos(y)-b-a))/sqrt(b^2-a^2)=x+%c]; /* Take this on faith at present */ forget(4*a^2<4*b^2); [4*b^2>4*a^2]; */ /* 115 - takes "forever" in ode1_lie() */ /* (pn_(115),ans:contrib_ode(eqn:'diff(y,x)+x*(sin(2*y)-x^2*cos(y)^2)=0,y,x)); */ /* 116 */ (pn_(116),ans:contrib_ode(eqn:'diff(y,x)+tan(x)*sec(x)*cos(y)^2,y,x)); [-tan(y)=1/cos(x)+%c]; map(atan,-ans[1]); /* FIXME: solve(%[1],y) gives wrong answer */ y=-atan(1/cos(x)+%c); [method,trigrat(ode_check(eqn,%))]; [separable,0]; /* 117 */ (pn_(117),ans:contrib_ode(eqn:'diff(y,x)=cot(x)*cot(y),y,x)); [-log(1-sin(y)^2)/2 = log(sin(x))+%c]; /* map(exp,2*ans[1]); 1/(1-sin(y)^2) = %e^(2*(log(sin(x))+%c)); ratsimp(%); -1/(sin(y)^2-1) = %e^(2*%c)*sin(x)^2; trigsimp(%); 1/cos(y)^2 = %e^(2*%c)*sin(x)^2; solve(%,y); [y = %pi-acos(%e^-%c/sin(x)),y = acos(%e^-%c/sin(x))]; [method,trigrat(ode_check(eqn,%[1])),trigrat(ode_check(eqn,%[2]))]; [separable,0,0];*/ /* 118 */ (pn_(118),ans:contrib_ode(eqn:'diff(y,x)+cot(x)*cot(y)=0,y,x)); [log(1-sin(y)^2)/2 = log(sin(x))+%c]; /* map(exp,2*ans[1]); 1-sin(y)^2 = %e^(2*(log(sin(x))+%c)); ratsimp(%); 1-sin(y)^2 = %e^(2*%c)*sin(x)^2; trigsimp(%); cos(y)^2 = %e^(2*%c)*sin(x)^2; solve(%,y); [y = %pi-acos(%e^%c*sin(x)),y = acos(%e^%c*sin(x))]; [method,trigrat(ode_check(eqn,%[1])),trigrat(ode_check(eqn,%[2]))]; [separable,0,0];*/ /* 119 */ (pn_(119),ans:contrib_ode(eqn:'diff(y,x)=sin(x)*(csc(y)-cot(y)),y,x)); [2*log(sin(y)/(cos(y)+1))-log((sin(y)^2+cos(y)^2+2*cos(y)+1)/(cos(y)^2+2*cos(y)+1))=%c-cos(x)]; /* 120 */ (pn_(120),ans:contrib_ode(eqn:'diff(y,x)=tan(x)*cot(y),y,x)); [-log(1-sin(y)^2)/2=log(sec(x))+%c]; subst(cos(y)^2,1-sin(y)^2,ans[1]); -log(cos(y))=log(sec(x))+%c; subst(1/cos(x),sec(x),%); -log(cos(y))=%c-log(cos(x)); map(exp,-%); cos(y)=%e^-%c*cos(x); subst(%c,%e^-%c,%); /* Change to form of the constant */ cos(y)=%c*cos(x); /* This is correct */ solve(%,y); [y = acos(%c*cos(x))]; [method,trigsimp(ode_check(eqn,%[1]))]; [separable, 0]; /* 121 */ (pn_(121),ans:contrib_ode(eqn:'diff(y,x)+tan(x)*cot(y)=0,y,x)); [log(1-sin(y)^2)/2 = log(sec(x))+%c]; subst(cos(y)^2,1-sin(y)^2,ans[1]); log(cos(y))=log(sec(x))+%c; subst(1/cos(x),sec(x),%); log(cos(y))=%c-log(cos(x)); map(exp,%); cos(y)=%e^%c/cos(x); subst(%c,%e^%c,%); /* Change to form of the constant */ cos(y)=%c/cos(x); /* This is correct */ solve(%,y); [y = acos(%c/cos(x))]; [method,trigsimp(ode_check(eqn,%[1]))]; [separable,0]; /* 122 */ (pn_(122),ans:contrib_ode(eqn:'diff(y,x)+sin(2*x)*csc(2*y)=0,y,x)); [cos(2*y)/2=%c-cos(2*x)/2]; (ans:expand(2*ans[1]),ans:subst(%c,2*%c,ans)); cos(2*y)=%c-cos(2*x); /* This is correct */ solve(%,y); [y = -(acos(cos(2*x)-%c)-%pi)/2]; [method,trigsimp(ode_check(eqn,%[1]))]; [separable,0]; /* 123 */ (pn_(123),ans:contrib_ode(eqn:'diff(y,x)=tan(x)*(tan(y)+sec(x)*sec(y)),y,x)); false; /* 124 */ (pn_(124),ans:contrib_ode(eqn:'diff(y,x)=cos(x)*sec(y)^2,y,x)); [(sin(2*y)+2*y)/4 = sin(x)+%c]; (ans:4*ans[1],ans:subst(%c,4*%c,expand(ans))); sin(2*y)+2*y=4*sin(x)+%c; /* This is correct */ method; separable; /* 125 */ (pn_(125),ans:contrib_ode(eqn:'diff(y,x)=sec(x)^2*sec(y)^3,y,x)); [-(sin(y)^3-3*sin(y))/3=tan(x)+%c]; (ans:3*ans[1],ans:subst(%c,3*%c,expand(ans))); 3*sin(y)-sin(y)^3=3*tan(x)+%c; trigsimp(lhs(ans))=rhs(ans); (cos(y)^2+2)*sin(y)=3*tan(x)+%c; /* This is correct */ method; separable; /* 126 */ assume(a>b,4*a^2>4*b^2); [a>b,4*a^2>4*b^2]; (pn_(126),ans:contrib_ode(eqn:'diff(y,x)=a+b*sin(y),y,x)); [2*atan((a*sin(y)+b*cos(y)+b)/(sqrt(a^2-b^2)*(cos(y)+1)))/sqrt(a^2-b^2)=x+%c]; /* Need to check this */ forget(a>b,4*a^2>4*b^2); [a>b,4*a^2>4*b^2]; /* 127 - FIXME: ode1_lie takes "forever" */ /* (pn_(127),ans:contrib_ode(eqn:'diff(y,x)=a+b*sin(%A*x+%B*y),y,x)); */ /* 128 - FIXME: ode1_lie takes "forever" */ /* (pn_(128),ans:contrib_ode(eqn:'diff(y,x)=(1+cos(x)*sin(y))*tan(y),y,x)); */ /* 129 */ (pn_(129),ans:contrib_ode(eqn:'diff(y,x)+csc(2*x)*sin(2*y)=0,y,x)); [(log(sin(2*y)^2+cos(2*y)^2+2*cos(2*y)+1)-log(sin(y)^2+cos(y)^2+2*cos(y)+1)-log(sin(y)^2+cos(y)^2-2*cos(y)+1))/4=%c-log(csc(2*x)+cot(2*x))/2]; map(exp,4*ans[1]); (sin(2*y)^2+cos(2*y)^2+2*cos(2*y)+1)/((sin(y)^2+cos(y)^2-2*cos(y)+1)*(sin(y)^2+cos(y)^2+2*cos(y)+1))=%e^(4*(%c-log(csc(2*x)+cot(2*x))/2)); trigsimp(%); (cos(2*y)+1)/(2*sin(y)^2) = %e^(4*%c)*sin(2*x)^2/(cos(2*x)^2+2*cos(2*x)+1); subst(%c,exp(4*%c),%); (cos(2*y)+1)/(2*sin(y)^2) = %c*sin(2*x)^2/(cos(2*x)^2+2*cos(2*x)+1); /* Is this equivalent to tan(x)*tan(y)=C */ /* 132 CHECKME - Why the %I in the solution? */ /* Interactive solution is equivalent but different */ (pn_(132),ans:contrib_ode(eqn:'diff(y,x)=x+exp(y),y,x)); [-%e^-y*(sqrt(2)*sqrt(%pi)*%i*erf(%i*x/sqrt(2))*%e^y-2*%e^(x^2/2))/2=%c]; solve(ans[1],y); /*[y = log(2*%c*%e^(x^2/2)/(%pi*erf(sqrt(2)*%i*x/2)^2+2*%c^2)-sqrt(2)*sqrt(%pi)*%i*%e^(x^2/2)*erf(sqrt(2)*%i*x/2)/(%pi*erf(sqrt(2)*%i*x/2)^2+2*%c^2))];*/ [y = log(2*%e^(x^2/2)/(sqrt(2)*sqrt(%pi)*%i*erf(%i*x/sqrt(2))+2*%c))]; [method,ode_check(eqn,%[1])]; [lie,0]; /* 133 */ (pn_(133),ans:contrib_ode(eqn:'diff(y,x)=exp(x+y),y,x)); [-%e^-y*(%e^(y+x)+1)=%c]; solve(expand(ans[1]),y); [y = log(-1/(%e^x+%c))]; [method,ode_check(eqn,%[1])]; [exact,0]; /* 134 - Solution is different to Murphy */ (pn_(134),ans:contrib_ode(eqn:'diff(y,x)=exp(x)*(a+b*exp(-y)),y,x)); [(log(a*%e^y+b)-a*%e^x)/a = %c]; a*ans[1]+a*exp(x); log(a*%e^y+b) = a*%e^x+%c*a; map(exp,%); a*%e^y+b = %e^(a*%e^x+%c*a); solve(%,y); [y = log(%e^(a*%e^x+%c*a)/a-b/a)]; [method,ode_check(eqn,%[1])]; [exact,0]; /* 135 */ (pn_(135),ans:contrib_ode(eqn:'diff(y,x)+y*log(x)*log(y),y,x)); [-log(log(y))=x*log(x)-x+%c]; solve(ans[1],y); [y=%e^%e^(-x*log(x)+x-%c)]; [method,ode_check(eqn,%[1])]; [separable,0]; /* 136 - Too general? ode1_lie runs "forever" */ /* (pn_(136),ans:contrib_ode(eqn:'diff(y,x)=x^(m-1)*y^(1-n)*f(a*x^m+b*y^n),y,x)); */ /* 137 */ (pn_(137),ans:contrib_ode(eqn:'diff(y,x)=a*f(y),y,x)); [('integrate(1/f(y),y))/a = x+%c]; method; separable; /* 138 - Too general */ /* 139 */ (pn_(139),ans:contrib_ode(eqn:'diff(y,x)=f(x)*g(y),y,x)); ['integrate(1/g(y),y) = 'integrate(f(x),x)+%c]; method; separable; /* 140 */ (pn_(140),ans:contrib_ode(eqn:2*'diff(y,x)=sec(x)^2+y*sec(x)*csc(x),y,x)); [y = %e^((log(sin(x))-log(sin(x)^2-1)/2)/2)*(('integrate(sec(x)^2*%e^-((log(sin(x))-log(sin(x)^2-1)/2)/2),x))/2+%c)]; /* Mmmm */ method; linear; /* 141 Riccati */ (pn_(141),ans:contrib_ode(eqn:2*'diff(y,x)+2*csc(x)^2=y*csc(x)*sec(x)+y^2*sec(x)^2,y,x)); [[y=-2*'diff(%u,x,1)/(%u*sec(x)^2),-'diff(%u,x,1)*(sec(x)^2*tan(x)+csc(x)*sec(x)^3/4)-%u*csc(x)^2*sec(x)^4/4+'diff(%u,x,2)*sec(x)^2/2=0]]; method; riccati; /* 142 - ode1_lie runs "forever"*/ /* (pn_(142),ans:contrib_ode(eqn:2*'diff(y,x)=2*sin(y)^2*tan(y)-x*sin(2*y),y,x)); */ /* 143 */ /* 144 */ (pn_(144),ans:contrib_ode(eqn:3*'diff(y,x)=x+sqrt(x^2-3*y),y,x)); /* [x=%c*%e^((log((6*x^2*y+3*x^3*sqrt(x^2-3*y)-3*x^4)/(6*x^2*y))-3*log((-6*y+x*sqrt(x^2-3*y)+x^2)/x))/6)];*/ /* Assume correct */ [x = %c*%e^-((3*log((-6*y+x*sqrt(x^2-3*y)+x^2)/x)-log((2*x*sqrt(x^2-3*y)-x^2)/(2*x*sqrt(x^2-3*y)+2*x^2)))/6)]; method; genhom; /* 145 */ assume(a>0); [a>0]; (pn_(145),ans:contrib_ode(eqn:x*'diff(y,x)=sqrt(a^2-x^2),y,x)); [y=-a*log(2*a*sqrt(a^2-x^2)/abs(x)+2*a^2/abs(x))+sqrt(a^2-x^2)+%c]; [method,ode_check(eqn,ans[1])]; [linear,0]; forget(a>0); [a>0]; /* 146 */ (pn_(146),ans:contrib_ode(eqn:x*'diff(y,x)+x+y=0,y,x)); [y=(%c-x^2/2)/x]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 147 */ (pn_(147),ans:contrib_ode(eqn:x*'diff(y,x)+x^2-y=0,y,x)); [y=(%c-x)*x]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 148 */ (pn_(148),ans:contrib_ode(eqn:x*'diff(y,x)=x^3-y,y,x)); [y=(x^4/4+%c)/x]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 149 */ (pn_(149),ans:contrib_ode(eqn:x*'diff(y,x)=1+x^3+y,y,x)); [y=x*(x^2/2-1/x+%c)]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 150 */ assume(not(equal(m,1))); [not equal(m,1)]; (pn_(150),ans:contrib_ode(eqn:x*'diff(y,x)=x^m+y,y,x)); [y=x*(x^(m-1)/(m-1)+%c)]; [method,ode_check(eqn,ans[1])]; [linear,0]; forget(not(equal(m,1))); [not equal(m,1)]; /* 151 */ (pn_(151),ans:contrib_ode(eqn:x*'diff(y,x)=x*sin(x)-y,y,x)); [y=(sin(x)-x*cos(x)+%c)/x]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 152 */ (pn_(152),ans:contrib_ode(eqn:x*'diff(y,x)=x^2*sin(x)+y,y,x)); [y=x*(%c-cos(x))]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 153 */ assume(not(equal(n,-1))); '[not equal(n,-1)]; (pn_(153),ans:contrib_ode(eqn:x*'diff(y,x)=x^n*log(x)-y,y,x)); [y=(x^(n+1)*log(x)/(n+1)-x^(n+1)/(n+1)^2+%c)/x]; [method,ode_check(eqn,ans[1])]; [linear,0]; forget(not(equal(n,-1))); '[not equal(n,-1)]; /* 154 */ (pn_(154),ans:contrib_ode(eqn:x*'diff(y,x)=sin(x)-2*y,y,x)); [y=(sin(x)-x*cos(x)+%c)/x^2]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 155 */ (pn_(155),ans:contrib_ode(eqn:x*'diff(y,x)=a*y,y,x)); [y=%c*%e^(a*log(x))]; ans:map(radcan,ans); [y=%c*x^a]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 156 */ assume(not(equal(a,0)),not(equal(a,1))); '[not equal(a,0),not equal(a,1)]; (pn_(156),ans:contrib_ode(eqn:x*'diff(y,x)=1+x+a*y,y,x)); [y=(-%e^-(a*log(x))/a+%e^((1-a)*log(x))/(1-a)+%c)*%e^(a*log(x))]; ans:map(radcan,ans); [y=((%c*a^2-%c*a)*x^a-a*x-a+1)/(a^2-a)]; [method,ode_check(eqn,ans[1])]; [linear,0]; forget(not(equal(a,0)),not(equal(a,1))); '[not equal(a,0),not equal(a,1)]; /* 157 */ assume(not(equal(b,1))); '[not equal(b,1)]; (pn_(157),ans:contrib_ode(eqn:x*'diff(y,x)=a*x+b*y,y,x)); [y=(a*x*%e^-(b*log(x))/(1-b)+%c)*%e^(b*log(x))]; ans:map(radcan,ans); [y=((%c*b-%c)*x^b-a*x)/(b-1)]; [method,ode_check(eqn,ans[1])]; [linear,0]; forget(not(equal(b,1))); '[not equal(b,1)]; /* 158 */ assume(not(equal(b,2))); [not equal(b,2)]; (pn_(158),ans:contrib_ode(eqn:x*'diff(y,x)=a*x^2+b*y,y,x)); [y=(a*x^2*%e^-(b*log(x))/(2-b)+%c)*%e^(b*log(x))]; ans:map(radcan,ans); [y=((%c*b-2*%c)*x^b-a*x^2)/(b-2)]; [method,ode_check(eqn,ans[1])]; [linear,0]; forget(not(equal(b,2))); [not equal(b,2)]; /* 159 */ assume(not(equal(n,c))); [not equal(n,c)]; (pn_(159),ans:contrib_ode(eqn:x*'diff(y,x)=a+b*x^n+c*y,y,x)); [y=%e^(c*log(x))*(-b*%e^(n*log(x)-c*log(x))/(c-n)-a*%e^-(c*log(x))/c+%c)]; ans:map(radcan,ans); [y=(b*c*x^n+(%c*c*n-%c*c^2)*x^c-a*n+a*c)/(c*n-c^2)]; [method,ode_check(eqn,ans[1])]; [linear,0]; forget(not(equal(n,c))); [not equal(n,c)]; /* 160 */ (pn_(160),ans:contrib_ode(eqn:x*'diff(y,x)+2+(3-x)*y=0,y,x)); [y=(%c-2*(-x^2-2*x-2)*%e^-x)*%e^x/x^3]; ans:map(radcan,ans); [y=(%c*%e^x+2*x^2+4*x+4)/x^3]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 161 */ (pn_(161),ans:contrib_ode(eqn:x*'diff(y,x)+x+(2+a*x)*y=0,y,x)); [y=%e^-(a*x)*(%c-(a^2*x^2-2*a*x+2)*%e^(a*x)/a^3)/x^2]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 162 */ (pn_(162),ans:contrib_ode(eqn:x*'diff(y,x)+(a+b*x)*y=0,y,x)); [y=%c*%e^(-a*log(x)-b*x)]; ans:map(radcan,ans); [y=%c*%e^-(b*x)/x^a]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 163 */ (pn_(163),ans:contrib_ode(eqn:x*'diff(y,x)=x^3+(1-2*x^2)*y,y,x)); [y=x*%e^-x^2*(%e^x^2/2+%c)]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 164 */ (pn_(164),ans:contrib_ode(eqn:x*'diff(y,x)=a*x-(1-b*x^2)*y,y,x)); [y=(%c-a*%e^-(b*x^2/2)/b)*%e^(b*x^2/2)/x]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 165 */ (pn_(165),ans:contrib_ode(eqn:x*'diff(y,x)+(2-a*x^2)*y,y,x)); [y=%c*%e^(a*x^2/2)/x^2]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 166 */ (pn_(166),ans:contrib_ode(eqn:x*'diff(y,x)+x^2=y^2,y,x)); [y=(bessel_k(1,x)*%c-bessel_i(1,x))*x/(bessel_k(0,x)*%c+bessel_i(0,x))]; [method,ode_check(eqn,ans[1])]; [riccati,0]; /* 167 */ (pn_(167),ans:contrib_ode(eqn:x*'diff(y,x)=x^2+y*(1+y),y,x)); [y=x*tan(x+%c)]; [method,trigsimp(ode_check(eqn,ans[1]))]; [riccati,0]; /* 168 */ (pn_(168),ans:contrib_ode(eqn:x*'diff(y,x)-y+y^2=x^(2/3),y,x)); [y=x^(2/3)/(x^(1/3)/tanh(3*x^(1/3)+%c)-1/3)]; [method,trigsimp(ode_check(eqn,ans[1]))]; [riccati,0]; /* 169 */ assume(a>0,b>0); [a>0,b>0]; (pn_(169),ans:contrib_ode(eqn:x*'diff(y,x)=a+b*y^2,y,x)); [atan(sqrt(b)*y/sqrt(a))/(sqrt(a)*sqrt(b))=log(x)+%c]; solve(ans[1],y); [y=sqrt(a)*tan(sqrt(a)*sqrt(b)*log(x)+%c*sqrt(a)*sqrt(b))/sqrt(b)]; [method,trigsimp(ode_check(eqn,%[1]))]; [separable,0]; forget(a>0,b>0); [a>0,b>0]; assume(a<0,b>0); [a<0,b>0]; (pn_("169ii"),ans:contrib_ode(eqn:x*'diff(y,x)=a+b*y^2,y,x)); [log(-(sqrt(-a)*sqrt(b)-b*y)/(b*y+sqrt(-a)*sqrt(b)))/(2*sqrt(-a)*sqrt(b))=log(x)+%c]; solve(ans[1],y); [y=-(sqrt(-a)*sqrt(b)*%e^(2*sqrt(-a)*sqrt(b)*log(x)+2*%c*sqrt(-a)*sqrt(b))+sqrt(-a)*sqrt(b))/(b*%e^(2*sqrt(-a)*sqrt(b)*log(x)+2*%c*sqrt(-a)*sqrt(b))-b)]; [method,ode_check(eqn,%[1])]; [separable,0]; forget(a<0,b>0); [a<0,b>0]; /* 170 */ assume(a>0,b>0); [a>0,b>0]; (pn_("170i"),ans:contrib_ode(eqn:x*'diff(y,x)=a*x^2+y+b*y^2,y,x)); [y=sqrt(a)*x*tan(sqrt(a)*sqrt(b)*x+%c)/sqrt(b)]; [method,trigsimp(ode_check(eqn,ans[1]))]; [riccati,0]; forget(a>0,b>0); [a>0,b>0]; assume(a>0,b<0); [a>0,b<0]; (pn_("170ii"),ans:contrib_ode(eqn:x*'diff(y,x)=a*x^2+y+b*y^2,y,x)); [y=sqrt(a)*x*tanh(sqrt(a)*sqrt(-b)*x+%c)/sqrt(-b)]; [method,trigsimp(ode_check(eqn,ans[1]))]; [riccati,0]; forget(a>0,b<0); [a>0,b<0]; /* 171 */ assume(a>0,b>0); [a>0,b>0]; (pn_(171),ans:contrib_ode(eqn:x*'diff(y,x)=a*x^(2*n)+(n+b*y)*y,y,x)); [y=sqrt(a)*x^n*tan(sqrt(a)*sqrt(b)*x^n/n+%c)/sqrt(b)]; [method,trigsimp(ode_check(eqn,ans[1]))]; [riccati,0]; forget(a>0,b>0); [a>0,b>0]; /* 172 Too general */ /* 173 Too general */ /* 174 */ assume(a>0); [a>0]; (pn_(174),ans:contrib_ode(eqn:x*'diff(y,x)+a+x*y^2=0,y,x)); [y=(bessel_y(0,2*sqrt(a)*sqrt(x))*%c+bessel_j(0,2*sqrt(a)*sqrt(x)))*sqrt(a)/((bessel_y(1,2*sqrt(a)*sqrt(x))*%c+bessel_j(1,2*sqrt(a)*sqrt(x)))*sqrt(x))]; [method,ode_check(eqn,ans[1])]; [riccati,0]; forget(a>0); [a>0]; /* 175 */ (pn_(175),ans:contrib_ode(eqn:x*'diff(y,x)+(1-x*y)*y=0,y,x)); [y=1/(x*(%c-log(x)))]; [method,ode_check(eqn,ans[1])]; [bernoulli,0]; /* 176 */ (pn_(176),ans:contrib_ode(eqn:x*'diff(y,x)=(1-x*y)*y,y,x)); [(x^2*y-2*x)/(2*y) = %c]; solve(ans[1],y); [y = 2*x/(x^2-2*%c)]; [method,ode_check(eqn,%[1])]; [exact,0]; /* 177 */ (pn_(177),ans:contrib_ode(eqn:x*'diff(y,x)=(1+x*y)*y,y,x)); [-(x^2*y+2*x)/(2*y)=%c]; solve(ans[1],y); [y=-2*x/(x^2+2*%c)]; [method,ode_check(eqn,%[1])]; [exact,0]; /* 178 */ (pn_(178),ans:contrib_ode(eqn:'diff(y,x)=a*x^2+(1/x-y)*y,y,x)); [y = sqrt(a)*(%c*x*sinh(sqrt(a)*x^2/2)+%i*x*cosh(sqrt(a)*x^2/2))/(%i*sinh(sqrt(a)*x^2/2)+%c*cosh(sqrt(a)*x^2/2))]; [method,ode_check(eqn,ans[1])]; [riccati,0]; /* 179 */ (pn_(179),ans:contrib_ode(eqn:x*'diff(y,x)=x^3+(1+2*x^2)*y+x*y^2,y,x)); [y = -(%c*x^3+(2*%c+2)*x)/(%c*x^2+2)]; [method,ode_check(eqn,ans[1])]; [riccati,0]; /* 180 */ (pn_(180),ans:contrib_ode(eqn:x*'diff(y,x)=y*(1+2*x*y),y,x)); [-(x^2*y+x)/y = %c]; ans:first(solve(ans[1],y)); y = -x/(x^2+%c); [method,ode_check(eqn,ans)]; [exact,0]; /* 181 Riccati - CHECK SOLUTION Fails as can't solve -a*'DIFF(z,x,2)-2*a*'DIFF(z,x,1)/x-a^2*b*z = 0 */ (pn_(181),assume(a>0,b>0),ans:contrib_ode(eqn:x*'diff(y,x)+b*x+(2+a*x*y)*y=0,y,x),forget(a>0,b>0),ans); [-(sqrt(a)*sqrt(b)*(atan((a^2*x*y^2+a*y+a*b*x)/(sqrt(a)*sqrt(b)))-atan(sqrt(a)*y/sqrt(b)))-a*b*x)/(a*b)=%c]; /* 182 Riccati */ ans:contrib_ode(eqn:x*'diff(y,x)+a0+a1*x+(a2+a3*x*y)*y=0,y,x); [[y='diff(%u,x,1)/(%u*a3),%u*a3^2*(-a0/x-a1)-'diff(%u,x,1)*a2*a3/x-'diff(%u,x,2)*a3=0]]; method; riccati; /* 183 Riccati */ (pn_(183),ans:contrib_ode(eqn:x*'diff(y,x)+a*x^2*y^2+2*y=b,y,x)); [[y='diff(%u,x,1)/(%u*a*x),%u*a^2*b*x-'diff(%u,x,2)*a*x-'diff(%u,x,1)*a=0]]; method; riccati; /* 184 Riccati */ assume(not equal(m+n,0)); [not equal(n+m,0)]; (pn_(184),ans:contrib_ode(eqn:x*'diff(y,x)+x^m+(n-m)*y/2+x^n*y^2=0,y,x)); [y = -(%c*x^(n/2+m/2)*sin(2*x^(n/2+m/2)/(n+m))-x^(n/2+m/2)*cos(2*x^(n/2+m/2)/(n+m)))/(x^n*sin(2*x^(n/2+m/2)/(n+m))+%c*x^n*cos(2*x^(n/2+m/2)/(n+m)))]; [method,ode_check(eqn,ans[1])]; [riccati,0]; forget(not equal(m+n,0)); '[not equal(n+m,0)]; /* 185 */ (pn_(185),ans:contrib_ode(eqn:x*'diff(y,x)+(a+b*x^n*y)*y,y,x)); [y = %e^-(a*log(x))/(%c-b*%e^(n*log(x)-a*log(x))/(a-n))]; ans:map(radcan,ans); [y=(n-a)/(b*x^n+(%c*n-%c*a)*x^a)]; [method,ode_check(eqn,ans[1])]; [bernoulli,0]; /* 186 */ (pn_(186),ans:contrib_ode(eqn:x*'diff(y,x)=a*x^m-b*y-c*x^n*y^2,y,x)); [[y='diff(%u,x,1)*x^(1-n)/(%u*c),-'diff(%u,x,2)*c*x^(n-1)-'diff(%u,x,1)*(b*c*x^(n-2)-c*(n-1)*x^(n-2))+%u*a*c^2*x^(2*(n-1)+m-1)=0]]; method; riccati; /* 187 */ (pn_(187),ans:contrib_ode(eqn:x*'diff(y,x)=2*x-y+a*x^n*(x-y)^2,y,x)); [[y=-'diff(%u,x,1)*x^(1-n)/(%u*a),%u*a^2*x^(2*(n-1))*(a*x^(n+1)+2)-'diff(%u,x,1)*(a*x^(n-1)*(-2*a*x^n-1/x)+a*(n-1)*x^(n-2))+'diff(%u,x,2)*a*x^(n-1)=0]]; method; riccati; /* 188 */ (pn_(188),ans:contrib_ode(eqn:x*'diff(y,x)+(1-a*y*log(x))*y=0,y,x)); [y = 1/(x*(%c-a*(-log(x)/x-1/x)))]; [method,ode_check(eqn,ans[1])]; [bernoulli,0]; /* 189 Riccati */ /* 190 */ (pn_(190),ans:contrib_ode(eqn:x*'diff(y,x)=y*(1+y^2),y,x)); [-(log(y^2+1)-2*log(y))/2 = log(x)+%c]; ans[1],%c=log(%c)/2; -(log(y^2+1)-2*log(y))/2 = log(x)+log(%c)/2; map(exp,2*%); y^2/(y^2+1) = %e^(2*(log(x)+log(%c)/2)); map(radcan,%); y^2/(y^2+1) = %c*x^2; ans:solve(%,y); [y = -x*sqrt(-%c/(%c*x^2-1)),y = x*sqrt(-%c/(%c*x^2-1))]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [separable,0,0]; /* 191 */ (pn_(191),ans:contrib_ode(eqn:x*'diff(y,x)+(1-x*y^2)*y=0,y,x)); [y=1/(sqrt(2/x+%c)*x)]; [method,ode_check(eqn,ans[1])]; [bernoulli,0]; /* 192 */ (pn_(191),ans:contrib_ode(eqn:x*'diff(y,x)+(1-x*y^2)*y=0,y,x)); [y = 1/(sqrt(2/x+%c)*x)]; [method,ode_check(eqn,ans[1])]; [bernoulli,0]; /* 193 */ assume(not(equal(a,0)),not(equal(a,-1))); '[not equal(a,0),not equal(a,-1)]; (pn_(193),ans:contrib_ode(eqn:x*'diff(y,x)=a*y+b*(1+x^2)*y^3,y,x)); [y=%e^(a*log(x))/sqrt(%c-2*(b*%e^((2*a+2)*log(x))/(2*a+2)+b*%e^(2*a*log(x))/(2*a)))]; ans:map(radcan,ans); [y=sqrt(a)*sqrt(a+1)*x^a/sqrt(x^(2*a)*((-a-1)*b-a*b*x^2)+%c*a^2+%c*a)]; [method,ode_check(eqn,ans[1])]; [bernoulli,0]; forget(not(equal(a,0)),not(equal(a,-1))); '[not equal(a,0),not equal(a,-1)]; /* 194 */ (pn_(194),ans:contrib_ode(eqn:x*'diff(y,x)+2*y=a*x^(2*k)*y^k,y,x)); [y=(a*(1-k)*x^2/2+%c)^(1/(1-k))/x^2]; /* CHECKME */ method; bernoulli; /* 195 */ (pn_(195),ans:contrib_ode(eqn:x*'diff(y,x)=4*(y-sqrt(y)),y,x)); [log(sqrt(y)-1)/2=log(x)+%c]; map(exp,2*ans[1]); sqrt(y)-1 = %e^(2*(log(x)+%c)); solve(%,y); [y = %e^(4*%c)*x^4+2*%e^(2*%c)*x^2+1]; [method,radcan(ode_check(eqn,%[1]))]; [separable,0]; /* 196 */ (pn_(196),ans:contrib_ode(eqn:x*'diff(y,x)+2*y=sqrt(1+y^2),y,x)); ['integrate(1/(sqrt(y^2+1)-2*y),y) = log(x)+%c]; /* CHECKME */ method; separable; /* 197 */ (pn_(197),ans:contrib_ode(eqn:x*'diff(y,x)=y+sqrt(x^2+y^2),y,x)); [x=%c*%e^(x*asinh(y/x)/abs(x))]; assume(x>0); [x > 0]; ratsimp(ans[1]); x = %c*%e^asinh(y/x); map(log,%/%c); log(x/%c) = asinh(y/x); solve(%,y); [y = x*sinh(log(x/%c))]; ode_check(eqn,%[1]); x*cosh(log(x/%c))-sqrt(x^2*sinh(log(x/%c))^2+x^2); [method,trigsimp(%)]; [genhom,0]; forget(x>0); [x > 0]; /* 198 */ (pn_(198),ans:contrib_ode(eqn:x*'diff(y,x)=y+sqrt(x^2-y^2),y,x)); [x = %c*%e^(x*asin(y/x)/abs(x))]; assume(x>0); [x > 0]; ratsimp(ans[1]); x = %c*%e^asin(y/x); map(log,%/%c); log(x/%c) = asin(y/x); solve(%,y); [y = x*sin(log(x/%c))]; /* CHECK ME */ method; genhom; forget(x>0); [x > 0]; /* 199 */ assume(x>0,y>0); [x>0,y>0]; (pn_(199),ans:contrib_ode(eqn:x*'diff(y,x)=y+x*sqrt(x^2+y^2),y,x)); [x-asinh(y/x)=%c]; -(ans[1]-x); asinh(y/x)=x-%c; map(sinh,%); y/x=sinh(x-%c); %*x; y=x*sinh(x-%c); [method,trigsimp(ode_check(eqn,%))]; [lie,0]; forget(x>0,y>0); [x>0,y>0]; /* 200 - Another long "result" from ode1_lie */ /*(pn_(200),ans:contrib_ode(eqn:x*'diff(y,x)=y-x*(x-y)*sqrt(x^2+y^2),y,x));*/ --- NEW FILE: rtestode_murphy_1_3.mac --- /* ODE tests - Murphy equations 1.201 - 1.300 Reference: G M Murphy, Ordinary Differential Equations and Their Solutions, Van Nostrand, 1960 First Order and of First Degree, p 224 ff */ /* Don't kill(all); It messes up trigsimp */ /* Print ode number*/ (pn_(n_):=print("Murphy ODE 1.",n_),true); true; /* 201 */ assume(b>0); [b>0]; (pn_(201),ans:contrib_ode(eqn:x*'diff(y,x)=y+a*sqrt(y^2+b*x^2),y,x)); [x=%c*%e^(x*asinh(y/(sqrt(b)*x))/(a*abs(x)))]; assume(x>0); [x>0]; ratsimp(ans[1]); x = %c*%e^(asinh(y/(sqrt(b)*x))/a); map(log,%/%c); log(x/%c) = asinh(y/(sqrt(b)*x))/a; map(sinh,a*%); sinh(a*log(x/%c)) = y/(sqrt(b)*x); solve(%,y); [y = sqrt(b)*x*sinh(a*log(x/%c))]; [method,trigsimp(ode_check(eqn,%[1]))]; [genhom,0]; forget(b>0,x>0); [b>0,x>0]; /* 240 riccati */ /* 249 */ ans:contrib_ode(eqn:3*x*'diff(y,x)=3*x^(2/3)+(1-3*y)*y,y,x); [y=tanh(3*x^(1/3)+%c)*x^(1/3)]; [method,trigsimp(ode_check(eqn,ans[1]))]; [riccati,0]; /* 266 */ (pn_(266),ans:contrib_ode(eqn:x^2*'diff(y,x)=a+b*x^n+x^2*y^2,y,x)); [[y=-'diff(%u,x,1)/%u,%u*(b*x^(n-2)+a/x^2)+'diff(%u,x,2)=0]]; method; riccati; /* 267 Riccati */ (pn_(267),ans:contrib_ode(eqn:x^2*'diff(y,x)+2+x*y*(4+x*y)=0,y,x)); [x=%c*(x*y+2)/(x*y+1)]; method; genhom; /* 268 */ (pn_(268),ans:contrib_ode(eqn:x^2*'diff(y,x)+2+a*x*(1-x*y)-x^2*y^2=0,y,x)); [[y=-'diff(%u,x,1)/%u,%u*(-a/x-2/x^2)-'diff(%u,x,1)*a+'diff(%u,x,2)=0]]; method; riccati; /* 270 */ (pn_(270),ans:contrib_ode(eqn:x^2*'diff(y,x)=a+b*x^n+c*x^2*y^2,y,x)); [[y=-'diff(%u,x,1)/(%u*c),%u*c^2*(b*x^(n-2)+a/x^2)+'diff(%u,x,2)*c=0]]; method; riccati; /* 271 Riccati */ (pn_(271),assume(4*a*c-b^2-2*b-1>0),ans:contrib_ode(eqn:x^2*'diff(y,x)=a+b*x*y+c*x^2*y^2,y,x),forget(4*a*c-b^2-2*b-1>0),ans); [x=%c*%e^(2*atan((2*c*x*y+b+1)/sqrt(4*a*c-b^2-2*b-1))/sqrt(4*a*c-b^2-2*b-1))]; method; genhom; /* 272 */ (pn_(272),ans:contrib_ode(eqn:x^2*'diff(y,x)=a+b*x*y+c*x^4*y^2,y,x)); [[y=-'diff(%u,x,1)/(%u*c*x^2),%u*a*c^2*x^2+'diff(%u,x,2)*c*x^2-'diff(%u,x,1)*(b*c*x+2*c*x)=0]]; /* 275 - Abel eqn of 1st kind */ (pn_(275),ans:contrib_ode(eqn:x^2*'diff(y,x)=a*x^2*y^2-a*y^3,y,x)); false; /* 276 - Abel eqn of 1st kind */ (pn_(276),ans:contrib_ode(eqn:x^2*'diff(y,x)+a*y^2+b*x^2*y^3=0,y,x)); false; /* 300 Riccati - Lie symmetry method works */ (pn_(300),ans:contrib_ode(eqn:(1-x^2)*'diff(y,x)=1-(2*x-y)*y,y,x)); [-((log(x+1)-log(x-1))*y-x*log(x+1)+x*log(x-1)+2)/(2*y-2*x) = %c]; ans:first(solve(ans[1],y)); y = (x*log(x+1)-x*log(x-1)+2*%c*x-2)/(log(x+1)-log(x-1)+2*%c); [method,ode_check(eqn,ans)]; [lie,0]; --- NEW FILE: rtestode_murphy_1_4.mac --- /* ODE tests - Murphy equations 1.301 - 1.400 Reference: G M Murphy, Ordinary Differential Equations and Their Solutions, Van Nostrand, 1960 First Order and of First Degree, p 224 ff */ /* Don't kill(all); It messes up trigsimp */ /* Print ode number*/ (pn_(n_):=print("Murphy ODE 1.",n_),true); true; /* 301 Riccati */ /* 304 - Abel eqn od 1st kind */ (pn_(304),ans:contrib_ode(eqn:(1+x^2)*'diff(y,x)=1+y^2-2*x*y*(1+y^2),y,x)); false; /* 311 */ (pn_(311),ans:contrib_ode(eqn:(a^2+x^2)*'diff(y,x)=a^2+3*x*y-2*y^2,y,x)); [[y = 'diff(%u,x,1)*(x^2+a^2)/(2*%u),-2*'diff(%u,x,2)/(x^2+a^2)+2*'diff(%u,x,1)*x/(x^2+a^2)^2+4*%u*a^2/(x^2+a^2)^3=0]]; method; riccati; /* 324 Riccati */ /* 329 Riccati */ /* 333 Riccati Solution should simplify to y=x*(%c*x+sin(x))/(%c*x-sin(x)) ? */ (pn_(333),ans:contrib_ode(eqn:2*x^2*'diff(y,x)=2*x*y+(1-x*cot(x))*(x^2-y^2),y,x)); [y=sqrt(4*x^3*cot(x)-4*x^2)*sqrt(-x^3*cot(x)^3+3*x^2*cot(x)^2-3*x*cot(x)+1)*(%c*sin('integrate(sqrt(-x^3*cot(x)^3+3*x^2*cot(x)^2-3*x*cot(x)+1)/sqrt(4*x^3*cot(x)-4*x^2),x))-cos('integrate(sqrt(-x^3*cot(x)^3+3*x^2*cot(x)^2-3*x*cot(x)+1)/sqrt(4*x^3*cot(x)-4*x^2),x)))/((2*x^2*cot(x)^2-4*x*cot(x)+2)*sin('integrate(sqrt(-x^3*cot(x)^3+3*x^2*cot(x)^2-3*x*cot(x)+1)/sqrt(4*x^3*cot(x)-4*x^2),x))+(2*%c*x^2*cot(x)^2-4*%c*x*cot(x)+2*%c)*cos('integrate(sqrt(-x^3*cot(x)^3+3*x^2*cot(x)^2-3*x*cot(x)+1)/sqrt(4*x^3*cot(x)-4*x^2),x)))]; [method,ode_check(eqn,ans[1])]; [riccati,0]; /* 336 Riccati */ (pn_(336),ans:contrib_ode(eqn:x*(1-2*x)*'diff(y,x)=4*x-(1+4*x)*y+y^2,y,x)); [-(x*y-2*x^2)/(y-1) = %c]; ans:first(solve(ans[1],y)); y=(2*x^2+%c)/(x+%c); [exact,ode_check(eqn,ans)]; [exact,0]; /* 337 - check this*/ (pn_(337),ans:contrib_ode(eqn:2*x*(1-x)*'diff(y,x)+x+(1-2*x)*y=0,y,x)); [y=%e^-(log(2*x^2-2*x)/2)*(sqrt(2)*log(2*sqrt(2*x^2-2*x)/sqrt(2)+2*x-1)/4+sqrt(2*x^2-2*x)/2+%c)]; [method,radcan(ode_check(eqn,ans[1]))]; [linear,0]; /* 338 */ (pn_(338),ans:contrib_ode(eqn:2*x*(1-x)*'diff(y,x)+x+(1-2*x)*y^2=0,y,x)); [[y='diff(%u,x,1)*(2*x^2-2*x)/(%u*(2*x-1)),-'diff(%u,x,1)*((2*x-1)*(4*x-2)/(2*x^2-2*x)^2-2/(2*x^2-2*x))-'diff(%u,x,2)*(2*x-1)/(2*x^2-2*x)+%u*(2*x-1)^2/((2*x-2)*(2*x^2-2*x)^2)=0]]; method; riccati; /* 345 - Abel eqn of 1st kind */ (pn_(345),ans:contrib_ode(eqn:(a+b*x)^2*'diff(y,x)+c*y^2+(a+b*x)*y^3=0,y,x)); false; /* 347 */ (pn_(347),ans:contrib_ode(eqn:x^3*'diff(y,x)=3-x^2+x^2*y,y,x)); [y=x*((x^2-1)/x^3+%c)]; [method,ode_check(eqn,ans[1])]; [linear,0]; /* 348 Riccati */ (pn_(348),ans:contrib_ode(eqn:x^3*'diff(y,x)=x^4+y^2,y,x)); [x=%c*%e^-(x^2/(y-x^2))]; ans:first(solve(ans[1],y)); y=(log(%c/x)+1)*x^2/log(%c/x); [method,ode_check(eqn,ans)]; [genhom,0]; /* 352 Riccati */ (pn_(352),ans:contrib_ode(eqn:x^3*'diff(y,x)+20+x^2*y*(1-x^2*y)=0,y,x)); [x=%c*%e^-((log(x^2*y+5)-log(x^2*y-4))/9)]; ans:first(solve((ans[1]/%c)^9,y)); y=-(5*x^9+4*%c^9)/(x^11-%c^9*x^2); [method,ode_check(eqn,ans)]; [genhom,0]; /* 353 Riccati */ (pn_(353),ans:contrib_ode(eqn:x^3*'diff(y,x)+3+(3-2*x)*x^2*y-x^6*y^2=0,y,x)); [y=-(3*%e^(4*x)-%c)/(x^3*%e^(4*x)+%c*x^3)]; [method,ode_check(eqn,ans[1])]; [riccati,0]; /* 366 Riccati */ /* 371 Riccati */ /* 373 */ assume(a>0); [a>0]; ans:contrib_ode(eqn:x^4*'diff(y,x)+a^2+x^4*y^2=0,y,x); [y=(x*tan((%c*x-a)/x)+a)/(x^2*tan((%c*x-a)/x))]; [method,trigsimp(ode_check(eqn,ans[1]))]; [riccati,0]; forget(a>0); [a>0]; /* 377 */ (pn_(377),ans:contrib_ode(eqn:x*(1-x^3)*'diff(y,x)=x^2+(1-2*x*y)*y,y,x)); [[y=-'diff(%u,x,1)*(x^3-1)/(2*%u),-'diff(%u,x,1)*(-2/((x^3-1)*(x^4-x))-6*x^2/(x^3-1)^2)+2*'diff(%u,x,2)/(x^3-1)-4*%u*x/(x^3-1)^3=0]]; method; riccati; /* 380 Riccati */ /* 383 Abel eqn of 1st kind */ (pn_(383),ans:contrib_ode(eqn:x^7*'diff(y,x)+5*x^3*y^2+2*(1+x^2)*y^3=0,y,x)); false; /* 385 Riccati */ (pn_(385),ans:contrib_ode(eqn:x^n*'diff(y,x)=x^(2*n-1)-y^2,y,x)); [[y='diff(%u,x,1)*x^n/%u,-'diff(%u,x,2)/x^n-'diff(%u,x,1)*n*x^(-n-1)+%u*x^(-n-1) = 0]]; method; riccati; /* 387 Riccati */ (pn_(387),ans:contrib_ode(eqn:x^n*'diff(y,x)+x^(2*n-2)+y^2+(1-n)*x^(n-1)*y=0,y,x)); [x=%c*%e^-atan(x^(1-n)*y)]; ans:map(log,ans[1]/%c); log(x/%c)=-atan(x^(1-n)*y); ans:map(tan,ans); tan(log(x/%c))=-x^(1-n)*y; ans:first(solve(ans,y)); y=-x^(n-1)*tan(log(x/%c)); ode_check(eqn,%); (x^(2*n)*tan(log(x/%c))^2-x^(2*n)*sec(log(x/%c))^2+x^(2*n))/x^2; factor(%); x^(2*n-2)*(tan(log(x/%c))^2-sec(log(x/%c))^2+1); trigsimp(%); 0; method; genhom; /* 388 Riccati */ --- NEW FILE: rtestode_murphy_1_5.mac --- /* ODE tests - Murphy equations 1.401 - 1.500 Reference: G M Murphy, Ordinary Differential Equations and Their Solutions, Van Nostrand, 1960 First Order and of First Degree, p 224 ff */ /* Don't kill(all); It messes up trigsimp */ /* Print ode number*/ (pn_(n_):=print("Murphy ODE 1.",n_),true); true; /* 402 - Abel eqn of 1st kind. absolute invariant K: 1/(8*a^2*b) */ (pn_(402),a:1/3,b:-1/6,ans:contrib_ode(eqn:x^(3/2)*'diff(y,x)=a+b*x^(3/2)*y^3,y,x)); [x = %c*%e^((sqrt(x)*(2*y*log(sqrt(x)*y+1)-2*y*log(sqrt(x)*y-2))+2*log(sqrt(x)*y+1)-2*log(sqrt(x)*y-2)-6)/(3*sqrt(x)*y+3))]; /* CHECKME: Get different soln with ode1_abel */ kill(a,b); done; /* 422 - Abel eqn of 2nd kind */ (pn_(422),ans:contrib_ode(eqn:y*'diff(y,x)+x^3+y=0,y,x)); false; --- NEW FILE: rtestode_murphy_1_6.mac --- /* ODE tests - Murphy equations 1.501 - 1.600 Reference: G M Murphy, Ordinary Differential Equations and Their Solutions, Van Nostrand, 1960 First Order and of First Degree, p 224 ff */ /* Don't kill(all); It messes up trigsimp */ /* Print ode number*/ (pn_(n_):=print("Murphy ODE 1.",n_),true); true; /* 593 - Abel eqn of 2nd kind */ (pn_(593),ans:contrib_ode(eqn:x^7*y*'diff(y,x)=2*(1+x^2)+5*x^3*y,y,x)); false; --- NEW FILE: rtestode_murphy_2_1.mac --- /* ODE tests - Murphy equations 2.1 - 2.100 Reference: G M Murphy, Ordinary Differential Equations and Their Solutions, Van Nostrand, 1960, pp 15-23 First Order and Second or Higher Degree, p278 ff */ /* Don't kill(all); It messes up trigsimp */ /* Eliminate parameter t from singular solution */ (elim_(ans,x,y,t):=block([s],s:first(solve(ans[2],t)),s:solve(ev(ans[1],s),y),s[1]),done); done; /* Print ode number*/ (pn_(n_):=print("Murphy ODE 2.",n_),true); true; /* 1 */ assume(not(equal(n,-2))); [not(equal(n, -2))]; (pn_(1),ans:contrib_ode(eqn:'diff(y,x)^2=a*x^n,y,x)); [-((n+2)*y+2*x*sqrt(a*x^n))/(n+2)=%c]; solve(ans[1],y); [y=-(2*x*sqrt(a*x^n)+%c*n+2*%c)/(n+2)]; [method,ode_check(eqn,%[1])]; [lie,0]; forget(not(equal(n,-2))); '[not(equal(n,-2))]; /* 2 */ (pn_(2),ans:contrib_ode(eqn:'diff(y,x)^2=y,y,x)); [4*y-x^2+2*%c*x-%c^2=0]; solve(ans[1],y); [y=(x^2-2*%c*x+%c^2)/4]; [method,ode_check(eqn,%[1])]; [lagrange,0]; /* 3 */ (pn_(3),ans:contrib_ode(eqn:'diff(y,x)^2=x-y,y,x)); [[x=%c-2*(log(%t-1)+%t),y=x-%t^2]]; /* Correct */ method; lagrange; /* 4 Very long "answer" from ode1_lie */ /* (pn_(4),ans:contrib_ode(eqn:'diff(y,x)^2=x^2+y,y,x)); */ /* 5 Very long "answer" from ode1_lie */ /* (pn_(5),ans:contrib_ode(eqn:'diff(y,x)^2+x^2=4*y,y,x)); */ /* 6 Very long "answer" from ode1_lie */ /* (pn_(6),ans:contrib_ode(eqn:'diff(y,x)^2+3*x^2=8*y,y,x)); */ /* 7 ode1_lie takes forever */ /* (pn_(7),ans:contrib_ode(eqn:'diff(y,x)^2+a*x^2+b*y=0,y,x)); */ /* 8 */ /* CHECKME */ (pn_(8),ans:contrib_ode(eqn:'diff(y,x)^2=1+y^2,y,x)); [[x=%c-log(2*sqrt(%t^2-1)+2*%t),y=-sqrt(%t^2-1)],[x=log(2*sqrt(%t^2-1)+2*%t)+%c,y=sqrt(%t^2-1)]]; method; lagrange; /* 9 */ (pn_(9),ans:contrib_ode(eqn:'diff(y,x)^2=1-y^2,y,x)); [[x = asin(%t)+%c,y = -sqrt(1-%t^2)],[x=%c-asin(%t),y=sqrt(1-%t^2)]]; solve(ans[1][1],%t); [%t = sin(x-%c)]; ans:ans[1][2],%; y = -sqrt(1-sin(x-%c)^2); /* y = sin(x+%c) */ [method,trigsimp(ode_check(eqn,ans))]; [lagrange,0]; /* ans[2] has %c -> -%c */ /* Other solutions y=1, y=-1 */ /* 10 */ (pn_(10),ans:contrib_ode(eqn:'diff(y,x)^2=a^2-y^2,y,x)); [[x=asin(%t/abs(a))+%c,y=-sqrt(a^2-%t^2)],[x=%c-asin(%t/abs(a)),y=sqrt(a^2-%t^2)]]; solve(ans[1][1],%t); [%t = abs(a)*sin(x-%c)]; ans:ans[1][2],%; y=-sqrt(a^2-a^2*sin(x-%c)^2); [method,trigsimp(ode_check(eqn,ans))]; [lagrange,0]; /* Solutions in Murphy are y=(a*(1-%c^2)*sin(x)+2*%c*a*cos(x))/(1+%c^2)) y+a*sin(x)=0 y=a, y=-a */ /* 11 */ (pn_(11),ans:contrib_ode(eqn:'diff(y,x)^2=a^2*y^2,y,x)); [y = %c*%e^(a*x),y = %c*%e^-(a*x)]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [factor,0,0]; /* 12 */ assume(a>0,b>0); [a>0,b>0]; (pn_(12),ans:contrib_ode(eqn:'diff(y,x)^2=a+b*y^2,y,x)); [[x=%c-log(2*sqrt(%t^2-a)+2*%t)/sqrt(b),y=-sqrt(%t^2-a)/sqrt(b)],[x=log(2*sqrt(%t^2-a)+2*%t)/sqrt(b)+%c,y=sqrt(%t^2-a)/sqrt(b)]]; /* CHECKME */ method; lagrange; forget(a>0,b>0); [a>0,b>0]; /* 13 */ (pn_(13),ans:contrib_ode(eqn:'diff(y,x)^2=x^2*y^2,y,x)); [y = %c*%e^(x^2/2),y = %c*%e^-(x^2/2)]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [factor,0,0]; /* 14 FIXME: crashes ode1_lagrange */ /* (pn_(14),ans:contrib_ode(eqn:'diff(y,x)^2=(y-1)*y^2,y,x)); */ /* 15 ode1_lagrange takes "forever" */ /* (pn_(15),ans:contrib_ode(eqn:'diff(y,x)^2=(y-a)*(y-b)*(y-c),y,x)); */ /* 16 ode1_lagrange returns a "solution" */ /* (pn_(16),ans:contrib_ode(eqn:'diff(y,x)^2=a^2*y^n,y,x)); */ /* 17 ode1_lie crashes */ /* (pn_(17),ans:contrib_ode(eqn:'diff(y,x)^2=a^2*(1-log(y)^2)*y^2,y,x)); */ /* 18 to 24 are very (too?) general */ /* 25 */ (pn_(25),ans:contrib_ode(eqn:'diff(y,x)^2+2*'diff(y,x)+x=0,y,x)); [-(3*y+sqrt(1-x)*(2*x-2)+3*x)/3 = %c]; solve(ans[1],y); [y = -((2*sqrt(1-x)+3)*x-2*sqrt(1-x)+3*%c)/3]; [method,ode_check(eqn,%)]; [lie,0]; /* 26 */ (pn_(26),ans:contrib_ode(eqn:'diff(y,x)^2-2*'diff(y,x)+a*(x-y)=0,y,x)); [-(4*sqrt(a*y-a*x+1)+2*a*x-4)/(sqrt(2)*sqrt(3)*sqrt(-a)) = %c]; solve(ans[1],sqrt(a*y-a*x+1)); [sqrt(a*y-a*x+1) = -(2*a*x+sqrt(2)*sqrt(3)*%c*sqrt(-a)-4)/4]; %[1]^2; a*y-a*x+1 = (2*a*x+sqrt(2)*sqrt(3)*%c*sqrt(-a)-4)^2/16; solve(%,y); [y = (2*a^2*x^2+2*sqrt(2)*sqrt(3)*%c*sqrt(-a)*a*x-3*%c^2*a-4*sqrt(2)*sqrt(3)*%c*sqrt(-a))/(8*a)]; [method,ode_check(eqn,%[1])]; [lie,0]; /* Murphy gives a*(C+x)^2=4*(C+y), a*y=1+a*x */ /* 27 */ (pn_(27),ans:contrib_ode(eqn:'diff(y,x)^2-2*'diff(y,x)-y^2=0,y,x)); [[x=-log(2*sqrt(%t^2-2*%t)+2*%t-2)+sqrt(%t^2-2*%t)/%t+%c,y=-sqrt(%t^2-2*%t)],[x=log(2*sqrt(%t^2-2*%t)+2*%t-2)-sqrt(%t^2-2*%t)/%t+%c,y=sqrt(%t^2-2*%t)]]; method; /* CHECKME */ lagrange; /* 28 */ (pn_(28),ans:contrib_ode(eqn:'diff(y,x)^2-5*'diff(y,x)+6=0,y,x)); [y=3*x+%c,y=2*x+%c]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [factor,0,0]; /* 29 */ (pn_(29),ans:contrib_ode(eqn:'diff(y,x)^2-7*'diff(y,x)+12=0,y,x)); [y=4*x+%c,y=3*x+%c]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [factor,0,0]; /* 30 */ (pn_(30),ans:contrib_ode(eqn:'diff(y,x)^2+a*'diff(y,x)+b=0,y,x)); [-(2*y+sqrt(a^2-4*b)*x+a*x)/2 = %c]; solve(ans[1],y); [y = -((sqrt(a^2-4*b)+a)*x+2*%c)/2]; [method,ode_check(eqn,%)]; [lie,0]; /* 31 */ (pn_(31),ans:contrib_ode(eqn:'diff(y,x)^2+a*'diff(y,x)+b*x=0,y,x)); [-(12*b*y+sqrt(a^2-4*b*x)*(4*b*x-a^2)+6*a*b*x)/(12*b) = %c]; solve(ans[1],y); [y = -(sqrt(a^2-4*b*x)*(4*b*x-a^2)+6*a*b*x+12*%c*b)/(12*b)]; [method,ode_check(eqn,%)]; [lie,0]; /* 32 */ (pn_(32),ans:contrib_ode(eqn:'diff(y,x)^2+a*'diff(y,x)+b*y=0,y,x)); [[x=%c-(log(%t)*a+2*%t)/b,y = -(%t*a+%t^2)/b]]; /* Correct */ method; lagrange; /* 33 */ (pn_(33),ans:contrib_ode(eqn:'diff(y,x)^2+x*'diff(y,x)+1=0,y,x)); [-(4*y-4*log(2*sqrt(x^2-4)+2*x)+x*sqrt(x^2-4)+x^2)/4=%c]; solve(ans[1],y); [y=(4*log(2*sqrt(x^2-4)+2*x)-x*sqrt(x^2-4)-x^2-4*%c)/4]; [method,ode_check(eqn,%)]; [lie,0]; /* 34 */ (pn_(34),ans:contrib_ode(eqn:'diff(y,x)^2+x*'diff(y,x)-y=0,y,x)); [y=%c*x+%c^2,y=-x^2/4]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [clairault,0,0]; /* 35 */ (pn_(35),ans:contrib_ode(eqn:'diff(y,x)^2-x*'diff(y,x)+y=0,y,x)); [y=%c*x-%c^2,y=x^2/4]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [clairault,0,0]; /* 36 */ (pn_(36),ans:contrib_ode(eqn:'diff(y,x)^2-x*'diff(y,x)-y=0,y,x)); [[x=%e^-(log(%t)/2)*(2*%e^(3*log(%t)/2)/3+%c),y=%t^2-%t*x]]; ans:radcan(%); [[x=(2*%t^(3/2)+3*%c)/(3*sqrt(%t)),y=%t^2-%t*x]]; ans:ans,3*%c=%c; /* change constant */ [[x=(2*%t^(3/2)+%c)/(3*sqrt(%t)),y=%t^2-%t*x]]; ans[1][2]:ans[1][2],ans[1][1]; y=%t^2-sqrt(%t)*(2*%t^(3/2)+%c)/3; expand(3*ans); [[3*x = 2*%t+%c/sqrt(%t),3*y = %t^2-%c*sqrt(%t)]]; /* correct */ method; lagrange; /* 37 */ (pn_(37),ans:contrib_ode(eqn:'diff(y,x)^2+x*'diff(y,x)+x-y=0,y,x)); [[x=%e^-%t*(%c-2*(%t-1)*%e^%t),y = (%t+1)*x+%t^2]]; ans[1][2]:ans[1][2],ans[1][1]; y=(%t+1)*%e^-%t*(%c-2*(%t-1)*%e^%t)+%t^2; expand(ans); [[x=%c*%e^-%t-2*%t+2,y=%c*%t*%e^-%t+%c*%e^-%t-%t^2+2]]; /* correct */ method; lagrange; /* 38 */ (pn_(38),ans:contrib_ode(eqn:'diff(y,x)^2+(1-x)*'diff(y,x)+y=0,y,x)); [y=%c*x-%c-%c^2,y=(x^2-2*x+1)/4]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [clairault,0,0]; /* 39 */ (pn_(39),ans:contrib_ode(eqn:'diff(y,x)^2-(1+x)*'diff(y,x)+y=0,y,x)); [y=%c*x-%c^2+%c,y=(x^2+2*x+1)/4]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [clairault,0,0]; /* 40 */ (pn_(40),ans:contrib_ode(eqn:'diff(y,x)^2-(2-x)*'diff(y,x)+1-y=0,y,x)); [y=%c*x+%c^2-2*%c+1,y=-(x^2-4*x)/4]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [clairault,0,0]; /* 41 */ (pn_(41),ans:contrib_ode(eqn:'diff(y,x)^2+(a+x)*'diff(y,x)-y=0,y,x)); [y=%c*x+%c*a+%c^2,y=-(x^2+2*a*x+a^2)/4]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [clairault,0,0]; /* 42 */ (pn_(42),ans:contrib_ode(eqn:'diff(y,x)^2-2*x*'diff(y,x)+1=0,y,x)); [-(2*y-log(2*sqrt(x^2-1)+2*x)+x*sqrt(x^2-1)-x^2)/2=%c]; solve(ans[1],y); [y=(log(2*sqrt(x^2-1)+2*x)-x*sqrt(x^2-1)+x^2-2*%c)/2]; [method,ode_check(eqn,%)]; [lie,0]; /* 43 */ (pn_(43),ans:contrib_ode(eqn:'diff(y,x)^2+2*x*'diff(y,x)-3*x^2=0,y,x)); [y = x^2/2+%c,y = %c-3*x^2/2]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [factor,0,0]; /* 44 */ (pn_(44),ans:contrib_ode(eqn:'diff(y,x)^2*x*'diff(y,x)-y=0,y,x)); [[x = %c*%e^-(3*log(%t^2-1)/2),y = %t^3*x]]; /* parametric soln */ first(solve(ans[1][1]^2,%t)); %t=-sqrt(x^(2/3)+%c^(2/3))/x^(1/3); ans:ev(ans[1][2],%); y=-(x^(2/3)+%c^(2/3))^(3/2); [method,ode_check(eqn,ans)]; [lagrange,0]; /* 45 */ (pn_(45),ans:contrib_ode(eqn:'diff(y,x)^2+2*x*diff(y,x)-y=0,y,x)); [4*y-x^2+2*%c*x-%c^2=0]; ans:solve(ans[1],y); [y = (x^2-2*%c*x+%c^2)/4]; [method,ode_check(eqn,ans[1])]; [lagrange,0]; /* 46 */ (pn_(46),ans:contrib_ode(eqn:'diff(y,x)^2-2*x*'diff(y,x)+2*y=0,y,x)); [y=(2*%c*x-%c^2)/2,y=x^2/2]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [clairault,0,0]; /* 47 CHECKME */ (pn_(47),ans:contrib_ode(eqn:'diff(y,x)^2+(1+2*x)*diff(y,x)-x*(1-x)=0,y,x)); [-(8*y+asin(2*x-1)+(4*x-2)*sqrt(x-x^2))/8 = %c]; solve(ans[1],y); [y = -(asin(2*x-1)+(4*x-2)*sqrt(x-x^2)+8*%c)/8]; [method,ode_check(eqn,%)]; [lie,-(16*x^4-32*x^3+sqrt(4*x-4*x^2)*sqrt(x-x^2)*(8*x^2-8*x+1)+18*x^2-2*x)/(64*x^4-128*x^3+64*x^2)]; /* 48 */ (pn_(48),ans:contrib_ode(eqn:'diff(y,x)^2+(1-x)*diff(y,x)-2*(x-y)=0,y,x)); [-(2*sqrt(x-y)-sqrt(2)*log(sqrt(2)*sqrt(x-y)+1)-sqrt(2)*x)/sqrt(2)=%c]; method; lie; /* 49 */ (pn_(49),ans:contrib_ode(eqn:'diff(y,x)^2+3*x*'diff(y,x)-y=0,y,x)); [[x = %e^-(3*log(%t)/2)*(%c-2*%e^(5*log(%t)/2)/5),y = 3*%t*x+%t^2]]; /* CHECKME */ method; lagrange; /* 50 */ (pn_(50),ans:contrib_ode(eqn:'diff(y,x)^2-4*(1+x)*'diff(y,x)+4*y=0,y,x)); [y=(4*%c*x-%c^2+4*%c)/4,y=x^2+2*x+1]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [clairault,0,0]; /* 51 */ assume(4*c+a^2>0,b>0); [4*c+a^2 > 0,b > 0]; (pn_(51),ans:contrib_ode(eqn:'diff(y,x)^2+a*x*'diff(y,x)=b+c*x^2,y,x)); [-(sqrt(4*c+a^2)*(4*y+a*x^2)+4*b*asinh(sqrt(4*c+a^2)*x/(2*sqrt(b)))+sqrt(4*c+a^2)*x*sqrt((4*c+a^2)*x^2+4*b))/(4*sqrt(4*c+a^2))=%c]; solve(ans[1],y); [y = -(4*b*asinh(sqrt(4*c+a^2)*x/(2*sqrt(b)))+sqrt(4*c+a^2)*x*sqrt(4*c*x^2+a^2*x^2+4*b)+a*sqrt(4*c+a^2)*x^2+4*%c*sqrt(4*c+a^2))/(4*sqrt(4*c+a^2))]; [method,ode_check(eqn,%[1])]; [lie,0]; forget(4*c+a^2>0,b>0); [4*c+a^2>0,b>0]; /* 52 */ (pn_(52),ans:contrib_ode(eqn:'diff(y,x)^2-a*x*'diff(y,x)+a*y=0,y,x)); [y=(%c*a*x-%c^2)/a,y=a*x^2/4]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [clairault,0,0]; /* 53 ode1_lie takes forever */ /* (pn_(53),ans:contrib_ode(eqn:'diff(y,x)^2+a*x*'diff(y,x)+b*x^2+c*y=0,y,x));*/ /* 54 */ (pn_(54),ans:contrib_ode(eqn:'diff(y,x)^2+(a+b*x)*'diff(y,x)+c=b*y,y,x)); [y=(%c*b*x+c+%c*a+%c^2)/b,y=-(b^2*x^2+2*a*b*x-4*c+a^2)/(4*b)]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [clairault,0,0]; /* 55 ode1_lie takes forever */ /*(pn_(55),ans:contrib_ode(eqn:'diff(y,x)^2-2*x^2*'diff(y,x)+2*x*y=0,y,x));*/ /* 56 ode1_lie takes forever */ /*(pn_(56),ans:contrib_ode(eqn:'diff(y,x)^2-a*x^2*'diff(y,x)+b*x*y=0,y,x));*/ /* 57 */ (pn_(57),ans:contrib_ode(eqn:'diff(y,x)^2-a*x^3*'diff(y,x)+2*a*x^2*y=0,y,x)); [-(sqrt(a)*sqrt(a^2*x^4-8*a*y)-a^(3/2)*x^2)/(sqrt(3)*a) = %c]; solve(ans[1],sqrt(a^2*x^4-8*a*y)); [sqrt(a^2*x^4-8*a*y) = (a^(3/2)*x^2-sqrt(3)*%c*a)/sqrt(a)]; %[1]^2; a^2*x^4-8*a*y = (a^(3/2)*x^2-sqrt(3)*%c*a)^2/a; ans:solve(%,y); [y=(2*sqrt(3)*%c*a^(5/2)*x^2-3*%c^2*a^2)/(8*a^2)]; [method,ode_check(eqn,ans[1])]; [lie,0]; /* 58 ode1_lie takes forever */ /* (pn_(58),ans:contrib_ode(eqn:'diff(y,x)^2-a*x^3*'diff(y,x)+4*a*x^2*y=0,y,x));*/ /* 59 */ (pn_(59),ans:contrib_ode(eqn:'diff(y,x)^2+4*x^5*'diff(y,x)-12*x^4*y=0,y,x)); [(4*%i*sqrt(3*y+x^6)+4*%i*x^3)/(3*sqrt(2)) = %c]; ans[1]/%i,%c=%i*%c; -%i*(4*%i*sqrt(3*y+x^6)+4*%i*x^3)/(3*sqrt(2)) = %c; expand(%); 4*sqrt(3*y+x^6)/(3*sqrt(2))+4*x^3/(3*sqrt(2)) = %c; solve(%,sqrt(3*y+x^6)); [sqrt(3*y+x^6) = -(4*x^3-3*sqrt(2)*%c)/4]; %[1]^2; 3*y+x^6 = (4*x^3-3*sqrt(2)*%c)^2/16; ans:solve(%,y); [y = -(4*sqrt(2)*%c*x^3-3*%c^2)/8]; [method,ode_check(eqn,ans[1])]; [lie,0]; /* 60 */ (pn_(60),ans:contrib_ode(eqn:'diff(y,x)^2+2*'diff(y,x)*cosh(x)+1=0,y,x)); [-%e^-x*(2*%e^x*y+2*%e^x*sinh(x)+%e^(2*x)+1)/2 = %c]; solve(ans[1],y); [y = -%e^-x*(2*%e^x*sinh(x)+%e^(2*x)+2*%c*%e^x+1)/2]; expand(ev(%[1],sinh(x)=1/2*(exp(x)-exp(-x)))); y=-%e^x-%c; ode_check(eqn,%); -2*%e^x*cosh(x)+%e^(2*x)+1; expand(ev(%,cosh(x)=1/2*(exp(x)+exp(-x)))); 0; method; lie; /* 61 */ (pn_(61),ans:contrib_ode(eqn:'diff(y,x)^2+y*'diff(y,x)=x*(x+y),y,x)); [y = x^2/2+%c,y = %e^-x*(%c-(x-1)*%e^x)]; [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])]; [factor,0,0]; /* 62 */ (pn_(62),ans:contrib_ode(eqn:'diff(y,x)^2-y*'diff(y,x)+exp(x)=0,y,x)); [2*log(sqrt(y^2-4*%e^x)+y)=%c]; map(ex... [truncated message content] |