This MATHEMATICA notebook duplicates the commands presented on pages 28-30 of my Memoir titled ''Basic Global Relative Invariants for Homogeneous Linear Differential Equations."  Prior to this program, computations were done with rational functions and the   Together[  ]  command was helpful.  Then, by eliminating rational functions and dealing only with polynomials, the two Together[  ] commands were no longer needed: but, they were retained.  This caused no difficulty for Version 3.0 of MATHEMATICA;  but, for  Version 4.1 of MATHEMATICA, it caused the computations to run much more slowly.  

The expression  Inv[n, n]  is computed as a semi-invariant of the first kind of weight  n  for homogeneous linear differential equations of order  m  for any  m  satisfying  m ≥ n.  The expression  J[n, n]  is computed as a semi-invariant of the second kind for homogeneous linear differential equations of order  m  for any m  satisfying  m ≥ n.   The equality of  I[n, n]  and  J[n, n]  shows that each is both a semi-invariant of the first kind and a semi-invariant of the second kind and therefore a relative invariant for homogeneous linear differential equations of any order  m  that satisfies  m ≥ n.

When done with  p = 7,   the following computation can be completed in less than two minutes.  The initial assignment  ( p = 7,  p = 8, p = 9, p = 10, p = 11, etc.) can be gradually increased until the capacity of the computer is exceeded or computation times become inconveniently long.

$Version

In versions of MATHEMATICA before 3.0, it would have been necessary to read in a package for the evaluation of symbolic sums.  Starting with Version 3.0, it is not necessary to read in any special packages for the following evaluations.

p = 12;   Date[]

TrueQ[$VersionNumber >= 3.0]

a[2][z_] := b[2][z] - D[b[1][z],z]/2 - (b[1][z])^2/4

w[0][z_] = 1;

w[1][z_] = Binomial[m,2]*b[1][z];

w[2][z_] = (Binomial[m+1,3]*a[2][z] + ((m-1)/2)*D[w[1][z],z]
                + ((m-1)/(2m))*(w[1][z])^2);

K[-1, j_][z_]  =  0;

K[0, j_][z_]  =  1;

\(\(summandK[i_, j_]\)[z_]\  := \ 
      Expand[Together[
          D[\(K[i, j]\)[z], 
              z]
		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  - \ \((\((m - 1)\)*\(b[1]\)[
                    z]*\(K[i, j]\)[z])\)/
              2
			 + \ \((m - i - j + 1)\)*\((1 - i - j)\)*\(a[2]\)[
                z]*\(K[i - 1, j]\)[z]]]\)

Do[PowerSum[n, j_]  =  Sum[k^n,  {k,  j + 1,  m}],  {n, 0, 
        2  p + 1} ]

\(Do[\ \(K[i, j_]\)[z_]\  = \ 
        Module[{t, 
            k}, \ 
			\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ t\  = \ 
            Expand[\ \(summandK[i - 1, k]\)[
                z]\ ]; 
			\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Sum[
            Coefficient[t, k, n]*
              PowerSum[n, 
                j], 
				\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {n, 0, 2*i - 1}]\ ], \ {i, 1, p}]\)

Do[ L[i][z_]  =  
        Sum[K[i - j, j][z]*w[j][z],  {j, 0, i}],  {i, 3, 
        p}]

U[-1, j_][z_]  =  0;

U[0, j_][z_]  =  1;

\(\(summandForU[i_, j_]\)[z_]\  := \ 
      Expand[Together[
          D[\(U[i, j]\)[z], 
              z]
		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  + \ \((i + j - m)\)*\(b[1]\)[
                z]*\(U[i, j]\)[
                z]
\ 	\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  + \ \((m - i - j + 1)\)*\((1 - i - j)\)*\(b[2]\)[z]*\(U[i - 1, j]\)[
                z]]]\)

