Fix typo in display-html-help
[maxima.git] / share / contrib / diffequations / tests / rtestode_murphy_2_5.mac
blob38f56fc1c53819c45c1e922d8543adf9defd0dbf
1 (load("contrib_ode"),0);
2 0$
4 /* ODE tests - Murphy equations 2.401 - 2.423
6   Reference: 
7     G M Murphy, Ordinary Differential Equations and Their 
8     Solutions, Van Nostrand, 1960, pp 15-23
10     First Order and Second or Higher Degree, p278 ff
13 /* Don't kill(all); It messes up trigsimp */
15 /* Eliminate parameter t from singular solution */
16 (elim_(ans,x,y,t):=block([s],s:first(solve(ans[2],t)),s:solve(ev(ans[1],s),y),s[1]),done);
17 done;
19 /* Print ode number*/
20 (pn_(n_):=print("Murphy ODE 2.",n_),true);
21 true;
23 /* 402 */
24 (pn_(402),ans:contrib_ode(eqn:log('diff(y,x))+x*'diff(y,x)+a=y,y,x));
25 [y = %c*x+a+log(%c),[-y+%t*x+log(%t)+a=0,(%t*x+1)/%t=0]];
26 /* Eliminate parameter t from singular solution */
27 (s:first(solve((ans[2])[2],%t)),s:first(solve(ev(first(ans[2]),s),y)));
28 y = log(-1/x)+a-1;
29 [method,ode_check(eqn,ans[1]),ode_check(eqn,s)];
30 [clairaut,0,0];
32 /* 405 */
33 (pn_(405),ans:contrib_ode(eqn:log('diff(y,x))+a*(x*'diff(y,x)-y)=0,y,x));
34 [y = (%c*a*x+log(%c))/a,[a*(%t*x-y)+log(%t) = 0,(%t*a*x+1)/%t = 0]];
35 /* Eliminate parameter t from singular solution */
36 /* (s:first(solve((ans[2])[2],%t)),s:first(solve(ev(first(ans[2]),s),y))); */
37 s:elim_(ans[2],x,y,%t);
38 y=(log(-1/(a*x))-1)/a;
39 [method,ode_check(eqn,ans[1]),ode_check(eqn,s)];
40 [clairaut,0,0];
42 /* 408 */
43 (pn_(408),ans:contrib_ode(eqn:'diff(y,x)*log('diff(y,x))-(1+x)*'diff(y,x)+y=0,y,x));
44 [y = %c*x-%c*log(%c)+%c,[y-%t*(x+1)+%t*log(%t) = 0,log(%t)-x = 0]];
45 /* Eliminate parameter %t from singular solution */
46 (s:first(solve((ans[2])[2],%t)),s:first(solve(ev(first(ans[2]),s),y)));
47 y = %e^x;
48 [method,ode_check(eqn,ans[1]),ode_check(eqn,s)];
49 [clairaut,0,0];
51 /* 409 */
52 (pn_(409),ans:contrib_ode(eqn:log('diff(y,x)*x-y)='diff(y,x),y,x));
53 [y=%c*x-%e^%c,[log(%t*x-y)-%t=0,-((-y+%t*x-x)/(%t*x-y))=0]];
54 /* eliminate parameter %t from singular solution */
55 (s:first(solve((ans[2])[2],%t)),s:first(solve(ev(first(ans[2]),s),y)));
56 y = x*log(x)-x;
57 [method,ode_check(eqn,ans[1]),ode_check(eqn,s)];
58 [clairaut,0,0];
60 /* 410 */
61 (pn_(410),ans:contrib_ode(eqn:'diff(y,x)*log('diff(y,x)+sqrt(1+'diff(y,x)^2))-sqrt(1+'diff(y,x)^2)-x*'diff(y,x)+y=0,y,x));
62 [y=%c*x-%c*log(sqrt(%c^2+1)+%c)+sqrt(%c^2+1),[y-%t*x+%t*log(sqrt(%t^2+1)+%t)-sqrt(%t^2+1)=0,log(sqrt(%t^2+1)+%t)-x=0]];
63 ans[2]:radcan(ans[2]);
64 [y-%t*x+%t*log(sqrt(%t^2+1)+%t)-sqrt(%t^2+1)=0,log(sqrt(%t^2+1)+%t)-x=0];
65 ans[2]:ans[2],log(sqrt(%t^2+1)+%t)=asinh(%t);
66 [y-%t*x+%t*asinh(%t)-sqrt(%t^2+1) = 0,asinh(%t)-x = 0];
67 solve(ans[2][2],%t);
68 [%t = sinh(x)];
69 trigsimp(ans[2][1]),%[1],triginverses=all;
70 y-cosh(x)=0;
71 ans[2]:first(solve(%,y));
72 y=cosh(x);
73 [method,ode_check(eqn,ans[1]),radcan(exponentialize((ode_check(eqn,ans[2]))))];
74 [clairaut,0,0];
76 /* 416 - requires pdiff package */
77 block([use_pdiff:true],pn_(416),contrib_ode(eqn:f(x*'diff(y,x)-y)=g('diff(y,x)),y,x));
78 [f(%c*x-y)=g(%c)];
79 method;
80 clairaut;