1 (load("contrib_ode"),0);
4 /* Test cases for contrib_ode utility functions */
6 (load('contrib_ode), done);
9 bessel_simplify(4*bessel_j(n,x^2)*(x^2-n^2/x^2)
10 +x*((bessel_j(n-2,x^2)-bessel_j(n,x^2))*x
11 -(bessel_j(n,x^2)-bessel_j(n+2,x^2))*x)
12 -2*bessel_j(n+1,x^2)+2*bessel_j(n-1,x^2));
15 bessel_simplify(((bessel_y(n-2,sqrt(x))-bessel_y(n,sqrt(x)))/(4*sqrt(x))
16 -(bessel_y(n,sqrt(x))-bessel_y(n+2,sqrt(x)))/(4*sqrt(x)))
18 +bessel_y(n,sqrt(x))*(1-n^2/x)/(4*x)
19 +(bessel_y(n-1,sqrt(x))-bessel_y(n+1,sqrt(x)))/(8*x^(3/2)));
22 bessel_simplify(-(bessel_k(1,x)*%c-bessel_i(1,x))^2*x^2/(bessel_k(0,x)*%c+bessel_i(0,x))^2
24 +x*((-(bessel_k(2,x)+bessel_k(0,x))*%c/2-(bessel_i(2,x)+bessel_i(0,x))/2)*x
25 /(bessel_k(0,x)*%c+bessel_i(0,x))
26 -(bessel_i(1,x)-bessel_k(1,x)*%c)*(bessel_k(1,x)*%c-bessel_i(1,x))*x
27 /(bessel_k(0,x)*%c+bessel_i(0,x))^2
28 +(bessel_k(1,x)*%c-bessel_i(1,x))/(bessel_k(0,x)*%c+bessel_i(0,x))));
31 /* Check Struve H recurrence - integral of bessel_j(2,z)*z^2 dz */
32 bessel_simplify(diff(3*%pi*(struve_h(1,z)*bessel_j(2,z)-bessel_j(1,z)*struve_h(2,z))*z/2,z)-bessel_j(2,z)*z^2);
35 /* Check Struve L recurrence - integral of z^v*struve_l(v-1,z) dz DLMF 11.7.3 */
36 bessel_simplify(diff(z^v*struve_l(v,z),z)-z^v*struve_l(v-1,z));
39 expintegral_e_simplify(
40 (%e^(2*x+2)+(%e*expintegral_e(1,-x-1)*x-%e*expintegral_e(2,-x-1)
41 +%e*expintegral_e(1,-x-1))*%e^x)
42 /(%e^2*%c^2*x^2+(2*%e^2*%c^2-2*%e*expintegral_e(2,-x-1)*%c)*x+%e^2*%c^2
43 -2*%e*expintegral_e(2,-x-1)*%c+expintegral_e(2,-x-1)^2));
46 expintegral_e_simplify(
47 -((2*expintegral_e(1/4,(2*x-1)/4)-2*expintegral_e(-3/4,(2*x-1)/4))*x*(2*x-1)^(3/4)*%e^((4*x-1)/4)+(expintegral_e(5/4,(2*x-1)/4)+2*expintegral_e(1/4,(2*x-1)/4)+expintegral_e(-3/4,(2*x-1)/4))*(2*x-1)^(3/4)*%e^((4*x-1)/4))/(8*x-4));
50 expintegral_e_simplify(
51 %e^(-x-2)*(2*%e^(2*x+2)+(4*expintegral_e(2,-2*(x+1))-4*expintegral_e(1,-2*(x+1)))*x^2+(6*expintegral_e(2,-2*(x+1))-4*expintegral_e(3,-2*(x+1)))*x-2*expintegral_e(2,-2*(x+1))+4*expintegral_e(1,-2*(x+1))));
54 expintegral_e_simplify(
55 -%e^(-3*x-5)*(x*((100*expintegral_e(2,5*(x-1))+300*expintegral_e(1,5*(x-1)))*%e^(5*x)-100*%e^5)+500*expintegral_e(1,5*(x-1))*x^2*%e^(5*x)+(160*expintegral_e(2,5*(x-1))-800*expintegral_e(1,5*(x-1)))*%e^(5*x)-160*%e^5));
58 /* verify that ode1_lie doesn't trigger an error on this problem.
59 * contrib_ode doesn't appear to be able to solve it, which is OK, I guess.
63 foo : contrib_ode ('diff(x, t)^2 = alpha - beta*abs(x)^n, x, t),
68 /* Allow subscripted variables in ode_check */
69 ode_check('diff(y[2],x[1]),y[2]=%c);
72 ode_check('diff(x[2],x[1],2)-x[2],x[2]=%e^-x[1]*%k2+%e^x[1]*%k1);