====================================================================
LinearOrdinaryDifferentialOperator2
====================================================================

LinearOrdinaryDifferentialOperator2(A, M) is the domain of linear
ordinary differential operators with coefficients in the differential
ring A and operating on M, an A-module.  This includes the cases of
operators which are polynomials in D acting upon scalar or vector
expressions of a single variable.  The coefficients of the operator
polynomials can be integers, rational functions, matrices or elements
of other domains.

====================================================================
Differential Operators with Constant Coefficients
====================================================================

This example shows differential operators with rational number
coefficients operating on univariate polynomials.

We begin by making type assignments so we can conveniently refer
to univariate polynomials in x over the rationals.

  Q  := Fraction Integer
    Fraction Integer
                         Type: Domain

  PQ := UnivariatePolynomial('x, Q)
    UnivariatePolynomial(x,Fraction Integer)
                         Type: Domain

  x: PQ := 'x
    x
                         Type: UnivariatePolynomial(x,Fraction Integer)

Now we assign Dx to be the differential operator D corresponding to d/dx.

  Dx: LODO2(Q, PQ) := D()
    D
     Type: LinearOrdinaryDifferentialOperator2(Fraction Integer,
             UnivariatePolynomial(x,Fraction Integer))

New operators are created as polynomials in D().

  a := Dx  + 1
    D + 1
     Type: LinearOrdinaryDifferentialOperator2(Fraction Integer,
             UnivariatePolynomial(x,Fraction Integer))

  b := a + 1/2*Dx**2 - 1/2
    1  2       1
    - D  + D + -
    2          2
      Type: LinearOrdinaryDifferentialOperator2(Fraction Integer,
              UnivariatePolynomial(x,Fraction Integer))

To apply the operator a to the value p the usual function call syntax
is used.

  p := 4*x**2 + 2/3
      2   2
    4x  + -
          3
                     Type: UnivariatePolynomial(x,Fraction Integer)

  a p 
      2        2
    4x  + 8x + -
               3
                     Type: UnivariatePolynomial(x,Fraction Integer)

Operator multiplication is defined by the identity (a*b)p = a(b(p))

  (a * b) p = a b p
      2         37    2         37
    2x  + 12x + --= 2x  + 12x + --
                 3               3
                     Type: Equation UnivariatePolynomial(x,Fraction Integer)

Exponentiation follows from multiplication.

  c := (1/9)*b*(a + b)^2
      1  6    5  5   13  4   19  3   79  2    7     1
     -- D  + -- D  + -- D  + -- D  + -- D  + -- D + -
     72      36      24      18      72      12     8
      Type: LinearOrdinaryDifferentialOperator2(Fraction Integer,
              UnivariatePolynomial(x,Fraction Integer))

Finally, note that operator expressions may be applied directly.

  (a**2 - 3/4*b + c) (p + 1)
       2   44     541
     3x  + -- x + ---
            3      36
                     Type: UnivariatePolynomial(x,Fraction Integer)

====================================================================
Differential Operators with Matrix Coefficients Operating on Vectors}
====================================================================

This is another example of linear ordinary differential operators with
non-commutative multiplication.  Unlike the rational function case,
the differential ring of square matrices (of a given dimension) with
univariate polynomial entries does not form a field.  Thus the number
of operations available is more limited.

In this section, the operators have three by three matrix coefficients
with polynomial entries.

  PZ := UnivariatePolynomial(x,Integer)
    UnivariatePolynomial(x,Integer)
                           Type: Domain

  x:PZ := 'x
    x
                           Type: UnivariatePolynomial(x,Integer)

  Mat  := SquareMatrix(3,PZ)
    SquareMatrix(3,UnivariatePolynomial(x,Integer))
                           Type: Domain

The operators act on the vectors considered as a Mat-module.

  Vect := DPMM(3, PZ, Mat, PZ)
  DirectProductMatrixModule(3,UnivariatePolynomial(x,Integer),SquareMatrix(3,Un
  ivariatePolynomial(x,Integer)),UnivariatePolynomial(x,Integer))
                           Type: Domain

  Modo := LODO2(Mat, Vect)
  LinearOrdinaryDifferentialOperator2(SquareMatrix(3,UnivariatePolynomial(x,Int
  eger)),DirectProductMatrixModule(3,UnivariatePolynomial(x,Integer),SquareMatr
  ix(3,UnivariatePolynomial(x,Integer)),UnivariatePolynomial(x,Integer)))
                           Type: Domain