\(Do[\ \(U[i, j_]\)[z_]\  = \ 
        Module[{u, 
            r}, \ 
			\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ u\  = \ 
            Expand[\ \(summandForU[i - 1, r]\)[
                z]]; 
			\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Sum[\ 
            Coefficient[u, r, n]*
              PowerSum[n, 
                j], \ 
				\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {n, 0, 2  i - 1}]], \ {i, 1, p}]\)

Do[ V[i][z_]  =  
        Sum[ U[i - j, j][z]*w[j][z],  {j, 0, i}], {i, 3, 
        p}]

\(kappa[n_, 
        i_]\  := \ \((\(-i\)*\((m - 
                  i)\)/\((\((n - i)\)*\((n + i - 
                      1)\))\) /; \ 
		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \((n >= 3 && i >= 2 && 
              i <= n - 1)\))\)\)

\(lambda[n_, 
        i_]\  := \ \((i*\((i - 1)\)*\((m - 
                i)\)*\((m - i + 
                  1)\)/\((\((n - i + 1)\)*\((n + i - 
                      2)\))\) /; 
			\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \((n >= 3 && i >= 2 && 
              i <= n - 1)\))\)\)

Inv[n_, i_][
        z_]  :=  (0  /; (n >= 3 && i >= 1 && 
              i <= 2))

\(\(\(Do[\ \(Inv[n, n]\)[z_]\  = \ \((\ 
          Do[\ \(Inv[n, i]\)[
                z]\  = \ 
				\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Expand[\ \(L[i]\)[z]\  + \ 
                  kappa[n, i - 1]*
                    D[\ \(Inv[n, i - 1]\)[z], \ 
                      z]
							\ \ \ \ \ \ \ \  + \ 
                  lambda[n, i - 1]*\(a[2]\)[z]*\(Inv[n, i - 2]\)[z]\ ], \ {i, 
              3, n}\ ]; 
			\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(Inv[
              n, n]\)[z]\ )\), \ {n, 3, p}]\)\(\ \)\)\)

J[n_, i_][
        z_]  :=  (0 /; (n >= 3 && i >= 1 && i <= 2))

\(\(\(Do[\ \(J[n, n]\)[z_]\  = \ \((\ 
          Do[\(J[n, i]\)[
                z]\  = \ 
				\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Expand[\ \(V[i]\)[z]\  + \ 
                  kappa[n, 
                      i - 1]*\((D[\(J[n, i - 1]\)[z], \ 
                          z]
								\ \ \ \ \ \ \ \ \ \ \ \  + \ \((i - 1)\)*\(b[1]\)[z]*\(J[n, i - 1]\)[
                            z])\)
							\ \ \ \ \ \ \ \ \ \ \ \ \ \  + \ lambda[n, i - 1]*\(b[2]\)[z]*\(J[n, i - 2]\)[z]\ ], \ {i, 3, 
              n}]; 
			\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(J[n, n]\)[z])\), \ {n, 3, p}]\)\(\ \)\)\)

\(Do[\ 
      Print["Inv[", \ i, \ ", ", \ i, \ "][z] - J[", \ 
        i, \ ", ", \ 
        i, \ "][z] = ", 
		\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Expand[\ \(Inv[i, i]\)[z]\  - \ \(J[i, i]\)[z]\ ]\ ], \ {i, 3, p}]\)

{MaxMemoryUsed[],  Date[]}

This computation for the case p = 12 was performed by a 930 MHz Dell PC having  512 MB of RAM and required less than fifteen minutes.  An earlier computer of mine acquired in 1993 with 64 MB of RAM and a speed of 66MHz was able to satisfactorily run the case p = 10; and it required 2 days to do so.   It was the computer used to discover the main identities (and was my own purchase back in the days whem random access memory was considerably more expensive than today).

The condition  (n>=3&&i>=2&&i<=n-1) added to the definitions of kappa[n,i] and lambda[n,i] and the condition (n>=3&&i>=1&&i<=2) added to the definitions of Inv[n,i][z] and J[n,i][z] are not needed for the program to run correctly.  They have been added so that anyone examining how the program works would not be unnecessarily concerned about something that is not essential.