1 (load("contrib_ode"),0);
4 /* ODE tests - Equations 1.501-1.576
7 E Kamke, Differentialgleichungen Losungsmethoden und Losungen,
8 Vol 1, Geest & Portig, Leipzig, 1961
10 E. S. Cheb-Terrab, T. Koloknikov, First Order ODEs,
11 Symmetries and Linear Transformations, European Journal of
12 Applied Mathematics, Vol. 14, No. 2, pp. 231-246 (2003).
13 (http://lie.uwaterloo.ca/papers/ode_iv.pdf)
15 /* Don't kill(all); It messes up trigsimp */
18 (pn_(n_):=print("Kamke ODE 1.",n_),true);
22 /* This equation presents a problem - runs forever */
23 /* (pn_( 501 ),ans:contrib_ode(eqn: (a*y^2+b*x+c)*('diff(y,x,1))^2-b*y*'diff(y,x,1)+d*y^2 ,y,x)); */
26 /* This equation presents a problem - runs forever */
27 /* (pn_( 502 ),ans:contrib_ode(eqn: (a*y-b*x)^2*(a^2*('diff(y,x,1))^2+b^2)-c^2*(a*'diff(y,x,1)+b)^2 ,y,x)); */
30 /* This equation too general - E S Cheb-Terrab and T Kolokolnikov */
31 /* (pn_( 503 ),ans:contrib_ode(eqn: (b2*y+a2*x+c2)^2*('diff(y,x,1))^2+(b1*y+a1*x+c1)*'diff(y,x,1)+b0*y+c0+a0 ,y,x)); */
34 /* This equation presents a problem - runs forever */
35 /* (pn_( 504 ),ans:contrib_ode(eqn: x*y^2*('diff(y,x,1))^2-(y^3+x^3-a)*'diff(y,x,1)+x^2*y ,y,x)); */
38 (pn_(505),ans:contrib_ode(eqn:x*y^2*('diff(y,x,1))^2-2*y^3*'diff(y,x,1)+2*x*y^2-x^3,y,x));
39 [y^2/2=x^2/2+%c,-((y^2-x^2)/(2*x^4))=%c];
40 [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])];
44 /* This equation presents a problem - runs forever */
45 /* (pn_( 506 ),ans:contrib_ode(eqn: x^2*(x*y^2-1)*('diff(y,x,1))^2+2*x^2*y^2*(y-x)*'diff(y,x,1)-y^2*(x^2*y-1) ,y,x)); */
48 /* This equation presents a problem - runs forever */
49 /* (pn_( 507 ),ans:contrib_ode(eqn: (y^4-a^2*x^2)*('diff(y,x,1))^2+2*a^2*x*y*'diff(y,x,1)+y^2*(y^2-a^2) ,y,x)); */
52 /* This equation presents a problem - runs forever */
53 /* (pn_( 508 ),ans:contrib_ode(eqn: (y^4+x^2*y^2-x^2)*('diff(y,x,1))^2+2*x*y*'diff(y,x,1)-y^2 ,y,x)); */
56 (pn_(509),ans:contrib_ode(eqn:9*(x^2-1)*y^4*('diff(y,x,1))^2-6*x*y^5*'diff(y,x,1)-4*x^2,y,x));
57 [log(sqrt(y^6+4*x^2-4)+y^3)=%c];
58 [method,ode_check(eqn,ans[1])];
62 /* This equation presents a problem - runs forever */
63 /* (pn_( 510 ),ans:contrib_ode(eqn: x^2*(x^2*y^4-1)*('diff(y,x,1))^2+2*x^3*y^3*(y^2-x^2)*'diff(y,x,1)-y^2*(x^4*y^2-1) ,y,x)); */
66 /* This equation presents a problem - runs forever */
67 /* (pn_( 511 ),ans:contrib_ode(eqn: (a^2*sqrt(y^2+x^2)-x^2)*('diff(y,x,1))^2+2*x*y*'diff(y,x,1)+a^2*sqrt(y^2+x^2)-y^2 ,y,x)); */
70 /* This equation presents a problem - runs forever */
71 /* (pn_( 512 ),ans:contrib_ode(eqn: (a*(y^2+x^2)^(3/2)-x^2)*('diff(y,x,1))^2+2*x*y*'diff(y,x,1)+a*(y^2+x^2)^(3/2)-y^2 ,y,x)); */
74 /* This equation presents a problem - runs forever */
75 /* (pn_( 513 ),ans:contrib_ode(eqn: sin(y)*('diff(y,x,1))^2+2*x*cos(y)^3*'diff(y,x,1)-cos(y)^4*sin(y) ,y,x)); */
78 (pn_(514),ans:contrib_ode(eqn:(a*cos(y)+b)*('diff(y,x,1))^2-c*cos(y)+d,y,x));
79 [[x=(-2*a*d-2*b*c)*'integrate(1/(sqrt(c^2-2*%t^2*a*c+%t^4*a^2)*sqrt(-d^2+%t^2*(-2*b*d-2*a*c)+c^2+%t^4*(a^2-b^2))),%t)+%c,y=%pi-acos(d/(%t^2*a-c)+%t^2*b/(%t^2*a-c))]];
80 [method,ode_check(eqn,ans[1])];
84 /* This equation presents a problem - runs forever */
85 /* (pn_( 515 ),ans:contrib_ode(eqn: (('diff(y,x,1))^2+1)*f(y^2+x^2)-(x*'diff(y,x,1)-y)^2 ,y,x)); */
88 /* This equation presents a problem - runs forever */
89 /* (pn_( 516 ),ans:contrib_ode(eqn: (y^2+x^2)*(('diff(y,x,1))^2+1)*f(x/sqrt(y^2+x^2))-(x*'diff(y,x,1)-y)^2 ,y,x)); */
92 /* This equation presents a problem - runs forever */
93 /* (pn_( 517 ),ans:contrib_ode(eqn: (y^2+x^2)*(('diff(y,x,1))^2+1)*f(y/sqrt(y^2+x^2))-(x*'diff(y,x,1)-y)^2 ,y,x)); */
96 (pn_(518),ans:contrib_ode(eqn:('diff(y,x,1))^3-(y-a)^2*(y-b)^2,y,x),0);
98 /* Expected answer is a mess that changes. Don't try to track it
99 [[x=3*('integrate(1/(sqrt(%t)*sqrt(b^2-2*a*b+a^2-4*%t^(3/2))),%t))/2+%c,y=(b+a)/2-sqrt(b^2-2*a*b+a^2-4*%t^(3/2))/2],[x=%c-3*('integrate(1/(sqrt(%t)*sqrt(b^2-2*a*b+a^2-4*%t^(3/2))),%t))/2,y=sqrt(b^2-2*a*b+a^2-4*%t^(3/2))/2+(b+a)/2],[x=%c-3*('integrate(1/(sqrt(%t)*sqrt(b^2-2*a*b+a^2+4*%t^(3/2))),%t))/2,y=(b+a)/2-sqrt(b^2-2*a*b+a^2+4*%t^(3/2))/2],[x=3*('integrate(1/(sqrt(%t)*sqrt(b^2-2*a*b+a^2+4*%t^(3/2))),%t))/2+%c,y=sqrt(b^2-2*a*b+a^2+4*%t^(3/2))/2+(b+a)/2]]; */
100 [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2]),ode_check(eqn,ans[3])];
104 /* This equation presents a problem - crashes ode_contrib */
105 /* (pn_( 519 ),ans:contrib_ode(eqn: ('diff(y,x,1))^3-f(x)*(a*y^2+b*y+c)^2 ,y,x)); */
108 (pn_( 520 ),ans:contrib_ode(eqn: ('diff(y,x,1))^3+'diff(y,x,1)-y ,y,x));
109 [[x = log(%t)+3*%t^2/2+%c,y = %t^3+%t]];
110 [method,ode_check(eqn,ans[1])];
114 (pn_(521),ans:contrib_ode(eqn:('diff(y,x,1))^3+x*'diff(y,x,1)-y,y,x));
115 [y=%c*x+%c^3,y=-2*sqrt(-x)*x/(3*sqrt(3)),y=2*sqrt(-x)*x/(3*sqrt(3))];
116 [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2]),ode_check(eqn,ans[3])];
120 (pn_(522),ans:contrib_ode(eqn:('diff(y,x,1))^3-(x+5)*'diff(y,x,1)+y,y,x));
121 [y=%c*x-%c^3+5*%c,y=-2*(x+5)^(3/2)/(3*sqrt(3)),y=2*(x+5)^(3/2)/(3*sqrt(3))];
122 [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2]),ode_check(eqn,ans[3])];
126 /* This equation presents a problem - crashes ode_contrib */
127 /* (pn_( 523 ),ans:contrib_ode(eqn: ('diff(y,x,1))^3-a*x*'diff(y,x,1)+x^3 ,y,x)); */
130 (pn_(524),ans:contrib_ode(eqn:('diff(y,x,1))^3-2*y*'diff(y,x,1)+y^2,y,x));
131 [[x=-3*sqrt(1-%t)+2*log(sqrt(1-%t)+1)+%c,y=%t-sqrt(1-%t)*%t],[x=3*sqrt(1-%t)+2*log(sqrt(1-%t)-1)+%c,y=sqrt(1-%t)*%t+%t]];
136 /* This equation presents a problem - runs forever */
137 /* (pn_( 525 ),ans:contrib_ode(eqn: ('diff(y,x,1))^2-a*x*y*'diff(y,x,1)+2*a*y^2 ,y,x)); */
140 (pn_(526),ans:contrib_ode(eqn:('diff(y,x,1))^3-(y^2+x*y+x^2)*('diff(y,x,1))^2+(x*y^3+x^2*y^2+x^3*y)*'diff(y,x,1)-x^3*y^3,y,x));
141 [y=x^3/3+%c,y=%c*%e^(x^2/2),-1/y=x+%c];
142 [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2]),ode_check(eqn,ans[3])];
146 /* This equation presents a problem - crashes ode_contrib */
147 /* (pn_( 527 ),ans:contrib_ode(eqn: ('diff(y,x,1))^3-x*y^4*'diff(y,x,1)-y^5 ,y,x)); */
150 /* This equation presents a problem - crashes ode_contrib */
151 /* (pn_( 528 ),ans:contrib_ode(eqn: ('diff(y,x,1))^3+a*('diff(y,x,1))^2+b*y+a*b*x ,y,x)); */
154 (pn_(529),ans:contrib_ode(eqn:('diff(y,x,1))^3+x*('diff(y,x,1))^2-y ,y,x));
155 [-8*y^3-(4*x^2-12*x-24*%c-27)*y^2
156 -(-8*x^3+(-8*%c-12)*x^2-12*%c*x+24*%c^2)*y-4*x^4-(8-8*%c)*x^3
157 -(4*%c^2-24*%c)*x^2-24*%c^2*x+8*%c^3
163 (pn_(530),ans:contrib_ode(eqn:('diff(y,x,1))^3-y*('diff(y,x,1))^2+y^2,y,x));
164 [[x=log(2*sqrt(%t^2-4*%t)+2*%t-4)-sqrt(%t^2-4*%t)+%t+%c,y=-((%t*sqrt(%t^2-4*%t)-%t^2)/2)],[x=-log(2*sqrt(%t^2-4*%t)+2*%t-4)+sqrt(%t^2-4*%t)+%t+%c,y=(%t*sqrt(%t^2-4*%t)+%t^2)/2]];
165 [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])];
169 (pn_(531),ans:contrib_ode(eqn:('diff(y,x,1))^3-(y^4+x*y^2+x^2)*('diff(y,x,1))^2+(x*y^6+x^2*y^4+x^3*y^2)*'diff(y,x,1)-x^3*y^6,y,x));
170 [y=x^3/3+%c,-1/y=x^2/2+%c,-1/(3*y^3)=x+%c];
171 [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2]),ode_check(eqn,ans[3])];
175 (pn_(532),ans:contrib_ode(eqn:a*('diff(y,x,1))^3+b*('diff(y,x,1))^2+c*'diff(y,x,1)-y-d,y,x));
176 [[x=log(%t)*c+(4*%t*b+3*%t^2*a)/2+%c,y=-d+%t*c+%t^2*b+%t^3*a]];
177 [method,ode_check(eqn,ans[1])];
181 (pn_(533),ans:contrib_ode(eqn:x*('diff(y,x,1))^3-y*('diff(y,x,1))^2+a,y,x));
182 [y=(%c^3*x+a)/%c^2,y=(3*sqrt(3)*%i-3)*a^(1/3)*x^(2/3)/(2*4^(1/3)),y=-((3*sqrt(3)*%i+3)*a^(1/3)*x^(2/3)/(2*4^(1/3))),y=3*a^(1/3)*x^(2/3)/4^(1/3)];
183 [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2]),ode_check(eqn,ans[3]),ode_check(eqn,ans[4])];
187 (pn_(534),ans:contrib_ode(eqn:4*x*('diff(y,x,1))^3-6*y*('diff(y,x,1))^2+3*y-x,y,x));
188 [-8*x^2*(9*%c*y^2+6*%c^2*y-2*x^3-6*%c*x^2-6*%c^2*x-%c^3)=0];
193 (pn_(535),ans:contrib_ode(eqn:8*x*('diff(y,x,1))^3-12*y*('diff(y,x,1))^2+9*y,y,x));
194 [-64*x^2*(9*%c*y^2-x^3-9*%c*x^2-27*%c^2*x-27*%c^3)=0];
199 (pn_(536),ans:contrib_ode(eqn:(x^2-a^2)*('diff(y,x,1))^3+b*x*(x^2-a^2)*('diff(y,x,1))^2+'diff(y,x,1)+b*x,y,x));
200 [-((2*y+b*x^2)/2)=%c];
201 [method,ode_check(eqn,ans[1])];
205 /* This equation presents a problem - crashes ode_contrib */
206 /* (pn_( 537 ),ans:contrib_ode(eqn: x^3*('diff(y,x,1))^3-3*x^2*y*('diff(y,x,1))^2+(3*x*y^2+x^6)*'diff(y,x,1)-y^3-2*x^5*y ,y,x)); */
209 /* This equation presents a problem - crashes ode_contrib */
210 /* (pn_( 538 ),ans:contrib_ode(eqn: 2*(x*'diff(y,x,1)+y)^3-y*'diff(y,x,1) ,y,x)); */
213 (pn_(539),ans:contrib_ode(eqn:sin(x)*('diff(y,x,1))^3-(sin(x)*y-cos(x)^2)*('diff(y,x,1))^2+(-cos(x)^2*y-sin(x))*'diff(y,x,1)+sin(x)*y,y,x));
214 [[x=log(%t)+%c,y=%t]];
215 ans[1][2],solve(ans[1][1],%t);
217 [method,ode_check(eqn,%)];
221 (pn_(540),ans:contrib_ode(eqn:2*y*('diff(y,x,1))^3-y*('diff(y,x,1))^2+2*x*'diff(y,x,1)-x,y,x));
222 [[x=%c*%e^(2*(-log(%t^2-%t+1)/3-log(%t+1)/3+log(%t))),y=-x/%t^2]];
223 [method,ode_check(eqn,ans[1])];
227 /* This equation presents a problem - crashes ode_contrib */
228 /* (pn_( 541 ),ans:contrib_ode(eqn: y^2*('diff(y,x,1))^3+2*x*'diff(y,x,1)-y ,y,x)); */
231 /* This equation presents a problem - crashes ode_contrib */
232 /* (pn_( 542 ),ans:contrib_ode(eqn: 16*y^2*('diff(y,x,1))^3+2*x*'diff(y,x,1)-y ,y,x)); */
235 /* This equation presents a problem - crashes ode_contrib */
236 /* (pn_( 543 ),ans:contrib_ode(eqn: x*y^2*('diff(y,x,1))^3-y^3*('diff(y,x,1))^2+x*(x^2+1)*'diff(y,x,1)-x^2*y ,y,x)); */
239 /* This equation presents a problem - crashes ode_contrib */
240 /* (pn_( 544 ),ans:contrib_ode(eqn: x^7*y^2*('diff(y,x,1))^3-(3*x^6*y^3-1)*('diff(y,x,1))^2+3*x^5*y^4*'diff(y,x,1)-x^4*y^5 ,y,x)); */
243 /* This equation presents a problem - crashes ode_contrib */
244 /* (pn_( 545 ),ans:contrib_ode(eqn: ('diff(y,x,1))^4-(y-a)^3*(y-b)^2 ,y,x)); */
247 /* This equation presents a problem - crashes ode_contrib */
248 /* (pn_( 546 ),ans:contrib_ode(eqn: ('diff(y,x,1))^4+3*(x-1)*('diff(y,x,1))^2-3*(2*y-1)*'diff(y,x,1)+3*x ,y,x)); */
251 /* This equation presents a problem - runs forever */
252 /* (pn_( 547 ),ans:contrib_ode(eqn: ('diff(y,x,1))^4-4*y*(x*'diff(y,x,1)-2*y)^2 ,y,x)); */
255 /* This equation presents a problem - crashes ode_contrib */
256 /* (pn_( 548 ),ans:contrib_ode(eqn: ('diff(y,x,1))^6-(y-a)^4*(y-b)^3 ,y,x)); */
259 (pn_(549),ans:contrib_ode(eqn:x^2*(('diff(y,x,1))^2+1)^3-a^2,y,x));
260 [(a^(2/3)-x^(2/3))^(3/2)-y=%c];
261 [method,ode_check(eqn,ans[1])];
265 /* This equation presents a problem - asks question */
266 /* (pn_( 550 ),ans:contrib_ode(eqn: ('diff(y,x,1))^r-a*y^s-b*x^(r*s/(r-s)) ,y,x)); */
269 /* This equation presents a problem - crashes ode_contrib */
270 /* (pn_( 551 ),ans:contrib_ode(eqn: ('diff(y,x,1))^n-f(x)^n*(y-a)^(n+1)*(y-b)^(n-1) ,y,x)); */
273 /* This equation presents a problem - crashes ode_contrib */
274 /* (pn_( 552 ),ans:contrib_ode(eqn: ('diff(y,x,1))^n-f(x)*g(y) ,y,x)); */
279 (pn_(553),ans:contrib_ode(eqn:b*('diff(y,x,1))^n+a*('diff(y,x,1))^m-y,y,x));
280 [[x=%t^(n-1)*b*n/(n-1)+%t^(m-1)*a*m/(m-1)+%c,y=%t^n*b+%t^m*a]];
281 [method,ode_check(eqn,ans[1])];
287 (pn_(554),ans:contrib_ode(eqn:x^(n-1)*('diff(y,x,1))^n-n*x*'diff(y,x,1)+y,y,x));
291 (pn_(555),ans:contrib_ode(eqn:sqrt(('diff(y,x,1))^2+1)+x*'diff(y,x,1)-y,y,x));
292 [y=%c*x+sqrt(%c^2+1),[-y+%t*x+sqrt(%t^2+1)=0,(sqrt(%t^2+1)*x+%t)/sqrt(%t^2+1)=0]];
293 [method,ode_check(eqn,ans[1]),ode_check(eqn,ans[2])];
297 (pn_(556),ans:contrib_ode(eqn:sqrt(('diff(y,x,1))^2+1)+x*('diff(y,x,1))^2+y,y,x));
298 [[x=(-asinh(%t)-sqrt(%t^2+1)+%c)/(%t+1)^2,y=-%t^2*x-sqrt(%t^2+1)]];
299 [method,ode_check(eqn,ans[1])];
303 (pn_(557),ans:contrib_ode(eqn:x*(sqrt(('diff(y,x,1))^2+1)+'diff(y,x,1))-y,y,x));
304 [[x=%c*%e^(-log(%t^2+1)/2-asinh(%t)),y=(sqrt(%t^2+1)+%t)*x]];
305 [method,radcan(ode_check(eqn,ans[1]))];
309 (pn_(558),ans:contrib_ode(eqn:a*x*sqrt(('diff(y,x,1))^2+1)+x*'diff(y,x,1)-y,y,x));
310 [[x=%c*%e^(-'integrate(sqrt(%t^2+1)/(%t^2*a+a),%t)-log(%t^2+1)/2),
311 y=(sqrt(%t^2+1)*a+%t)*x]];
312 [method,radcan(ode_check(eqn,ans[1]))];
316 /* This equation presents a problem - runs forever */
317 /* (pn_( 559 ),ans:contrib_ode(eqn: y*sqrt(('diff(y,x,1))^2+1)-a*y*'diff(y,x,1)-a*x ,y,x)); */
320 (pn_(560),ans:contrib_ode(eqn:a*y*sqrt(('diff(y,x,1))^2+1)-2*x*y*'diff(y,x,1)+y^2-x^2,y,x));
324 (pn_(561),ans:contrib_ode(eqn:sqrt(('diff(y,x,1))^2+1)*f(y^2+x^2)-x*'diff(y,x,1)+y,y,x));
328 (pn_(562),ans:contrib_ode(eqn:a*(('diff(y,x,1))^3+1)^(1/3)+b*x*'diff(y,x,1)-y,y,x));
329 [[x=%e^-(log(%t)*b/(b-1))*(%c-a*('integrate(%t*%e^(log(%t)*b/(b-1))/(%t^3+1)^(2/3),%t))/(b-1)),y=%t*b*x+(%t^3+1)^(1/3)*a]];
330 [method,ode_check(eqn,ans[1])];
334 (pn_(563),ans:contrib_ode(eqn:log('diff(y,x,1))+x*'diff(y,x,1)+a*y+b,y,x));
337 /* 564 Check second solution */
338 (pn_(564),ans:contrib_ode(eqn:log('diff(y,x,1))+a*(x*'diff(y,x,1)-y),y,x));
339 [y=(%c*a*x+log(%c))/a,[a*(%t*x-y)+log(%t)=0,(%t*a*x+1)/%t=0]];
340 [method,ode_check(eqn,ans[1])];
344 (pn_(565),ans:contrib_ode(eqn:y*log('diff(y,x,1))+'diff(y,x,1)-y*log(y)-x*y,y,x));
348 (pn_(566),ans:contrib_ode(eqn:sin('diff(y,x,1))+'diff(y,x,1)-x,y,x));
352 (pn_(567),ans:contrib_ode(eqn:a*cos('diff(y,x,1))+b*'diff(y,x,1)+x,y,x));
356 (pn_(568),ans:contrib_ode(eqn:('diff(y,x,1))^2*sin('diff(y,x,1))-y,y,x));
357 [[x=%t*sin(%t)-cos(%t)+%c,y=%t^2*sin(%t)]];
358 [method,ode_check(eqn,ans[1])];
362 (pn_(569),ans:contrib_ode(eqn:(('diff(y,x,1))^2+1)*sin(x*'diff(y,x,1)-y)^2-1,y,x));
363 [y=%c*x+asin(1/sqrt(%c^2+1)),[(%t^2+1)*sin(y-%t*x)^2-1=0,2*%t*sin(y-%t*x)^2-(2*%t^2*x+2*x)*cos(y-%t*x)*sin(y-%t*x)=0]];
368 (pn_(570),ans:contrib_ode(eqn:(('diff(y,x,1))^2+1)*(arctan('diff(y,x,1))+a*x)+'diff(y,x,1),y,x));
372 (pn_(571),ans:contrib_ode(eqn:a*x^n*f('diff(y,x,1))+x*'diff(y,x,1)-y,y,x));
376 (pn_(572),ans:contrib_ode(eqn:x*h('diff(y,x,1))+y*g('diff(y,x,1))+(x*'diff(y,x,1)-y)^n*f('diff(y,x,1)),y,x));
380 (pn_(573),ans:contrib_ode(eqn:f(x*('diff(y,x,1))^2)+2*x*'diff(y,x,1)-y,y,x));
384 (pn_(574),ans:contrib_ode(eqn:f(x-3*('diff(y,x,1))^2/2)+('diff(y,x,1))^3-y,y,x));
388 (pn_(575),ans:contrib_ode(eqn:'diff(y,x,1)*f(x*y*'diff(y,x,1)-y^2)-x^2*'diff(y,x,1)+x*y,y,x));
392 /* This equation too general - E S Cheb-Terrab and T Kolokolnikov */
393 /* (pn_( 576 ),ans:contrib_ode(eqn: phi(f(x,y,'diff(y,x,1)),g(x,y,'diff(y,x,1))) ,y,x)); */