The matrix m is used as a coefficient and the vectors p and q are
operated upon.

  m:Mat := matrix [ [x^2,1,0],[1,x^4,0],[0,0,4*x^2] ]
        + 2         +
        |x   1    0 |
        |           |
        |     4     |
        |1   x    0 |
        |           |
        |          2|
        +0   0   4x +
                        Type: SquareMatrix(3,UnivariatePolynomial(x,Integer))

  p:Vect := directProduct [3*x^2+1,2*x,7*x^3+2*x]
       2          3
    [3x  + 1,2x,7x  + 2x]
    Type: DirectProductMatrixModule(3,UnivariatePolynomial(x,Integer),
             SquareMatrix(3,UnivariatePolynomial(x,Integer)),
                UnivariatePolynomial(x,Integer))

  q: Vect := m * p
       4    2        5     2        5     3
    [3x  + x  + 2x,2x  + 3x  + 1,28x  + 8x ]
      Type: DirectProductMatrixModule(3,UnivariatePolynomial(x,Integer),
         SquareMatrix(3,UnivariatePolynomial(x,Integer)),
            UnivariatePolynomial(x,Integer))

Now form a few operators.

  Dx : Modo := D()
    D
      Type: LinearOrdinaryDifferentialOperator2(
             SquareMatrix(3,UnivariatePolynomial(x,Integer)),
             DirectProductMatrixModule(3,UnivariatePolynomial(x,Integer),
             SquareMatrix(3,UnivariatePolynomial(x,Integer)),
             UnivariatePolynomial(x,Integer)))

  a : Modo := Dx  + m
             + 2         +
             |x   1    0 |
             |           |
         D + |     4     |
             |1   x    0 |
             |           |
             |          2|
             +0   0   4x +
    Type: LinearOrdinaryDifferentialOperator2(
             SquareMatrix(3,UnivariatePolynomial(x,Integer)),
             DirectProductMatrixModule(3,UnivariatePolynomial(x,Integer),
             SquareMatrix(3,UnivariatePolynomial(x,Integer)),
             UnivariatePolynomial(x,Integer)))

  b : Modo := m*Dx  + 1
         + 2         +
         |x   1    0 |    +1  0  0+
         |           |    |       |
         |     4     |D + |0  1  0|
         |1   x    0 |    |       |
         |           |    +0  0  1+
         |          2|
         +0   0   4x +
     Type: LinearOrdinaryDifferentialOperator2(
              SquareMatrix(3,UnivariatePolynomial(x,Integer)),
              DirectProductMatrixModule(3,UnivariatePolynomial(x,Integer),
              SquareMatrix(3,UnivariatePolynomial(x,Integer)),
              UnivariatePolynomial(x,Integer)))

  c := a*b
  + 2         +     + 4              4    2                  +    + 2         +
  |x   1    0 |     |x  + 2x + 2    x  + x            0      |    |x   1    0 |
  |           | 2   |                                        |    |           |
  |     4     |D  + |   4    2     8     3                   |D + |     4     |
  |1   x    0 |     |  x  + x     x  + 4x  + 2        0      |    |1   x    0 |
  |           |     |                                        |    |           |
  |          2|     |                              4         |    |          2|
  +0   0   4x +     +     0            0        16x  + 8x + 1+    +0   0   4x +
    Type: LinearOrdinaryDifferentialOperator2(
            SquareMatrix(3,UnivariatePolynomial(x,Integer)),
            DirectProductMatrixModule(3,UnivariatePolynomial(x,Integer),
            SquareMatrix(3,UnivariatePolynomial(x,Integer)),
            UnivariatePolynomial(x,Integer)))

These operators can be applied to vector values.

  a p
        4    2        5     2        5     3      2
     [3x  + x  + 8x,2x  + 3x  + 3,28x  + 8x  + 21x  + 2]
       Type: DirectProductMatrixModule(3,UnivariatePolynomial(x,Integer),
               SquareMatrix(3,UnivariatePolynomial(x,Integer)),
                  UnivariatePolynomial(x,Integer))

  b p
        3     2       4         4     3     2
     [6x  + 3x  + 3,2x  + 8x,84x  + 7x  + 8x  + 2x]
        Type: DirectProductMatrixModule(3,UnivariatePolynomial(x,Integer),
                SquareMatrix(3,UnivariatePolynomial(x,Integer)),
                  UnivariatePolynomial(x,Integer))

  (a + b + c) (p + q)
       8      7      6      5      4      3      2
   [10x  + 12x  + 16x  + 30x  + 85x  + 94x  + 40x  + 40x + 17,
       12      9      8      7     6      5      4      3      2
    10x   + 10x  + 12x  + 92x  + 6x  + 32x  + 72x  + 28x  + 49x  + 32x + 19,
         8       7        6        5       4       3      2
    2240x  + 224x  + 1280x  + 3508x  + 492x  + 751x  + 98x  + 18x + 4]
     Type: DirectProductMatrixModule(3,UnivariatePolynomial(x,Integer),
             SquareMatrix(3,UnivariatePolynomial(x,Integer)),
               UnivariatePolynomial(x,Integer))

See Also:
o )show LinearOrdinaryDifferentialOperator2

