Direct Computation of Operational Matrices for Polynomial Bases

Several numerical methods for boundary value problems use integral and di ﬀ erential operational matrices, expressed in polynomial bases in a Hilbert space of functions. This work presents a sequence of matrix operations allowing a direct computation of operational matrices for polynomial bases, orthogonal or not, starting with any previously known reference matrix. Furthermore, it shows how to obtain the reference matrix for a chosen polynomial base. The results presented here can be applied not only for integration and di ﬀ erentiation, but also for any linear operation.


Introduction
One of the main characteristics of the use of polynomial bases is to reduce the solving process of differential or integral equations to systems of algebraic equations, expressing the solution f x by truncated series approximations, up to order n 1-4 , such that The choice of the polynomial basis is normally one of the orthogonal bases belonging to the Hilbert space of functions, in order to ensure that the expansion of the series to a higher order does not affect the coefficients previously calculated, being applicable to classical methods, as the Runge-Kutta, for instance 5 .However, it is also possible to use nonorthogonal bases, as done in 6, 7 , where P i x x i , i 1, 2, . . ., n.

Mathematical Problems in Engineering
Considering C the line vector that contains the coefficients c i and B the column vector that contains the base polynomials P i , expression 1.1 can be written as considering: f N x c 0 c 1 , . . ., c n P 0 P 1 , . . ., P n T CB 8 .The central idea when working with operational matrices is to write the integral or differential of the elements of the basis as a linear combination of the same base elements, transforming the integral and differential operations of f N x into matrix operations in a Hilbert space 8 .
So, defining M I as the operational integration matrix and M D as the operational differential matrix, it is possible to obtain the line vector V containing the coefficients of the series that represent the integrated function or the differentiated function by Consequently,

1.2
Recently, Doha and Bhrawy 1 presented a method to obtain the operational matrices of integration considering the Jacobi polynomials.
Here, a simpler and more direct way to get the operational matrix, by using Theorem 2.1 from the next section is presented.Additionally, a way to extend it to any polynomial basis, by using Theorem 3.1, presented in Section 3, is also developed.
In spite of the fact that those theorems are applied to integration and differentiation operations, the result is valid to any linear operation, as shown ahead.a series the coefficients vector of which is C c 0 c 1 , . . ., c n , and V v 0 v 1 , . . ., v n the line vector of the resulting coefficients of the linear operation α applied to the series, then:
Considering that αB G ZB G and V B G C ZB G , observing the matrix and vector dimensions, this last result is a scalar and, consequently B T G V T ZB G T C T , implying that: As B T G is a generic basis, 2.2 implies 2.1 directly.

Mathematical Problems in Engineering 3
So, in order to build matrices representing actions of linear operations, as derivative and integration, the main task is to determine matrix Z and transpose it.

Example: Integration Matrix of the Legendre Polynomials
Considering that the polynomial basis is used to describe a function to be composed of Legendre polynomials, in the interval a, b −1, 1 , one can observe that, for Legendre polynomials 9 x −1 x −1 P 0 x dx P 1 x P 0 .

one can write
x −1 Pdx Z I P * , with the integral acting over to the elements of the vector.The null coefficient on the n 1 -order term assures equal dimensions for the vector to be integrated and the vector that results from the process.Following 2.3 , Z I is a square matrix Zn 2, n 2 and: iv there is no Z n 2,n 3 term, because P n 1 is not integrated.
Since the operational matrix M I is the transpose of Z I , when writing a code to implement a computational algorithm, it is required to exchange the indices in the expressions above, obtaining M I .directly.

Obtaining the Operational Matrix for Any Polynomial Basis:
The Sandwich Matrix From an operational matrix expressed in a generic reference basis X, it is possible to obtain the corresponding operational matrix in another basis G, also generic, by using a sequence of simple matrix operations, as Theorem 3.1 states.
Theorem 3.1 "Sandwich Matrix" Ω .Given a generic polynomial basis B G in the interval a, b , the matrix Z G of the operational matrix theorem is obtained by GΩG −1 , where the "sandwich matrix" is Ω X −1 Z X X, with G n 1,n 1 and X n 1,n 1 being the matrices that describe the generic polynomials G and the reference ones X in the canonic basis, respectively.
Proof.Considering that α is a linear operation: , where B C is the canonic base B C 1xx 2 , . . ., x n T , since the canonic base can be written as a function of the reference base as . Now, it is necessary to transform B X into the generic basis B G , in order to express the result as a function of the generic input base.
From the defined matrices B X XB C and B C G −1 B G , the expression given above is written as: Finally, since αB G Z G B G , the generic matrix Z G is obtained by: Z G GΩG −1 , where Ω X −1 Z X X.

Comments
i No orthogonality condition has been imposed during the proof, thus, the result is valid for all polynomial bases, orthogonal or not.
ii The operational matrix of a generic polynomial basis is given by: M G G −1 T Ω T G T .Indeed, for any linear operation: iii Since X is arbitrary, the canonic basis can be used, and thus, the matrix describing the elements of X as a function of the canonic base is the identity.So, iv Taking the previous comment into account, the matrix Z G of the generic basis can be obtained by: Z G GZ C G −1 , that is, considering the resemblance definition 9 , the matrix of the generic basis Z G is similar to or resembling matrix Z C .To summarizing, the generating matrices of the operational matrices are similarity classes related to each linear operation in the interval a, b .
v Considering the uniqueness of the result of the linear operation of differentiation on continuous functions, the differentiation matrix Ω is invariant for all polynomial bases.
vi The elements of the last column of the integration matrix are arbitrary, since they multiply a null element.Therefore, if instead of the Legendre basis another one is used to build the "sandwich matrix" Ω, these elements may be different, but the result of the integration remains the same.So, the uniqueness of the "sandwich matrix" for the integration is ensured but for the last line, the impact of which will be on the last column of the integration matrix.

