The Kovacic class is included in the file KOV.mpl and the Kovacic testsuite module is in
the file kovacic_tester.mpl. These two files accompany the arXiv version of this
paper.
To use these, download these two files to some directory at your computer. For example,
on windows, assuming the files were downloaded to c:/my_folder/, then now start Maple
and type
read "c:/my_folder/KOV.mpl" read "c:/my_folder/kovacic_tester.mpl"
The above will load the kovacic_class and the testsuite module. Once the above is
successfully completed, then to solve an ode the command is
ode := diff(y(x),x$2)+diff(y(x),x)+y(x)=0; o := Object(kovacic_class,ode,y(x)); #create the object sol := o:-dsolve();
The above command will automatically try all the cases that have been detected one by
one until a solution is found. If no solution is found, it returns FAIL. To verify the solution,
the command is
if sol<>FAIL then odetest(sol,ode); fi;
Which returns \(0\) if the solution is correct.
A note on the type of ode’s supported: it is recommenced to use only ode’s with numeric
coefficients and not symbolic coefficients. This is because the Kovacic algorithm needs to
decide if the degree \(d\) of the polynomial \(p(x)\) is non-negative or not. If some of the coefficients
are purely symbolic, then it can fail to decide this. An example of this is given
in the original Kovacic paper as example 2 on page 14, which is to solve the
Bessel ode \(y'' = \left (\frac {4 n^{2}-1}{4 x^{2}}-1\right ) y\). This will now return FAIL since the algorithm can not decide if \(d\)
is non-negative integer without knowing any assumptions or having numerical
value for \(n\). Replacing \(n\) by any half odd integer, then it can solve it as follows
ode :=diff(diff(y(x),x),x)=((4*n^2-1)/(4*x^2)-1)*y(x); n :=-3/2; o := Object(kovacic_class,ode,y(x)); sol := o:-dsolve();
To solve an ode using specific case number, say case \(2\), the command is
ode := ...; o := Object(kovacic_class,ode,y(x)); sol := o:-dsolve_case(2);
If the ode happened to satisfy cases \(1\) and \(2\) for an example, then the above command will
only use case \(2\) to solve it and will skip case \(1\). If the command o:-dsolve() was used
instead, then the ode will be solved using case \(1\) instead as that is the first one tried. Case \(2\)
will only be tried is no solution is found using case \(1\).
The object created above, named as “o”, has additional public methods that can be invoked. The following is description of all public methods available.
o:-get_y_ode() This returns the original ode.
o:-get_z_ode() This returns the ode solved by Kovacic algorithm which is \(z''=r z\).
o:-get_r() This returns \(r\) only.
o:-get_poles() This returns list of the poles of \(r\). It has the format
[ [pole location,pole order],[pole location,pole order], ...]
If there are no poles, then the empty list [] is returned.
o:-get_order_at_infinity() This returns the order of \(r\) at infinity.
o:-get_possible_cases() This returns list of possible Kovacic cases detected
which can be [1], [2], [1,2], [1,2,3]. If no Kovacic cases are found, then
the empty list [] is returned.
o:-get_case_used() This returns the actual case number used if solution to
the ode was successful. This can be \(1,2\) or \(3\). If no solution is found after trying all
cases whose conditions were satisfied, then \(-1\) is returned.
o:-get_n_case_3() This return \(n\) used when case \(3\) was used to solve the ode.
This can be \(4,6\) or \(12\). If case \(3\) was not used, or no solution is found, then \(-1\) is returned.To run the full testsuite of \(3000\) ode’s that comes with the package, the command is
kovacic_tester:-unit_test_main_api(); "Test ", 6735, " PASSED " "Test ", 6736, " PASSED " "Test ", 6737, " PASSED " . . "Test ", 7579, " PASSED " "Test ", 7580, " PASSED " "Test ", 7581, " PASSED "
To run testsuite using specific cases only, the commands are
kovacic_tester:-unit_test_case_1(); kovacic_tester:-unit_test_case_2(); kovacic_tester:-unit_test_case_3();