1 (load("contrib_ode"),0);
4 /* ODE tests - Equations 101-200
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 (pn_(101),ans:contrib_ode(eqn:x*'diff(y,x)+x*y^2-y,y,x));
23 [(x^2*y-2*x)/(2*y)=%c];
26 [method,ode_check(eqn,%[1])];
29 /* 102 - FIXME: Why the complex solution? */
32 (pn_(102),ans:contrib_ode(eqn:x*'diff(y,x)+x*y^2-y-a*x^3,y,x));
33 [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))];
34 [method,ode_check(eqn,ans[1])];
39 /* 103 - FIXME: Why the complex solution? */
40 (pn_(103),ans:contrib_ode(eqn:x*'diff(y,x)+x*y^2-(2*x^2+1)*y-x^3,y,x));
41 [y=((sqrt(2)*%c+%i)*x*sinh(sqrt(2)*x^2/2)+(%c+sqrt(2)*%i)*x*cosh(sqrt(2)*x^2/2))/(%i*sinh(sqrt(2)*x^2/2)+%c*cosh(sqrt(2)*x^2/2))];
42 [method,ode_check(eqn,ans[1])];
46 (pn_(104),ans:contrib_ode(eqn: x*'diff(y,x)+a*x*y^2+2*y+b*x,y,x));
47 [y = (x*(%c*sqrt(a)*sqrt(-b)*%e^(2*sqrt(a)*sqrt(-b)*x)
49 -%c*%e^(2*sqrt(a)*sqrt(-b)*x)-1)
50 /(a*x*(%c*%e^(2*sqrt(a)*sqrt(-b)*x)+1))];
51 [method,ode_check(eqn,ans[1])];
55 (pn_(105),ans:contrib_ode(eqn:x*'diff(y,x)+a*x*y^2+b*y+c*x+d,y,x));
56 [y = (sqrt(a)*sqrt(-c)
57 *(%c*kummer_u(-((sqrt(a)*sqrt(-c)*d-b*c)/(2*c)),b,
58 -2*sqrt(a)*sqrt(-c)*x)
60 *dkummer_u(-((sqrt(a)*sqrt(-c)*d-b*c)/(2*c)),b,
61 -2*sqrt(a)*sqrt(-c)*x))
63 *kummer_m(-((sqrt(a)*sqrt(-c)*d-b*c)/(2*c)),b,
64 -2*sqrt(a)*sqrt(-c)*x)
66 *dkummer_m(-((sqrt(a)*sqrt(-c)*d-b*c)/(2*c)),b,
67 -2*sqrt(a)*sqrt(-c)*x))
68 /(a*(%c*kummer_u(-((sqrt(a)*sqrt(-c)*d-b*c)/(2*c)),b,
69 -2*sqrt(a)*sqrt(-c)*x)
70 +kummer_m(-((sqrt(a)*sqrt(-c)*d-b*c)/(2*c)),b,
71 -2*sqrt(a)*sqrt(-c)*x)))];
72 [method,ode_check(eqn,ans[1])];
76 assume(not(equal(b+a,0)));
78 (pn_("106a"),ans:contrib_ode(eqn:x*'diff(y,x)+x^a*y^2+(a-b)*y/2+x^b,y,x));
79 [y=-((%c*x^(b/2+a/2)*sin(2*x^(b/2+a/2)/(b+a))-x^(b/2+a/2)*cos(2*x^(b/2+a/2)/(b+a)))/(x^a*sin(2*x^(b/2+a/2)/(b+a))+%c*x^a*cos(2*x^(b/2+a/2)/(b+a))))];
80 [method,ode_check(eqn,ans[1])];
82 forget(notequal(b + a,0));
85 assume(equal(a+b,0),x>0);
86 [equal(b + a, 0),x>0];
87 (pn_("106b"),ans:contrib_ode(eqn:x*'diff(y,x)+x^a*y^2+(a-b)*y/2+x^b,y,x));
88 [y = -((%c*sin(log(x))-cos(log(x)))/(x^a*sin(log(x))+%c*x^a*cos(log(x))))];
89 [method,subst(-a,b,ode_check(eqn,ans[1]))]; /* Need to use a+b=0 */
91 forget(equal(a+b,0),x>0);
92 [equal(b + a, 0),x>0];
95 (pn_(107),ans:contrib_ode(eqn:x*'diff(y,x)+a*x^alpha*y^2+b*y-c*x^beta,y,x));
96 [[y = 'diff(%u,x,1)*x^(1-alpha)/(%u*a),%u*a^2*c*x^(beta+2*(alpha-1)-1)-'diff(%u,x,2)*a*x^(alpha-1)-'diff(%u,x,1)*(a*b*x^(alpha-2)-a*(alpha-1)*x^(alpha-2))=0]];
101 (pn_(108),ans:contrib_ode(eqn:x*'diff(y,x)-y^2*log(x)+y,y,x));
102 [y=1/(x*(log(x)/x+1/x+%c))];
103 [method,ode_check(eqn,ans[1])];
107 (pn_(109),ans:contrib_ode(eqn:x*'diff(y,x)-y*(2*y*log(x)-1),y,x));
108 [y=1/(x*(%c-2*(-log(x)/x-1/x)))];
109 [method,ode_check(eqn,ans[1])];
112 /* 110 Why the complex solution? */
113 (pn_(110),ans:contrib_ode(eqn:x*'diff(y,x)+ f(x)*(y^2-x^2)-y,y,x));
114 [y=(%c*x*sinh('integrate(f(x),x))+%i*x*cosh('integrate(f(x),x)))/(%i*sinh('integrate(f(x),x))+%c*cosh('integrate(f(x),x)))];
115 [method,ode_check(eqn,ans[1])];
119 (pn_(111),ans:contrib_ode(eqn: x*'diff(y,x) + y^3 + 3*x*y^2,y,x));
123 (pn_(112),ans:contrib_ode(eqn:x*'diff(y,x)-sqrt(y^2+x^2)-y,y,x));
124 [x = %c*%e^(x*asinh(y/x)/abs(x))];
127 solve(map(log,ans[1]/%c),y);
128 [y = x*sinh(log(x/%c))];
129 [method,ode_check(eqn,%[1])];
135 (pn_(113),ans:contrib_ode(eqn:x*'diff(y,x)+a*sqrt(y^2+x^2)-y,y,x));
136 [x=%c*%e^-(x*asinh(y/x)/(a*abs(x)))];
139 solve(map(log,ans[1]/%c),y);
140 [y=-x*sinh(a*log(x/%c))];
141 [method,ode_check(eqn,%[1])];
149 (pn_(114),ans:contrib_ode(eqn:x*'diff(y,x)-x*sqrt(y^2+x^2)-y,y,x));
153 [method,ode_check(eqn,%[1])];
158 /* 115 - "solution" has changed - Jan 2007. Don't care at present */
160 (pn_(115),ans:contrib_ode(eqn:x*'diff(y,x)-x*(y-x)*sqrt(y^2+x^2)-y,y,x));
161 [(2*'integrate((sqrt(y^2+x^2)*((y^2-x*y)*'integrate((2*y^2-x*y+x^2)*%e^-(log(y^2+x^2)/2)/(y^4-2*x*y^3+2*x^2*y^2-2*x^3*y+x^4),x)+(x-y)*'integrate(%e^-(log(y^2+x^2)/2)/(y-x),x))-x)/((y-x)*sqrt(y^2+x^2)),y)+2*y*'integrate(%e^-(log(y^2+x^2)/2)/(y-x),x)+x^2)/2=%c];
166 /* 116 - "solution" has changed - Jan 2007. Don't care at present */
168 (pn_(116),ans:contrib_ode(eqn:x*'diff(y,x)-x*sqrt((y^2-x^2)*(y^2-4*x^2))-y,y,x));
169 [(2*'integrate((sqrt(y^4-5*x^2*y^2+4*x^4)*(y*'integrate((2*y^3-5*x^2*y)*%e^(-log(y+2*x)/2-log(y+x)/2-log(y-x)/2-log(y-2*x)/2)/(y^4-5*x^2*y^2+4*x^4),x)-'integrate(%e^(-log(y+2*x)/2-log(y+x)/2-log(y-x)/2-log(y-2*x)/2),x))-x)/sqrt(y^4-5*x^2*y^2+4*x^4),y)+2*y*'integrate(%e^(-log(y+2*x)/2-log(y+x)/2-log(y-x)/2-log(y-2*x)/2),x)+x^2)/2=%c];
175 (pn_(117),ans:contrib_ode(eqn:x*'diff(y,x)-x*exp(y/x)-y-x,y,x));
176 [%c*x=%e^-((x*log(%e^(y/x)+1)-y)/x)];
181 (pn_(118),ans:contrib_ode(eqn:x*'diff(y,x)-y*log(y),y,x));
182 [log(log(y))=log(x)+%c];
185 [method,ode_check(eqn,%[1])];
189 (pn_(119),ans:contrib_ode(eqn:x*'diff(y,x)-y*(log(x*y)-1),y,x));
193 [method,ode_check(eqn,%[1])];
196 /* 120 Error return from ode1_lie - symmetries exist, see rtest_ode_sym.mac */
197 /* (pn_(120),ans:contrib_ode(eqn:x*'diff(y,x)-y*(x*log(x^2/y)+2),y,x)); */
200 (pn_(121),ans:contrib_ode(eqn:x*'diff(y,x)+sin(y-x),y,x));
204 (pn_(122),ans:contrib_ode(eqn:x*'diff(y,x)+(sin(y)-3*x^2*cos(y))*cos(y),y,x));
208 (pn_(123),ans:contrib_ode(eqn:x*'diff(y,x)-x*sin(y/x)-y,y,x));
209 [%c*x=%e^-((log(cos(y/x)+1)-log(cos(y/x)-1))/2)];
214 (pn_(124),ans:contrib_ode(eqn:x*'diff(y,x)+x*cos(y/x)-y+x,y,x));
215 [%c*x=%e^-(sin(y/x)/(cos(y/x)+1))];
220 (pn_(125),ans:contrib_ode(eqn:x*'diff(y,x)+x*tan(y/x)-y,y,x));
223 [y = asin(1/(%c*x))*x];
224 [method,ode_check(eqn,%[1])];
227 /* Equations 126 to 128 need pdiff */
232 (pn_(126),ans:contrib_ode(eqn:x*'diff(y,x)-y*f(x*y),y,x));
233 [y*'integrate(f(x*y)/(x*y*f(x*y)+x*y),x)-'integrate(((y^2*f(x*y)+y^2)*'integrate((x*y*pderivop(f,1)(x*y)-f(x*y)^2-f(x*y))/(x*y^2*f(x*y)^2+2*x*y^2*f(x*y)+x*y^2),x)+(y*f(x*y)+y)*'integrate(f(x*y)/(x*y*f(x*y)+x*y),x)+1)/(y*f(x*y)+y),y)=%c];
238 (pn_(127),ans:contrib_ode(eqn:x*'diff(y,x)-y*f(x^a*y^b),y,x));
239 [b*y*'integrate(f(x^a*y^b)/(b*x*y*f(x^a*y^b)+a*x*y),x)-'integrate(((b^2*y^2*f(x^a*y^b)+a*b*y^2)*'integrate((a*b*x^a*y^b*pderivop(f,1)(x^a*y^b)-b*f(x^a*y^b)^2-a*f(x^a*y^b))/(b^2*x*y^2*f(x^a*y^b)^2+2*a*b*x*y^2*f(x^a*y^b)+a^2*x*y^2),x)+(b^2*y*f(x^a*y^b)+a*b*y)*'integrate(f(x^a*y^b)/(b*x*y*f(x^a*y^b)+a*x*y),x)+b)/(b*y*f(x^a*y^b)+a*y),y)=%c];
244 (pn_(128),ans:contrib_ode(eqn:x*'diff(y,x)+a*y-f(x)*g(x^a*y),y,x));
245 ['integrate((x^a*f(x)*g(x^a*y)-a*x^a*y)/(x*g(x^a*y)),x)-'integrate((g(x^a*y)*'integrate((a*x^(2*a)*y*pderivop(g,1)(x^a*y)-a*x^a*g(x^a*y))/(x*g(x^a*y)^2),x)+x^a)/g(x^a*y),y)=%c];
253 (pn_(129),ans:contrib_ode(eqn:(x+1)*'diff(y,x)+y*(y-x),y,x));
254 [y = %e^x/((x+1)*(%c-%e^-1*expintegral_e(2,-x-1)/(x+1)))];
255 [method,ode_check(eqn,ans[1])];
259 (pn_(130),ans:contrib_ode(eqn:2*x*'diff(y,x)-y-2*x^3,y,x));
260 [y=%e^(log(x)/2)*(2*%e^(5*log(x)/2)/5+%c)];
261 [method,ode_check(eqn,ans[1])];
265 (pn_(131),ans:contrib_ode(eqn:(2*x+1)*'diff(y,x,1)-4*%e^-y+2,y,x));
266 [-log(%e^y-2)/2=log(2*x+1)/2+%c];
267 [method,ode_check(eqn,ans[1])];
271 (pn_(132),ans:contrib_ode(eqn:3*x*'diff(y,x,1)-3*x*log(x)*y^4-y,y,x));
272 [-(((6*x^2*log(x)-3*x^2)*y^3+4*x)/(4*y^3))=%c];
273 [method,ode_check(eqn,ans[1])];
277 (pn_(133),ans:contrib_ode(eqn:x^2*'diff(y,x,1)+y-x,y,x));
278 [y = (%c + gamma_incomplete(0,1/x))*%e^(1/x)];
279 [method,ode_check(eqn,ans[1])];
283 (pn_(134),ans:contrib_ode(eqn:x^2*'diff(y,x,1)-y+x^2*%e^(x-1/x),y,x));
284 [y=%e^-(1/x)*(%c-%e^x)];
285 [method,ode_check(eqn,ans[1])];
289 (pn_(135),ans:contrib_ode(eqn:x^2*'diff(y,x,1)-(x-1)*y,y,x));
291 [method,ode_check(eqn,ans[1])];
295 (pn_(136),ans:contrib_ode(eqn:x^2*'diff(y,x,1)+y^2+x*y+x^2,y,x));
298 [y=-((x*log(%c*x)-x)/log(%c*x))];
299 [method,ode_check(eqn,%[1])];
303 (pn_(137),ans:contrib_ode(eqn:x^2*'diff(y,x,1)-y^2-x*y,y,x));
307 [method,ode_check(eqn,%[1])];
311 (pn_(138),ans:contrib_ode(eqn:x^2*'diff(y,x,1)-y^2-x*y-x^2,y,x));
313 solve(map(log,ans[1]),y);
314 [y=x*tan(log(%c*x))];
315 [method,ode_check(eqn,%[1])];
319 (pn_(139),ans:contrib_ode(eqn:x^2*('diff(y,x,1)+y^2)+a*x^k-(b-1)*b,y,x));
320 [[y='diff(%u,x,1)/%u,%u*(-a*x^(k-2)+b^2/x^2-b/x^2)-'diff(%u,x,2)=0]];
325 (pn_(140),ans:contrib_ode(eqn:x^2*('diff(y,x,1)+y^2)+4*x*y+2,y,x));
326 [x=%c*(x*y+2)/(x*y+1)];
328 [y=-((x-2*%c)/(x^2-%c*x))];
329 [method,ode_check(eqn,%[1])];
333 assume(4*b-a^2+2*a-1>0);
335 (pn_(141),ans:contrib_ode(eqn:x^2*('diff(y,x,1)+y^2)+a*x*y+b,y,x));
336 [x=%c*%e^-(2*atan((2*x*y+a-1)/sqrt(4*b-a^2+2*a-1))/sqrt(4*b-a^2+2*a-1))];
338 log(x/%c)=-2*atan((2*x*y+a-1)/sqrt(4*b-a^2+2*a-1))/sqrt(4*b-a^2+2*a-1);
340 [y=-((sqrt(4*b-a^2+2*a-1)*tan(sqrt(4*b-a^2+2*a-1)*log(x/%c)/2)+a-1)/(2*x))];
341 [method,ode_check(eqn,%[1])];
343 forget(4*b-a^2+2*a-1>0);
347 (pn_(142),ans:contrib_ode(eqn:x^2*('diff(y,x,1)-y^2)-a*x^2*y+a*x+2,y,x));
348 [y = -((%c*a^3*x^3*%e^(a*x)-%c*a^2*x^2*%e^(a*x)+2*%c*a*x*%e^(a*x)
350 /(x*(2*%c*%e^(a*x)+1)+%c*a^2*x^3*%e^(a*x)-2*%c*a*x^2*%e^(a*x)))];
351 [method,ode_check(eqn,ans[1])];
358 (pn_(143),ans:contrib_ode(eqn:x^2*('diff(y,x,1)+a*y^2)-b,y,x));
359 [x=%c*%e^-((log(-((-2*a*x*y+sqrt(4*a*b+1)+1)/(2*a*x*y+sqrt(4*a*b+1)-1)))
367 (pn_(144),ans:contrib_ode(eqn:x^2*('diff(y,x,1)+a*y^2)+b*x^alpha+c,y,x));
368 [[y='diff(%u,x,1)/(%u*a),%u*a^2*(-b*x^(alpha-2)-c/x^2)-'diff(%u,x,2)*a=0]];
373 (pn_(145),ans:contrib_ode(eqn:x^2*'diff(y,x,1)+a*y^3-a*x^2*y^2,y,x));
377 (pn_(146),ans:contrib_ode(eqn:x^2*'diff(y,x,1)+x*y^3+a*y^2,y,x));
381 (pn_(147),ans:contrib_ode(eqn:x^2*'diff(y,x,1)+a*x^2*y^3+b*y^2,y,x));
385 (pn_(148),ans:contrib_ode(eqn:(x^2+1)*'diff(y,x,1)+x*y-1,y,x));
386 [y=(asinh(x)+%c)*%e^-(log(x^2+1)/2)];
387 [method,radcan(ode_check(eqn,ans[1]))];
391 (pn_(149),ans:contrib_ode(eqn:(x^2+1)*'diff(y,x,1)+x*y-x*(x^2+1),y,x));
392 [y=((x^2+1)^(3/2)/3+%c)*%e^-(log(x^2+1)/2)];
393 [method,radcan(ode_check(eqn,ans[1]))];
397 (pn_(150),ans:contrib_ode(eqn:(x^2+1)*'diff(y,x,1)+2*x*y-2*x^2,y,x));
398 [y=(2*x^3/3+%c)/(x^2+1)];
399 [method,ode_check(eqn,ans[1])];
403 (pn_(151),ans:contrib_ode(eqn:(x^2+1)*'diff(y,x,1)+(2*x*y-1)*(y^2+1),y,x));
407 (pn_(152),ans:contrib_ode(eqn:(x^2+1)*'diff(y,x,1)+x*cos(y)*sin(y)-x*(x^2+1)*cos(y)^2,y,x));
411 (pn_(153),ans:contrib_ode(eqn:(x^2-1)*'diff(y,x,1)-x*y+a,y,x));
412 [y=(a*x/sqrt(x^2-1)+%c)*%e^(log(x^2-1)/2)];
413 [method,radcan(ode_check(eqn,ans[1]))];
417 (pn_(154),ans:contrib_ode(eqn:(x^2-1)*'diff(y,x,1)+2*x*y-cos(x),y,x));
418 [y=(sin(x)+%c)/(x^2-1)];
419 [method,ode_check(eqn,ans[1])];
423 (pn_(155),ans:contrib_ode(eqn:(x^2-1)*'diff(y,x,1)+y^2-2*x*y+1,y,x),0);
425 /*[y = (x^2*((x-1)*(%c*log(x+1)-%c*log(x-1)+2*%c+1)
426 +(x+1)*(%c*log(x+1)-%c*log(x-1)-2*%c+1))
427 +(x+1)*(-%c*log(x+1)+%c*log(x-1)+2*%c-1)
428 +(x-1)*(-%c*log(x+1)+%c*log(x-1)-2*%c-1))
429 /((x-1)*(x+1)*(2*%c*log(x+1)-2*%c*log(x-1)+2))]; */
430 [method,ode_check(eqn,ans[1])];
434 (pn_(156),ans:contrib_ode(eqn:(x^2-1)*'diff(y,x,1)-y*(y-x),y,x));
435 [y=%e^-(log(x^2-1)/2)/(x/sqrt(x^2-1)+%c)];
436 [method,radcan(ode_check(eqn,ans[1]))];
440 (pn_(157),ans:contrib_ode(eqn:(x^2-1)*'diff(y,x,1)+a*(y^2-2*x*y+1),y,x));
441 [y = -(((%c*dgauss_b(1-a,a,1,-((x-1)/2))+dgauss_a(1-a,a,1,-((x-1)/2)))*x^2
442 +(-2*%c*gauss_b(1-a,a,1,-((x-1)/2))-2*gauss_a(1-a,a,1,-((x-1)/2)))*a*x
443 -%c*dgauss_b(1-a,a,1,-((x-1)/2))-dgauss_a(1-a,a,1,-((x-1)/2)))
444 /((2*%c*gauss_b(1-a,a,1,-((x-1)/2))+2*gauss_a(1-a,a,1,-((x-1)/2)))*a))];
445 [method,ode_check(eqn,ans[1])];
449 (pn_(158),ans:contrib_ode(eqn:(x^2-1)*'diff(y,x,1)+a*x*y^2+x*y,y,x));
450 [log(a*y+1)-log(y)=(log(x+1)+log(x-1))/2+%c];
451 [method,ode_check(eqn,ans[1])];
455 (pn_(159),ans:contrib_ode(eqn:(x^2-1)*'diff(y,x,1)-2*x*y*log(y),y,x));
456 [log(log(y))/2=(log(x+1)+log(x-1))/2+%c];
457 [method,ode_check(eqn,ans[1])];
461 (pn_(160),ans:contrib_ode(eqn:(x^2-4)*'diff(y,x,1)+(x+2)*y^2-4*y,y,x));
462 [y=%e^(4*(log(x-2)/4-log(x+2)/4))/(3*log(x+2)/4-4*(-log(x+2)/16+log(x-2)/16+1/(4*x+8))+log(x-2)/4+1/(x+2)+%c)];
463 [method,ode_check(eqn,ans[1])];
467 (pn_(161),ans:contrib_ode(eqn:(x^2-5*x+6)*'diff(y,x,1)+3*x*y-8*y+x^2,y,x));
468 [y=(%c-(3*x^4-8*x^3)/12)/((x-3)*(x-2)^2)];
469 [method,ode_check(eqn,ans[1])];
473 (pn_(162),ans:contrib_ode(eqn:(x-a)*(x-b)*'diff(y,x,1)+y^2+k*(y+x-a)*(y+x-b),y,x));
474 [y = -((k*(-b*(x-b)^k-%c*a*(x-a)^k)+k*x*((x-b)^k+%c*(x-a)^k))
475 /(k*((x-b)^k+%c*(x-a)^k)+(x-b)^k+%c*(x-a)^k))];
476 [method,ode_check(eqn,ans[1])];
482 (pn_(163),ans:contrib_ode(eqn:2*x^2*'diff(y,x,1)-2*y^2-x*y+2*a^2*x,y,x));
483 [y=-((%c*a*sinh(2*a/sqrt(x))-%i*a*cosh(2*a/sqrt(x)))*sqrt(x)/(%i*sinh(2*a/sqrt(x))-%c*cosh(2*a/sqrt(x))))];
484 [method,ode_check(eqn,ans[1])];
490 (pn_(164),ans:contrib_ode(eqn:2*x^2*'diff(y,x,1)-2*y^2-3*x*y+2*a^2*x,y,x),0);
493 [y=-(((bessel_y(-(1/2),2*a/sqrt(-x))*%c+bessel_j(-(1/2),2*a/sqrt(-x)))*x
494 +((2*bessel_y(-(3/2),2*a/sqrt(-x))-2*bessel_y(1/2,2*a/sqrt(-x)))*%c
495 -2*bessel_j(1/2,2*a/sqrt(-x))+2*bessel_j(-(3/2),2*a/sqrt(-x)))*a*sqrt(-x))
496 /(4*bessel_y(-(1/2),2*a/sqrt(-x))*%c+4*bessel_j(-(1/2),2*a/sqrt(-x))))];
498 /* FIXME 2015-04-06 Form of solution has changed.
499 ode_check() crashes with stack overflow
500 [method,ode_check(eqn,ans[1])];
505 (pn_(165),ans:contrib_ode(eqn:x*(2*x-1)*'diff(y,x,1)+y^2+(-4*x-1)*y+4*x,y,x));
506 [(x*y-2*x^2)/(y-1)=%c];
507 [method,ode_check(eqn,ans[1])];
511 (pn_(166),ans:contrib_ode(eqn:2*(x-1)*x*'diff(y,x,1)+(x-1)*y^2-x,y,x));
512 [y = ((2*dgauss_b(1/2,3/2,1,x)*%c+2*dgauss_a(1/2,3/2,1,x))*x^2
513 +(2*gauss_b(1/2,3/2,1,x)*%c-2*dgauss_b(1/2,3/2,1,x)*%c
514 +2*gauss_a(1/2,3/2,1,x)
515 -2*dgauss_a(1/2,3/2,1,x))
517 /((gauss_b(1/2,3/2,1,x)*%c+gauss_a(1/2,3/2,1,x))*x
518 -gauss_b(1/2,3/2,1,x)*%c-gauss_a(1/2,3/2,1,x))];
519 [method,ode_check(eqn,ans[1])];
523 (pn_(167),ans:contrib_ode(eqn:3*x^2*'diff(y,x,1)-7*y^2-3*x*y-x^2,y,x));
524 [%c*x=%e^(3*atan(7*y/(sqrt(7)*x))/sqrt(7))];
525 solve(map(log,ans[1]),y);
526 [y=sqrt(7)*x*tan(sqrt(7)*log(%c*x)/3)/7];
527 [method,ode_check(eqn,%[1])];
531 (pn_(168),ans:contrib_ode(eqn:3*(x^2-4)*'diff(y,x,1)+y^2-x*y-3,y,x),0);
534 [y = -( ((3*dgauss_b(1/2,7/6,4/3,-((x-2)/4))*%c
535 +3*dgauss_a(1/2,7/6,4/3,-((x-2)/4)))
537 +(-6*gauss_b(1/2,7/6,4/3,-((x-2)/4))*%c
538 -6*gauss_a(1/2,7/6,4/3,-((x-2)/4)))
539 *x-12*dgauss_b(1/2,7/6,4/3,-((x-2)/4))*%c
540 -12*dgauss_a(1/2,7/6,4/3,-((x-2)/4)))
541 /(4*gauss_b(1/2,7/6,4/3,-((x-2)/4))*%c
542 +4*gauss_a(1/2,7/6,4/3,-((x-2)/4))) ) ];
544 [method,ode_check(eqn,ans[1])];
548 (pn_(169),ans:contrib_ode(eqn:(a*x+b)^2*'diff(y,x,1)+(a*x+b)*y^3+c*y^2,y,x));
552 (pn_(170),ans:contrib_ode(eqn:x^3*'diff(y,x,1)-y^2-x^4,y,x));
553 [x=%c*%e^-(x^2/(y-x^2))];
555 [y=(log(%c/x)+1)*x^2/log(%c/x)];
556 [method,ode_check(eqn,%[1])];
560 (pn_(171),ans:contrib_ode(eqn:x^3*'diff(y,x,1)-y^2-x^2*y,y,x));
562 [method,ode_check(eqn,ans[1])];
566 (pn_(172),ans:contrib_ode(eqn:x^3*'diff(y,x,1)-x^4*y^2+x^2*y+20,y,x));
567 [x=%c*%e^-((log(x^2*y+5)-log(x^2*y-4))/9)];
572 (pn_(173),ans:contrib_ode(eqn:x^3*'diff(y,x,1)-x^6*y^2+(3-2*x)*x^2*y+3,y,x));
573 [y=-((3*%e^(4*x)-%c)/(x^3*%e^(4*x)+%c*x^3))];
574 [method,ode_check(eqn,ans[1])];
578 (pn_(174),ans:contrib_ode(eqn:x*(x^2+1)*'diff(y,x,1)+x^2*y,y,x));
579 [y=%c*%e^-(log(x^2+1)/2)];
580 [method,ode_check(eqn,ans[1])];
584 (pn_(175),ans:contrib_ode(eqn:x*(x^2-1)*'diff(y,x,1)-(2*x^2-1)*y+a*x^3,y,x));
585 [y=x*(a/sqrt(x^2-1)+%c)*%e^(log(x+1)/2+log(x-1)/2)];
586 [method,radcan(ode_check(eqn,ans[1]))];
590 (pn_(176),ans:contrib_ode(eqn:x*(x^2-1)*'diff(y,x,1)+(x^2-1)*y^2-x^2,y,x));
591 [[y='diff(%u,x,1)*x/%u,%u/(x*(x^2-1))-'diff(%u,x,2)/x-'diff(%u,x,1)/x^2=0]];
596 (pn_(177),ans:contrib_ode(eqn:(x-1)*x^2*'diff(y,x,1)-y^2-(x-2)*x*y,y,x));
597 [y=(x-1)*%e^-(2*(log(x-1)-log(x)))/((2*x-1)/(2*x^2-4*x+2)-1/(2*x^2-4*x+2)+%c)];
598 [method,ode_check(eqn,ans[1])];
602 (pn_(178),ans:contrib_ode(eqn:2*x*(x^2-1)*'diff(y,x,1)+2*(x^2-1)*y^2+(5-3*x^2)*y+x^2-3,y,x));
603 [y = (%c*sqrt(x-1)*sqrt(x+1)*'integrate(1/(sqrt(x-1)*sqrt(x)*sqrt(x+1)),x)
604 +sqrt(x-1)*sqrt(x+1)+%c*sqrt(x))
605 /(%c*sqrt(x-1)*sqrt(x+1)*'integrate(1/(sqrt(x-1)*sqrt(x)*sqrt(x+1)),x)
606 +sqrt(x-1)*sqrt(x+1))];
607 [method,ode_check(eqn,ans[1])];
611 (pn_(179),ans:contrib_ode(eqn:3*x*(x^2-1)*'diff(y,x,1)+x*y^2+(-x^2-1)*y-3*x,y,x));
612 [[y='diff(%u,x,1)*(3*x^2-3)/%u,-'diff(%u,x,1)*(6*x/(3*x^2-3)^2-(x^2/(3*x^3-3*x)+1/(3*x^3-3*x))/(3*x^2-3))-'diff(%u,x,2)/(3*x^2-3)+%u/((x^2-1)*(3*x^2-3)^2)=0]];
619 (pn_(180),ans:contrib_ode(eqn:(a*x^2+b*x+c)*(x*'diff(y,x,1)-y)-y^2+x^2,y,x));
620 [y=-((%c*x*sinh(2*atan((2*a*x+b)/sqrt(4*a*c-b^2))/sqrt(4*a*c-b^2))+%i*x*cosh(2*atan((2*a*x+b)/sqrt(4*a*c-b^2))/sqrt(4*a*c-b^2)))/(%i*sinh(2*atan((2*a*x+b)/sqrt(4*a*c-b^2))/sqrt(4*a*c-b^2))+%c*cosh(2*atan((2*a*x+b)/sqrt(4*a*c-b^2))/sqrt(4*a*c-b^2))))];
621 [method,ode_check(eqn,ans[1])];
629 (pn_(181),ans:contrib_ode(eqn:x^4*('diff(y,x,1)+y^2)+a,y,x));
630 [y=-((sqrt(a)-x*tan((sqrt(a)-%c*x)/x))/(x^2*tan((sqrt(a)-%c*x)/x)))];
631 [method,ode_check(eqn,ans[1])];
637 (pn_(182),ans:contrib_ode(eqn:x*(x^3-1)*'diff(y,x,1)-2*x*y^2+y+x^2,y,x));
638 [y = (2*%c*(x-1)*x^6+x*(3*%c*(x-1)*(x^2+x+1)-2*(x-1))
639 +x^4*(2*(x-1)-3*%c*(x-1)*(x^2+x+1))
640 +x^5*(%c*(x^2+x+1)+%c*(x-1))
641 +x^2*(-%c*(x^2+x+1)-%c*(x-1))
642 +x^3*(x^2+x+(1-2*%c)*(x-1)+1)-x^2-2*x)
643 /(3*%c*(x-1)*x^2*(x^2+x+1)+3*(x-1)*(x^2+x+1))];
644 [method,ode_check(eqn,ans[1])];
648 (pn_(183),ans:contrib_ode(eqn:(2*x^4-x)*'diff(y,x,1)-2*(x^3-1)*y,y,x));
649 [y=%c*x^2*%e^-(log(2*x^3-1)/3)];
650 [method,ode_check(eqn,ans[1])];
653 /* 184 - FIXME 2006-12-11 - Runs forever */
654 /* (pn_(184),ans:contrib_ode(eqn:(a*x^2+b*x+c)^2*('diff(y,x,1)+y^2)+A,y,x));
655 [[y='diff(%u,x,1)/%u,-%u*A/(a^2*x^4+2*a*b*x^3+2*a*c*x^2+b^2*x^2+2*b*c*x+c^2)-'diff(%u,x,2)=0]];
660 (pn_( 185 ),ans:contrib_ode(eqn: x^7*'diff(y,x,1)+2*(x^2+1)*y^3+5*x^3*y^2 ,y,x));
664 (pn_(186),ans:contrib_ode(eqn:x^n*'diff(y,x,1)+y^2+(1-n)*x^(n-1)*y+x^(2*n-2),y,x));
665 [x=%c*%e^-atan(x^(1-n)*y)];
670 assume(n^2-2*n-4*a*b+1>0);
672 (pn_(187),ans:contrib_ode(eqn:x^n*'diff(y,x,1)-a*y^2-b*x^(2*n-2),y,x));
673 [x=%c*%e^(log(-((-2*a*x*y+sqrt(n^2-2*n-4*a*b+1)*x^n+(n-1)*x^n)/(2*a*x*y+sqrt(n^2-2*n-4*a*b+1)*x^n+(1-n)*x^n)))/sqrt(n^2-2*n-4*a*b+1))];
676 forget(n^2-2*n-4*a*b+1>0);
680 Some choices that are integrable include
681 (n:3, b:1, a:n+b); => K = -27/4
682 (n:7, b:2, a:n+b); => K = -343/36
684 (pn_(188),n:3,b:1,a:n+b,ans:contrib_ode(eqn:x^(2*n+1)*'diff(y,x)-a*y^3-b*x^(3*n),y,x));
685 [x=%c*%e^-(((2*y-x^3)*log((2*y-x^3)/x^3)+(x^3-2*y)*log((y+x^3)/x^3)+3*x^3)/(18*y-9*x^3))];
694 (pn_(189),ans:contrib_ode(eqn:x^(n+m*(n-1))*'diff(y,x,1)-a*y^n-b*x^((m+1)*n),y,x),done);
702 (pn_(190),ans:contrib_ode(eqn:sqrt(x^2-1)*'diff(y,x,1)-sqrt(y^2-1),y,x));
703 [log(2*sqrt(y^2-1)+2*y)=log(2*sqrt(x^2-1)+2*x)+%c];
704 [method,ode_check(eqn,ans[1])];
708 (pn_(191),ans:contrib_ode(eqn:sqrt(1-x^2)*'diff(y,x,1)-y*sqrt(y^2-1),y,x));
709 [-asin(1/abs(y))=asin(x)+%c];
710 [method,ode_check(eqn,ans[1])];
714 (pn_(192),ans:contrib_ode(eqn:sqrt(x^2+a^2)*'diff(y,x,1)+y-sqrt(x^2+a^2)+x,y,x));
715 [y = %e^-asinh(x/abs(a))*(((a^2*log(sqrt(x^2/a^2+1)+x/abs(a)))/2
716 +(x*sqrt(x^2+a^2))/2)
718 -((x*sqrt(x^2+a^2))/2
719 -(a^2*log(sqrt(x^2/a^2+1)+x/abs(a)))/2)
720 /abs(a)+((a-abs(a))*x^2)/(2*a*abs(a))+%c)]$
721 assume(a>0); /* Just check when a>0 */
723 logarc( expand(ans[1],0,0));
724 y = (((a^2*log(sqrt(x^2/a^2+1)+x/a))/2+(x*sqrt(x^2+a^2))/2)/a
725 -((x*sqrt(x^2+a^2))/2-(a^2*log(sqrt(x^2/a^2+1)+x/a))/2)/a+%c)
726 /(sqrt(x^2/a^2+1)+x/a)$
727 [method,ode_check(eqn,%)];
733 (pn_(193),ans:contrib_ode(eqn:x*log(x)*'diff(y,x,1)+y-a*x*(log(x)+1),y,x));
734 [y=(a*(x*log(x)-x)+a*x+%c)/log(x)];
735 [method,ode_check(eqn,ans[1])];
739 (pn_(194),ans:contrib_ode(eqn:x*log(x)*'diff(y,x,1)-log(x)*y^2+(-2*log(x)^2-1)*y-log(x)^3,y,x));
740 [y=-((%c*log(x)^3+(2*%c+2)*log(x))/(%c*log(x)^2+2))];
741 [method,ode_check(eqn,ans[1])];
745 (pn_(195),ans:contrib_ode(eqn:sin(x)*'diff(y,x,1)-sin(x)^2*y^2+(cos(x)-3*sin(x))*y+4,y,x));
746 [y=-((4*%e^(5*x)-%c)/((%e^(5*x)+%c)*sin(x)))];
747 [method,ode_check(eqn,ans[1])];
751 /* FIXME: This test now prompts - 2006-10-02
752 (pn_(196),ans:contrib_ode(eqn:cos(x)*'diff(y,x,1)+y+cos(x)*(sin(x)+1),y,x));
753 [y = %e^(log(sin(x)-1)/2-log(sin(x)+1)/2)
754 *('integrate((-sin(x)-1)*%e^(log(sin(x)+1)/2-log(sin(x)-1)/2),x)+%c)];
756 y=-sqrt(sin(x)-1)*('integrate((sin(x)+1)^(3/2)/sqrt(sin(x)-1),x)-%c)
758 [method,ode_check(eqn,ans)];
762 (pn_(197),ans:contrib_ode(eqn:cos(x)*'diff(y,x,1)-y^4-sin(x)*y,y,x));
763 [y=1/(cos(x)*(%c-3*(tan(x)^3/3+tan(x)))^(1/3))];
764 [method,ode_check(eqn,ans[1])];
767 /* 198 FIXME: This now fails. May be a maxima bug. Jan 2007 */
769 (pn_(198),ans:contrib_ode(eqn:cos(x)*sin(x)*'diff(y,x,1)-y-sin(x)^3,y,x));
770 [y=sin(x)*(%c-sqrt(sin(x)^2-1))*%e^-(log(sin(x)^2-1)/2)];
771 [method,ode_check(eqn,ans[1])];
775 /* 199 - also Murphy 1.129 */
776 (pn_(199),ans:contrib_ode(eqn:sin(2*y)+sin(2*x)*'diff(y,x,1),y,x));
777 [(log(cos(2*y)+1)-log(cos(2*y)-1))/4=%c-(log(cos(2*x)+1)-log(cos(2*x)-1))/4];
778 trigsimp(map(exp,4*ans[1]));
779 (cos(2*y)+1)/(cos(2*y)-1) = (%e^(4*%c)*cos(2*x)-%e^(4*%c))/(cos(2*x)+1);
780 subst(%c,exp(4*%c),%);
781 (cos(2*y)+1)/(cos(2*y)-1)=(%c*cos(2*x)-%c)/(cos(2*x)+1);
783 [y = acos(%c*cos(2*x)/(%c*cos(2*x)-cos(2*x)-%c-1)
784 +cos(2*x)/(%c*cos(2*x)-cos(2*x)-%c-1)-%c/(%c*cos(2*x)-cos(2*x)-%c-1)
785 +1/(%c*cos(2*x)-cos(2*x)-%c-1))/2];
786 [method,ode_check(eqn,%[1])];
790 (pn_(200),ans:contrib_ode(eqn:(a*sin(x)^2+b)*'diff(y,x,1)+a*sin(2*x)*y+A*x*(a*sin(x)^2+c),y,x));
791 [y=((A*a*(2*x*sin(2*x)+cos(2*x)-2*x^2))/8-(A*c*x^2)/2+%c)/(a*sin(x)^2+b)];
792 [method,ode_check(eqn,ans[1])];