Example: "Sandwich Matrix" for Integration
According to the last comment about Theorem 3.1, any polynomial basis can be used to build the "sandwich matrix" Ω, because they are all similar.For the sake of simplicity, the canonic base will be chosen.
Considering the interval −1, 1 , the matrix Z is built, in order to represent the integrals of the basis as a function of the basis itself.By defining

one can write
x −1 Xdx Z CI X * , with the integral acting over to the elements of the vector, that is, The nonnull elements Z CI Z n 2,n 2 are, therefore: As apparent in comments presented in the former subsection, for each linear operation, in the canonic basis, Z C Ω.
Considering, for instance, n 4, the "sandwich matrix" for integration Ω I is: For the interval 0, b , the elements Z k,1 , with k 1, 2, . . ., n 1 will be equal to zero, that is,

3.3
Considering the process using the shifted Legendre base up to order 4, known as shifted-Legendre, Ω is: Ω LI L −1 Z LI L, where Z T LI M LI is the integration operational matrix in the Legendre basis.For polynomials up to order 5, the matrix describing the Legendre polynomials as a function of the canonic basis is: Calculating

3.5
As mentioned, this matrix differs from the one previously obtained with the canonic basis just by the last line elements.It does not modify the integration operation, since these elements are being multiplied by a null coefficient.
The wavelets, orthogonal Jacobi polynomials shifted to the interval u ∈ R : 0 ≤ u ≤ 1 , were used in the Galerkin processes 10 , with the appropriate domain transformation.Matrix Ω can also be applied in these cases, either transforming the equation or obtaining the matrix that describes the base polynomials in the chosen interval related to the canonic base.

Example: "Sandwich Matrix" for Differentiation
Starting with the canonic base, matrix Z D can be built, describing the derivative elements of the basis as a function of the basis itself.Therefore, rewriting the vector X * defined in the former subsection: dX * /dt ZX * , with the derivative acting over the components of vector X * , d x 0 /dx 0, . . ., d x n /dx nx n 1 , for any possible considered domain.
Thus, the nonnull terms of the matrix Z D Z n 1,n 1 are Z i,i−1 i − 1, i 2, . . ., n and, according to the last comment from Section 3.1, Z CD Ω D .
Considering n 4, the differentiation matrix is given by In order to obtain this matrix from the Legendre basis, the process is analogous to the previous one.Applying Ω D L −1 Z LD L, where Z T LD is the described differentiation operational matrix.As highlighted in the third from Theorem 3.1, presented in Section 3.1, the obtained matrix Ω is identical.

Example: Chebyshev Operational Matrices for Integration and Differentiation
Some works present the Galerkin method supported by Chebyshev I expansions 11-13 , when solving differential equations.In order to help in this task, integration and differentiation Chebyshev I matrices will be obtained from the operational matrices on the Legendre basis, even though it would be easier to conduct this process using the canonic base.
Matrix T describing the Chebyshev I polynomials, as a function of the canonic basis, up to order 4 is: By using Theorem 3.1, the Legendre integration matrix M LI is known, and Chebyshev integration matrix can be obtained, by using the second comment from Section 3.1.
Consider, for instance, f x −2 − 10x 6x 2 16x 3 , x ∈ −1, 1 to be integrated in the interval −1, x .Written as a Chebyshev I series: f x 1 2 3 4 T 0 T 1 T 2 T 3 T and M TI T −1 T Ω T I T T , observing that Ω is basis independent.

Mathematical Problems in Engineering
Calculating the several matrices is the case of the example

Solving a Boundary Value Problem
In this section, an application of the method presented to build operational matrices is shown, considering the boundary value problem related to convection-diffusion equation 14 , given by: with u 0 0 and u 1 1.Firstly, in order to have a Jacobi interval domain, we change variables, v x 1 /2, with x ∈ −1, 1 obtaining the transformed equation: with u −1 0 and u 1 1.If u * x n i 0 c i P i is the series that approximates u x and M D the operational differentiation matrix, one can write: −4M 2 D C T 2bM D C T T • P x k 0, defining: This matrix equation is applied to n − 2 domain points generating a linear algebraic equations system with n − 2 equations and n unknown variables.The two missing equations are obtained from the boundary conditions: x 0 −1 and x n 1.To avoid the Runge phenomenon 15 , x k are chosen as nodes of the polynomial basis.
Figure 1 shows the exact solution and the obtained by using Legendre approximation and considering b 1 and n 5.The two solutions are too closed that, in Figure 2, the error is shown for comparison.Figure 3 shows the exact solution and the obtained by using Chebyshev approximation and considering b 20 and n 25 The two solutions are too closed that, in Figure 4, the error is shown for comparison.

Conclusion
All operational matrices applied to polynomial bases in linear operations may be obtained directly from a central matrix Ω placed between the matrix product involving the matrix describing the chosen base from the canonical base and its inverse.
Considering the available computational facilities, this method may turn the calculation of these matrices easier and quicker, on different bases, and various applications, as the Galerkin process, for instance.Furthermore, "sandwich matrix" allows for directly obtaining the recurrence relations for the derivative and integral of an element of any polynomial basis as a function of other basis elements.

Theorem 2 . 1 .
Considering Z Z n 1,n 1 a square matrix describing the resulting coefficients of a linear operation α in the generic basis B G b 0 b 1 , . . ., b n T as a function of the same basis and f N x

Figure 2 :Figure 3 :
Figure 2: Error in the solution of convection-diffusion equation with Legendre approximation b 1, n 5 .

Figure 4 :
Figure 4: Error in the solution of convection-diffusion equation with Chebyshev approximation b 20, n 25 .