Abstract

A shifted Jacobi Galerkin method is introduced to get a direct solution technique for solving the third- and fifth-order differential equations with constant coefficients subject to initial conditions. The key to the efficiency of these algorithms is to construct appropriate base functions, which lead to systems with specially structured matrices that can be efficiently inverted. A quadrature Galerkin method is introduced for the numerical solution of these problems with variable coefficients. A new shifted Jacobi collocation method based on basis functions satisfying the initial conditions is presented for solving nonlinear initial value problems. Through several numerical examples, we evaluate the accuracy and performance of the proposed algorithms. The algorithms are easy to implement and yield very accurate results.

1. Introduction

The spectral methods are preferable in numerical solutions of ordinary and partial differential equations due to their high-order accuracy whenever they work [13]. Standard spectral and collocation methods have been extensively investigated for solving second- and fourth-order differential equations. In a sequence of papers [411], the authors have constructed efficient spectral-Galerkin algorithms for second-, fourth-, and 2𝑛th-order differential equations subject to various boundary conditions.

The problem of approximating solutions of differential equations by Galerkin approximations involves the projection onto the span of some appropriate set of basis functions. The member of the basis may satisfy automatically the auxiliary conditions imposed on the problem, such as initial, boundary, or more general conditions. Alternatively, these conditions may be imposed as constraints on the expansions coefficients, as in the Lanczos tau-method [1214].

It is of fundamental importance to know that the choice of the basis functions is responsible for the superior approximation properties of spectral methods when compared with the finite difference and finite element methods. The choice of different basis functions lead to different spectral approximations; for instance, trigonometric polynomials for periodic problems, Chebyshev, Legendre, ultraspherical, and Jacobi polynomials for nonperiodic problems, Laguerre polynomials for problems on half line, and Hermite polynomials for problems on the whole line.

The main aim of this paper is the design of appropriate shifted Jacobi basis (with parameters 𝛼 and 𝛽) that are well suited for the approximations of the third- and fifth-order differential equations subject to initial conditions. In general, the use of Jacobi polynomials (𝑃𝑛(𝛼,𝛽) with 𝛼, 𝛽(1,) and 𝑛 is the polynomial degree) has the advantage of obtaining the solutions of differential equations in terms of the Jacobi indexes 𝛼 and 𝛽 (see for instance, [1519]).

This paper is concerned with the systematic development of spectral basis functions for the efficient solution of some odd-order differential equations. Starting from Jacobi polynomials 𝑃𝑛(𝛼,𝛽)(𝑥). Galerkin approximations to these problems are built. We derived some interesting results, such as useful relationships between the representation of a polynomial function in a given basis and those for its derivative in the same basis, or formulas to compute discrete operator coefficients in closed form. In this paper, we present a direct solvers based on the shifted Jacobi Galerkin (SJG) method for solving the third- and fifth-order differential equations, the basis functions are constructed to satisfy the given initial conditions, and each of these basis functions have been written as a compact combinations of shifted Jacobi polynomials.

For the third- and fifth-order differential equations with variable coefficients, we introduce the pseudospectral shifted Jacobi Galerkin (P-SJG) method. This method is basically formulated in the shifted Jacobi Galerkin spectral form with general indexes 𝛼, 𝛽>1, but the variable coefficients terms and the right hand side being treated by the shifted Jacobi collocation method with the same indexes 𝛼, 𝛽>1 so that the schemes can be implemented at shifted Jacobi-Gauss points efficiently.

The last aim of this paper is to propose a suitable way to approximate the nonlinear third- and fifth-order differential equations by convenient spectral collocation method-based on shifted Jacobi basis functions (the member of the basis may satisfy automatically the auxiliary initial conditions imposed on the problem) such that it can be implemented efficiently at shifted Jacobi-Gauss points on the interval (0,𝐿). We propose a new spectral shifted Jacobi collocation (SJC) method to find the solution 𝑢𝑁(𝑥). The nonlinear ODE is collocated at the (𝑁+1) points. For suitable collocation points, we use the (𝑁+1) nodes of the shifted Jacobi-Gauss interpolation on (0,𝐿). These equations generate (𝑁+1) nonlinear algebraic equations which can be solved using Newton's iterative method. Finally, the accuracy of the proposed methods is demonstrated by test problems. Numerical results are presented in which the usual exponential convergence behaviour of spectral approximations is exhibited.

The remainder of this paper is organized as follows. Sections 2 and 3 are devoted to the theoretical derivation of the SJG and P-SJG methods for third-order differential equations with constant and variable coefficients subject to homogeneous and nonhomogeneous initial conditions. In Section 4, we apply the SJC method-based on basis functions for solving nonlinear third-order differential equations. Section 5 gives the corresponding results for those obtained in Sections 2, 3, and 4, but for the fifth-order differential equations. In Section 6, we present some numerical results exhibiting the accuracy and efficiency of our numerical algorithms.

2. SJG Method for Third-Order Differential Equations with Constant Coefficients

Let 𝑤(𝛼,𝛽)(𝑥)=(1𝑥)𝛼(1+𝑥)𝛽, then we define the weighted space 𝐿2𝑤(𝛼,𝛽)(1,1) as usual, equipped with the following inner product and norm, (𝑢,𝑣)𝑤(𝛼,𝛽)=11𝑢(𝑥)𝑣(𝑥)𝑤(𝛼,𝛽)(𝑥)𝑑𝑥,𝑣𝑤(𝛼,𝛽)=(𝑣,𝑣)𝑤1/2(𝛼,𝛽).(2.1) The set of Jacobi polynomials forms a complete 𝐿2𝑤𝛼,𝛽(1,1)-orthogonal system, and 𝑃𝑘(𝛼,𝛽)2𝑤(𝛼,𝛽)=𝑘(𝛼,𝛽)=2𝛼+𝛽+1Γ(𝑘+𝛼+1)Γ(𝑘+𝛽+1)(.2𝑘+𝛼+𝛽+1)Γ(𝑘+1)Γ(𝑘+𝛼+𝛽+1)(2.2)

If we define the shifted Jacobi polynomial of degree 𝑘 by 𝑃(𝛼,𝛽)𝐿,𝑘(𝑥)=𝑃𝑘(𝛼,𝛽)(2𝑥/𝐿1), 𝐿>0, and in virtue of properties of Jacobi polynomials [14, 19], then it can be easily shown that 𝑃(𝛼,𝛽)𝐿,𝑘(0)=(1)𝑘Γ(𝑘+𝛽+1),𝐷Γ(𝛽+1)𝑘!(2.3)𝑞𝑃(𝛼,𝛽)𝐿,𝑘(0)=(1)𝑘𝑞Γ(𝑘+𝛽+1)(𝑘+𝛼+𝛽+1)𝑞𝐿𝑞.Γ(𝑘𝑞+1)Γ(𝑞+𝛽+1)(2.4)

Next, let 𝑤𝐿(𝛼,𝛽)(𝑥)=(𝐿𝑥)𝛼𝑥𝛽, then we define the weighted space 𝐿2𝑤𝐿(𝛼,𝛽)(0,𝐿) in the usual way, with the following inner product and norm, (𝑢,𝑣)𝑤𝐿(𝛼,𝛽)=𝐿0𝑢(𝑥)𝑣(𝑥)𝑤𝐿(𝛼,𝛽)(𝑥)𝑑𝑥,𝑣𝑤𝐿(𝛼,𝛽)=(𝑣,𝑣)𝑤1/2𝐿(𝛼,𝛽).(2.5)

The set of shifted Jacobi polynomials forms a complete 𝐿2𝑤𝐿(𝛼,𝛽)(0,𝐿)-orthogonal system. Moreover, and due to (2.2), we have 𝑃(𝛼,𝛽)𝐿,𝑘2𝑤𝐿(𝛼,𝛽)=𝐿2𝛼+𝛽+1𝑘(𝛼,𝛽)=(𝛼,𝛽)𝐿,𝑘.(2.6)

The 𝑞th derivative of shifted Jacobi polynomial can be written in terms of the shifted Jacobi polynomials themselves as 𝐷𝑞𝑃(𝛼,𝛽)𝐿,𝑘(𝑥)=𝑘𝑞𝑖=0𝐶𝑞(𝑘,𝑖,𝛼,𝛽)𝑃(𝛼,𝛽)𝐿,𝑖(𝑥),(2.7) where 𝐶𝑞(𝑘,𝑖,𝛼,𝛽)=(𝑘+𝜆)𝑞(𝑘+𝜆+𝑞)𝑖(𝑖+𝛼+𝑞+1)𝑘𝑖𝑞Γ(𝑖+𝜆)𝐿𝑞×(𝑘𝑖𝑞)!Γ(2𝑖+𝜆)3𝐹2,𝑘+𝑖+𝑞,𝑘+𝑖+𝜆+𝑞,𝑖+𝛼+1;1𝑖+𝛼+𝑞+1,2𝑖+𝜆+1(2.8) for the proof, see [20, 21] and for the general definition of a generalized hypergeometric series and special 3𝐹2, (see [22, pages 41, 103-104], resp.).

We are interested in using the SJG method to solve the third-order differential equation: 𝑢+𝛾1𝑢+𝛾2𝑢+𝛾3𝑢=𝑓(𝑥),in𝐼=(0,𝐿),(2.9) subject to 𝑢(0)=𝑢(0)=𝑢(0)=0,(2.10) where 𝛾1, 𝛾2, and 𝛾3 are constants, and 𝑓(𝑥) is a given source function. Let us first introduce some basic notation that will be used in the upcoming sections. We set 𝑆𝑁𝑃(0,𝐿)=span(𝛼,𝛽)𝐿,0(𝑥),𝑃(𝛼,𝛽)𝐿,1(𝑥),,𝑃(𝛼,𝛽)𝐿,𝑁,𝑊(𝑥)𝑁=𝑣𝑁𝑆𝑁(0,𝐿)𝑢(0)=𝑢(0)=𝑢.(0)=0(2.11) Then the shifted Jacobi-Galerkin approximation to (2.9) is, to find 𝑢𝑁𝑊𝑁 such that 𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽)+𝛾1𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽)+𝛾2𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽)+𝛾3𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽)=𝑓,𝑣𝑁𝑤𝐿(𝛼,𝛽),𝑣𝑁𝑊𝑁,(2.12) where 𝑤𝐿(𝛼,𝛽)(𝑥)=(𝐿𝑥)𝛼𝑥𝛽 and (𝑢,𝑣)𝑤𝐿(𝛼,𝛽)=𝐼𝑢𝑣𝑤𝐿𝛼,𝛽𝑑𝑥 is the inner product in the weighted space 𝐿2𝑤𝐿(𝛼,𝛽)(𝐼). The norm in 𝐿2𝑤𝐿(𝛼,𝛽)(𝐼) will be denoted by 𝑤𝐿(𝛼,𝛽).

We choose compact combinations of shifted Jacobi polynomials as basis functions aiming to minimize the bandwidth and the condition number of the coefficient matrix corresponding to (2.9). We choose the basis functions of expansion 𝜙𝑘(𝑥) to be of the form: 𝜙𝑘(𝑥)=𝜉𝑘𝑃(𝛼,𝛽)𝐿,𝑘(𝑥)+𝜖𝑘𝑃(𝛼,𝛽)𝐿,𝑘+1(𝑥)+𝜀𝑘𝑃(𝛼,𝛽)𝐿,𝑘+2(𝑥)+𝜁𝑘𝑃(𝛼,𝛽)𝐿,𝑘+3(𝑥),(2.13) where 𝜉𝑘=𝑘!Γ(𝛼+1)/Γ(𝑘+𝛼+1), 𝜖𝑘, 𝜀𝑘, and 𝜁𝑘 are the unique constants such that 𝜙𝑘(𝑥)𝑊𝑁, for all 𝑘=0,1,,𝑁3. From the initial conditions; 𝜙𝑘(0)=𝜙𝑘(0)=𝜙𝑘(0)=0 and making use of (2.3) and (2.4), we have the following system: 𝜖𝑘(𝑘+𝛽+1)(𝑘+1)+𝜖𝑘(𝑘+𝛽+1)2(𝑘+1)2𝜁𝑘(𝑘+𝛽+1)3(𝑘+1)3𝜖=1,(2.14)𝑘(𝑘+𝜆+1)(𝑘+𝛽+1)𝑘𝜀𝑘(𝑘+𝜆+2)(𝑘+𝛽+1)2𝑘(𝑘+1)+𝜁𝑘(𝑘+𝜆+3)(𝑘+𝛽+1)3𝑘(𝑘+1)2=(𝑘+𝜆),(2.15)𝜖𝑘(𝑘+𝜆+1)2(𝑘+𝛽+1)(𝑘1)+𝜀𝑘(𝑘+𝜆+2)2(𝑘+𝛽+1)2𝑘(𝑘1)𝜁𝑘(𝑘+𝜆+3)2(𝑘+𝛽+1)3(𝑘+1)𝑘(𝑘1)=(𝑘+𝜆)2.(2.16) Hence 𝜖𝑘, 𝜀𝑘, and 𝜁𝑘 can be uniquely determined to give 𝜖𝑘=3(𝑘+1)(2𝑘+𝜆+2)(,𝜀𝑘+𝛽+1)(2𝑘+𝜆+4)𝑘=3(𝑘+1)2(2𝑘+𝜆+1)(𝑘+𝛽+1)2,𝜁(2𝑘+𝜆+5)𝑘=(𝑘+1)3(2𝑘+𝜆+1)2(𝑘+𝛽+1)3(2𝑘+𝜆+4)2.(2.17) It is clear that the basis functions 𝜙𝑘(𝑥)𝑊𝑘+3, 𝑘=0,1,2,,𝑁3, are linearly independent. Therefore, by dimension argument and for 𝑁3, we have 𝑊𝑁𝜙=span𝑘(𝑥)𝑘=0,1,2,,𝑁3.(2.18)

Now, it is clear that the variational formulation of (2.12) is equivalent to 𝑢𝑁,𝜙𝑘(𝑥)𝑤𝐿(𝛼,𝛽)+𝛾1𝑢𝑁,𝜙𝑘(𝑥)𝑤𝐿(𝛼,𝛽)+𝛾2𝑢𝑁,𝜙𝑘(𝑥)𝑤𝐿(𝛼,𝛽)+𝛾3𝑢𝑁,𝜙𝑘(𝑥)𝑤𝐿(𝛼,𝛽)=𝑓,𝜙𝑘(𝑥)𝑤𝑇(𝛼,𝛽),𝑘=0,1,,𝑁3.(2.19) Let us denote 𝑓𝑘=𝑓,𝜙𝑘(𝑥)𝑤𝐿(𝛼,𝛽)𝑓,𝐟=0,𝑓1,,𝑓𝑁3𝑇,𝑢𝑁(𝑥)=𝑁3𝑛=0𝑎𝑛𝜙𝑛(𝑎𝑥),𝐚=0,𝑎1,,𝑎𝑁3𝑇,𝑎𝐴=𝑘𝑗𝑏,𝐵=𝑘𝑗𝑐,𝐶=𝑘𝑗𝑑,𝐷=𝑘𝑗,0𝑘,𝑗𝑁3.(2.20) Then, equation (2.19) is equivalent to the following matrix equation: 𝐴+𝛾1𝐵+𝛾2𝐶+𝛾3𝐷𝐚=𝐟,(2.21) where the nonzero elements of the matrices 𝐴, 𝐵, 𝐶, and 𝐷 are given explicitly in the following theorem.

Theorem 2.1. If one takes 𝜙𝑘(𝑥) as defined in (2.13), and if we denote 𝑎𝑘𝑗=(𝜙𝑗(𝑥),𝜙𝑘(𝑥))𝑤𝐿(𝛼,𝛽), 𝑏𝑘𝑗=(𝜙𝑗(𝑥),𝜙𝑘(𝑥))𝑤𝐿(𝛼,𝛽), 𝑐𝑘𝑗=(𝜙𝑗(𝑥),𝜙𝑘(𝑥))𝑤𝐿(𝛼,𝛽), and 𝑑𝑘𝑗=(𝜙𝑗(𝑥),𝜙𝑘(𝑥))𝑤𝐿(𝛼,𝛽). Then the nonzero elements 𝑎𝑘𝑗,𝑏𝑘𝑗,𝑐𝑘𝑗, and 𝑑𝑘𝑗 for 0𝑘, 𝑗𝑁3 are given as follows: 𝑎𝑘𝑘=𝐿𝛼+𝛽2(2𝑘+𝜆+1)3(2𝑘+𝜆+1)2Γ(𝑘+4)(Γ(𝛼+1))2Γ(𝑘+𝛽+1)(𝑘+𝛽+1)3,𝑎Γ(𝑘+𝛼+1)Γ(𝑘+𝜆+3)𝑘𝑗=𝜉𝑘𝜉𝑗𝑂3(𝑗,𝑘,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+𝑂3(𝑗,𝑘+1,𝛼,𝛽)𝜖𝑘(𝛼,𝛽)𝐿,𝑘+1+𝑂3(𝑗,𝑘+2,𝛼,𝛽)𝜀𝑘(𝛼,𝛽)𝐿,𝑘+2+𝑂3(𝑗,𝑘+3,𝛼,𝛽)𝜁𝑘(𝛼,𝛽)𝐿,𝑘+3𝑏,𝑗=𝑘+𝑛,𝑛1,𝑘+1,𝑘=𝜉𝑘𝜉𝑘+1𝜁𝑘𝐶2(𝑘+3,𝑘+1,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+1,𝑏𝑘𝑘=𝜉2𝑘𝜀𝑘𝐶2(𝑘+2,𝑘,𝛼,𝛽)+𝜁𝑘𝐶2(𝑘+3,𝑘,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+𝜁𝑘𝜖𝑘𝐶2(𝑘+3,𝑘+1,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+1,𝑏𝑘𝑗=𝜉𝑘𝜉𝑗𝑂2(𝑗,𝑘,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+𝑂2(𝑗,𝑘+1,𝛼,𝛽)𝜖𝑘(𝛼,𝛽)𝐿,𝑘+1+𝑂2(𝑗,𝑘+2,𝛼,𝛽)𝜀𝑘(𝛼,𝛽)𝐿,𝑘+2+𝑂2(𝑗,𝑘+3,𝛼,𝛽)𝜁𝑘(𝛼,𝛽)𝐿,𝑘+3𝑐,𝑗=𝑘+𝑛,𝑛1,𝑘+2,𝑘=𝜉𝑘𝜉𝑘+2𝜁𝑘𝐶1(𝑘+3,𝑘+2,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+2,𝑐𝑘+1,𝑘=𝜉𝑘𝜉𝑘+1𝜀𝑘𝐶1(𝑘+2,𝑘+1,𝛼,𝛽)+𝜁𝑘𝐶1(𝑘+3,𝑘+1,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+1+𝜁𝑘𝜖𝑘+1𝐶1(𝑘+3,𝑘+2,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+2,𝑐𝑘𝑘=𝜉2𝑘𝜖𝑘𝐶1(𝑘+1,𝑘,𝛼,𝛽)+𝜀𝑘𝐶1(𝑘+2,𝑘,𝛼,𝛽)+𝜁𝑘𝐶1(𝑘+3,𝑘,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+𝜖𝑘𝜀𝑘𝐶1(𝑘+2,𝑘+1,𝛼,𝛽)+𝜁𝑘𝐶1(𝑘+3,𝑘+1,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+1+𝜁𝑘𝜀𝑘𝐶1(𝑘+3,𝑘+2,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+2,𝑐𝑘𝑗=𝜉𝑘𝜉𝑗𝑂1(𝑗,𝑘,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+𝑂1(𝑗,𝑘+1,𝛼,𝛽)𝜖𝑘(𝛼,𝛽)𝐿,𝑘+1+𝑂1(𝑗,𝑘+2,𝛼,𝛽)𝜀𝑘(𝛼,𝛽)𝐿,𝑘+2+𝑂1(𝑗,𝑘+3,𝛼,𝛽)𝜁𝑘(𝛼,𝛽)𝐿,𝑘+3𝑑,𝑗=𝑘+𝑛,𝑛1,𝑘𝑘=𝜉2𝑘(𝛼,𝛽)𝐿,𝑘+𝜖2𝑘(𝛼,𝛽)𝐿,𝑘+1+𝜀2𝑘(𝛼,𝛽)𝐿,𝑘+2+𝜁2𝑘(𝛼,𝛽)𝐿,𝑘+3,𝑑𝑘+1,𝑘=𝑑𝑘,𝑘+1=𝜉𝑘𝜉𝑘+1𝜖𝑘(𝛼,𝛽)𝐿,𝑘+1+𝜖𝑘+1𝜀𝑘(𝛼,𝛽)𝐿,𝑘+2+𝜀𝑘+1𝜁𝑘(𝛼,𝛽)𝐿,𝑘+3,𝑑𝑘+2,𝑘=𝑑𝑘,𝑘+2=𝜉𝑘𝜉𝑘+2𝜀𝑘(𝛼,𝛽)𝐿,𝑘+2+𝜖𝑘+2𝜁𝑘(𝛼,𝛽)𝐿,𝑘+3,𝑑𝑘+3,𝑘=𝑑𝑘,𝑘+3=𝜉𝑘𝜉𝑘+3𝜁𝑘(𝛼,𝛽)𝐿,𝑘+3,(2.22) where 𝑂𝑖(𝑗,𝑘,𝛼,𝛽)=𝐶𝑖(𝑗,𝑘,𝛼,𝛽)+𝜖𝑗𝐶𝑖(𝑗+1,𝑘,𝛼,𝛽)+𝜀𝑗𝐶𝑖(𝑗+2,𝑘,𝛼,𝛽)+𝜁𝑗𝐶𝑖(𝑗+3,𝑘,𝛼,𝛽).(2.23)

Proof. The basis functions 𝜙𝑘(𝑥) are chosen such that 𝜙𝑘(𝑥)𝑊𝑁 for 𝑘=0,1,,𝑁3. On the other hand, it is clear that {𝜙𝑘(𝑥)} are linearly independent and the dimension of 𝑊𝑁 is equal to (𝑁2). The nonzero elements (𝑎𝑘𝑗) for 0𝑘, 𝑗𝑁3 can be obtained by direct computations using the properties of shifted Jacobi polynomials. It can be easily proved that the diagonal elements of the matrix A take the form: 𝑎𝑘𝑘=𝜉2𝑘𝜁𝑘𝐶3(𝑘+3,𝑘,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘.(2.24) It can be easily shown, that all other formulae can be obtained by direct computations using the properties of shifted Jacobi polynomials.

All the formulae can be obtained by direct computations using the properties of shifted Jacobi polynomials. In particular, the special cases for shifted Chebyshev basis of the first and second kinds may be obtained directly by taking 𝛼=𝛽=1/2 and 𝛼=𝛽=1/2, respectively, and for shifted Legendre basis by taking 𝛼=𝛽=0. These are given as corollaries to the previous theorem as follows.

Corollary 2.2. If 𝛼=𝛽=0, then the nonzero elements (𝑎𝑘𝑗), (𝑏𝑘𝑗), (𝑐𝑘𝑗),(𝑑𝑘𝑗) for 0𝑘, 𝑗𝑁3 are given as follows: 𝑎𝑘𝑘=8(𝑘+1)(2𝑘+3)2𝐿2,𝑎(𝑘+3)𝑘𝑗=8(2𝑗+3)(2𝑘+3)𝐿2×𝑘(𝑗+3)(𝑘+3)4+8𝑘3+178𝑗2𝑗2𝑘2+418𝑗2𝑗2𝑗𝑘+4+8𝑗3+17𝑗2,𝑏+16𝑗=𝑘+𝑛,𝑛1,𝑘+1,𝑘=4(𝑘+1)(2𝑘+3)𝐿(𝑘+3),𝑏𝑘𝑘=48(𝑘+1)(𝑘+2)(2𝑘+3),𝑏𝐿(𝑘+3)(2𝑘+5)𝑘,𝑘+1=4(2𝑘+3)17𝑘2+85𝑘+104,𝑏𝐿(𝑘+3)(𝑘+4)𝑘𝑗=16(2𝑗+3)(𝑗𝑘)(𝑗+𝑘+4)(2𝑘+3)𝑐𝐿(𝑗+3)(𝑘+3),𝑗=𝑘+𝑛,𝑛2,𝑘+2,𝑘=2(𝑘+1)(2𝑘+3)(𝑘+3)(2𝑘+5),𝑐𝑘+1,𝑘=12(𝑘+1)(2𝑘+5),𝑐(𝑘+3)(2𝑘+7)𝑘𝑘=8(2𝑘+3)2(𝑘+3)2,𝑐𝑘,𝑘+1=4(2𝑘+5)13𝑘2+65𝑘+72,𝑐(𝑘+3)(𝑘+4)(2𝑘+7)𝑘,𝑘+2=2(2𝑘+3)31𝑘2+186𝑘+275,𝑐(𝑘+3)(𝑘+5)(2𝑘+5)𝑘𝑗=16(2𝑗+3)(2𝑘+3)𝑑(𝑗+3)(𝑘+3),𝑗=𝑘+𝑛,𝑛3,𝑘𝑘=40𝐿(𝑘+1)(𝑘+2)(2𝑘+3)(𝑘+3)(2𝑘+1)(2𝑘+5)(2𝑘+7),𝑑𝑘,𝑘+1=𝑑𝑘+1,𝑘=15𝐿(𝑘+2),𝑑(𝑘+4)(2𝑘+7)𝑘,𝑘+2=𝑑𝑘+2,𝑘=12𝐿(𝑘+1)(2𝑘+5)(2𝑘+9),𝑑𝑘,𝑘+3=𝑑𝑘+3,𝑘=𝐿(𝑘+1)(2𝑘+3).(𝑘+3)(2𝑘+5)(2𝑘+7)(2.25)

Corollary 2.3. If 𝛼=𝛽=1/2, then the nonzero elements (𝑎𝑘𝑗),(𝑏𝑘𝑗),(𝑐𝑘𝑗), and (𝑑𝑘𝑗) for 0𝑘,𝑗𝑁3 are given as follows: 𝑎𝑘𝑘=8(𝑘+2)2(2𝑘+3)𝜋𝐿,𝑎(𝑘+4)(2𝑘+7)𝑘𝑗=4(2𝑗+3)(2𝑗+5)(𝑘+2)𝜋𝐿×𝑘(𝑗+1)(𝑗+3)(𝑗+4)(2𝑘+7)4+10𝑘3+(292𝑗(𝑗+5))𝑘2,𝑏10(𝑗(𝑗+5)2)𝑘+𝑗(𝑗+5)(𝑗(𝑗+5)2)+12𝑗=𝑘+𝑛,𝑛1,𝑘+1,𝑘=2(𝑘+2)(2𝑘+3)𝜋(𝑘+4)(2𝑘+7),𝑏𝑘𝑘=12(𝑘+2)(2𝑘+3)𝜋,𝑏(𝑘+4)(2𝑘+7)𝑘,𝑘+1=2(𝑘+2)(𝑘+3)(34𝑘+115)𝜋,𝑏(𝑘+4)(𝑘+5)(2𝑘+7)𝑘𝑗=4(2𝑗+3)(2𝑗+5)(𝑘+2)2𝑗2+10𝑗2𝑘2𝜋10𝑘3𝑐(𝑗+1)(𝑗+3)(𝑗+4)(2𝑘+7),𝑗=𝑘+𝑛,𝑛2,𝑘+2,𝑘=𝐿(𝑘+2)(2𝑘+3)𝜋2(𝑘+3)(𝑘+4)(2𝑘+7),𝑐𝑘+1,𝑘=3𝐿(2𝑘+3)2𝑘2𝜋+13𝑘+222(𝑘+3)(𝑘+4)2,𝑐(2𝑘+7)𝑘𝑘=𝐿64𝑘4+700𝑘3+2860𝑘2𝜋+5187𝑘+35642(𝑘+3)2(𝑘+4)(2𝑘+7)2,𝑐𝑘,𝑘+1=𝐿52𝑘4+560𝑘3+2249𝑘2𝜋+3985𝑘+2640,𝑐2(𝑘+2)(𝑘+3)(𝑘+4)(𝑘+5)(2𝑘+7)𝑘,𝑘+2=𝐿(𝑘+2)62𝑘3+679𝑘2𝜋+2451𝑘+29342(𝑘+3)2,𝑐(𝑘+5)(𝑘+6)(2𝑘+7)𝑘𝑗=8𝐿(2𝑗+5)(2𝑗+7)(𝑘+2)𝜋𝑑(𝑗+2)(𝑗+4)(𝑗+5)(2𝑘+7),𝑗=𝑘+𝑛,𝑛3,𝑘𝑘=𝐿220𝑘6+300𝑘5+1841𝑘4+5910𝑘3+10478𝑘2𝜋+9765𝑘+38612(𝑘+1)2(𝑘+3)2(𝑘+4)2(2𝑘+7)2,𝑑𝑘,𝑘+1=𝑑𝑘+1,𝑘=3𝐿220𝑘4+240𝑘3+1087𝑘2𝜋+2202𝑘+17168(𝑘+2)(𝑘+3)(𝑘+4)2,𝑑(2𝑘+7)(2𝑘+9)𝑘,𝑘+2=𝑑𝑘+2,𝑘=3𝐿2𝑘(2𝑘+3)2𝜋+7𝑘+134(𝑘+3)2,𝑑(𝑘+4)(𝑘+5)(2𝑘+7)𝑘,𝑘+3=𝑑𝑘+3,𝑘=𝐿2(𝑘+2)(2𝑘+3)𝜋8(𝑘+3)(𝑘+4)2.(2𝑘+7)(2.26)

Corollary 2.4. If 𝛼=𝛽=1/2, then the nonzero elements (𝑎𝑘𝑗), (𝑏𝑘𝑗), (𝑐𝑘𝑗), and (𝑑𝑘𝑗) for 0𝑘, 𝑗𝑁3 are given as follows: 𝑎𝑘𝑘=32(𝑘+1)2(𝑘+3)(2𝑘+1)𝜋𝐿3,𝑎(2𝑘+5)𝑘𝑗=16(2𝑗+1)(2𝑗+3)(𝑘+1)𝜋𝐿3×𝑘(𝑗+2)(2𝑘+5)4+6𝑘3+(72𝑗(3+𝑗))𝑘26(1+𝑗(3+𝑗))𝑘+2+3𝑗+𝑗22,𝑏𝑗=𝑘+𝑛,𝑛1,𝑘+1,𝑘=8(𝑘+1)(𝑘+3)(2𝑘+1)𝜋𝐿2(2𝑘+5),𝑏𝑘𝑘=24(𝑘+1)(2𝑘+1)2𝑘2𝜋+8𝑘+7𝐿2,𝑏(𝑘+2)(2𝑘+5)𝑘,𝑘+1=8(𝑘+1)34𝑘3+225𝑘2𝜋+482𝑘+333𝐿2,𝑏(𝑘+3)(2𝑘+5)𝑘𝑗=16(2𝑗+1)(2𝑗+3)(𝑘+1)2𝑗2+6𝑗2𝑘2𝜋6𝑘+3𝐿2𝑐(𝑗+2)(2𝑘+5),𝑗=𝑘+𝑛,𝑛2,𝑘+2,𝑘=2(𝑘+1)(𝑘+3)(2𝑘+1)𝜋𝐿(𝑘+2)(2𝑘+5),𝑐𝑘+1,𝑘=6(2𝑘+1)(2𝑘+3)𝜋,𝑐𝐿(2𝑘+5)𝑘𝑘=2(𝑘+1)64𝑘3+324𝑘2𝜋+476𝑘+189𝐿(𝑘+2)(2𝑘+5)2,𝑐𝑘,𝑘+1=2(𝑘+1)(26𝑘+45)𝜋𝐿(𝑘+3),𝑐𝑘,𝑘+2=2(𝑘+1)62𝑘2𝜋+375𝑘+556,𝑐𝐿(𝑘+4)(2𝑘+5)𝑘𝑗=32(2𝑗+1)(2𝑗+3)(𝑘+1)𝜋𝑑𝐿(𝑗+2)(2𝑘+5),𝑗=𝑘+𝑛,𝑛3,𝑘𝑘=40𝑘4+240𝑘3+526𝑘2𝜋+498𝑘+181(𝑘+2)2(2𝑘+5)2,𝑑𝑘,𝑘+1=𝑑𝑘+1,𝑘=320𝑘4+160𝑘3+451𝑘2𝜋+524𝑘+1982,𝑑(𝑘+2)(𝑘+3)(2𝑘+5)(2𝑘+7)𝑘,𝑘+2=𝑑𝑘+2,𝑘=3(2𝑘+1)2𝑘2𝜋+10𝑘+112,𝑑(𝑘+2)(𝑘+4)(2𝑘+5)𝑘,𝑘+3=𝑑𝑘+3,𝑘=(𝑘+1)(2𝑘+1)𝜋.2(𝑘+2)(2𝑘+5)(2.27)
In the following, we can always modify the right-hand side to take care of the nonhomogeneous initial conditions. Let us consider for instance the one-dimensional third-order differential equation (2.9) subject to the nonhomogeneous initial conditions: 𝑢(0)=𝑎+,𝑢(0)=𝑎,𝑢(0)=̃𝑎+.(2.28) We proceed as follows.
Set 𝑉(𝑥)=𝑢(𝑥)+𝑏0+𝑏1𝑥+𝑏2𝑥2,(2.29) where 𝑏0=𝑎+,𝑏1=𝑎,𝑏2=̃𝑎+2.(2.30) The transformation (2.29) turns the nonhomogeneous initial conditions (2.28) into the homogeneous initial conditions: 𝑉(0)=𝑉(0)=𝑉(0)=0.(2.31) Hence, it suffices to solve the following modified one-dimensional third-order differential equation: 𝑉+𝛾1𝑉+𝛾2𝑉+𝛾3𝑉=𝑓(𝑥)𝑖𝑛𝐼=(0,𝐿),(2.32) subject to the homogeneous initial conditions (2.31), where 𝑉(𝑥) is given by (2.29), and 𝑓𝛾(𝑥)=𝑓(𝑥)+3𝑏0+𝛾2𝑏1+2𝛾1𝑏2+𝛾3𝑏1+2𝛾2𝑏2𝑥+𝛾3𝑏2𝑥2.(2.33)

3. P-SJG Method for Third-Order Differential Equation with Variable Coefficients

In this section, we use the pseudospectral-shifted Jacobi Galerkin method to numerically solve the following third-order differential equation with variable coefficients: 𝑢+𝛾1(𝑥)𝑢+𝛾2(𝑥)𝑢+𝛾3(𝑥)𝑢=𝑓(𝑥),𝑥𝐼,𝑢(0)=𝑢(0)=𝑢(0)=0.(3.1)

We denote by 𝑥(𝛼,𝛽)𝑁,𝑗, 0𝑗𝑁, the nodes of the standard Jacobi-Gauss interpolation on the interval (1,1). Their corresponding Christoffel numbers are 𝜛(𝛼,𝛽)𝑁,𝑗, 0𝑗𝑁. The nodes of the shifted Jacobi-Gauss interpolation on the interval (0,𝐿) are the zeros of 𝑃(𝛼,𝛽)𝐿,𝑁+1(𝑥), which we denote by 𝑥(𝛼,𝛽)𝐿,𝑁,𝑗, 0𝑗𝑁. Clearly 𝑥(𝛼,𝛽)𝐿,𝑁,𝑗=(𝐿/2)(𝑥(𝛼,𝛽)𝑁,𝑗+1), and their corresponding Christoffel numbers are 𝜛(𝛼,𝛽)𝐿,𝑁,𝑗=(𝐿/2)𝛼+𝛽+1𝜛(𝛼,𝛽)𝑁,𝑗, 0𝑗𝑁. Let 𝑆𝑁(0,𝐿) be the set of polynomials of degree at most 𝑁. Thanks to the property of the standard Jacobi-Gauss quadrature, it follows that for any 𝜙𝑆2𝑁+1(0,𝐿), 𝐿0(𝐿𝑥)𝛼𝑥𝛽𝐿𝜙(𝑥)𝑑𝑥=2𝛼+𝛽+111(1𝑥)𝛼(1+𝑥)𝛽𝜙𝐿2=𝐿(𝑥+1)𝑑𝑥2𝑁𝛼+𝛽+1𝑗=0𝜛(𝛼,𝛽)𝑁,𝑗𝜙𝐿2𝑥(𝛼,𝛽)𝑁,𝑗=+1𝑁𝑗=0𝜛(𝛼,𝛽)𝐿,𝑁,𝑗𝜙𝑥(𝛼,𝛽)𝐿,𝑁,𝑗.(3.2)

We define the discrete inner product and norm as follows: (𝑢,𝑣)𝑤𝐿(𝛼,𝛽),𝑁=𝑁𝑗=0𝑢𝑥(𝛼,𝛽)𝐿,𝑁,𝑗𝑣𝑥(𝛼,𝛽)𝐿,𝑁,𝑗𝜛(𝛼,𝛽)𝐿,𝑁,𝑗,𝑢𝑤𝐿(𝛼,𝛽),𝑁=(𝑢,𝑢)𝑤𝐿(𝛼,𝛽),𝑁,(3.3) where 𝑥(𝛼,𝛽)𝐿,𝑁,𝑗 and 𝜛(𝛼,𝛽)𝐿,𝑁,𝑗 are the nodes and the corresponding weights of the shifted Jacobi-Gauss-quadrature formula on the interval (0,𝐿), respectively.

Obviously, (see, e.g., formula (2.25) of [12]) (𝑢,𝑣)𝑤𝐿(𝛼,𝛽),𝑁=(𝑢,𝑣)𝑤𝐿(𝛼,𝛽),𝑢,𝑣𝑆2𝑁1.(3.4) Thus, for any 𝑢𝑆𝑁(0,𝐿), the norms 𝑢𝑤𝐿(𝛼,𝛽),𝑁 and 𝑢𝑤𝐿(𝛼,𝛽) coincide.

Associating with this quadrature rule, we denote by 𝐼𝑃𝐿(𝛼,𝛽)𝑁 the shifted Jacobi-Gauss interpolation, 𝐼𝑃𝐿(𝛼,𝛽)𝑁𝑢𝑥(𝛼,𝛽)𝐿,𝑁,𝑗𝑥=𝑢(𝛼,𝛽)𝐿,𝑁,𝑗,0𝑘𝑁.(3.5) The pseudospectral Galerkin method for (3.1) is to find 𝑢𝑁𝑊𝑁 such that 𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽)+𝛾1(𝑥)𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽),𝑁+𝛾2(𝑥)𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽),𝑁+𝛾3(𝑥)𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽),𝑁=𝑓,𝑣𝑁𝑤𝐿(𝛼,𝛽),𝑁𝑣𝑁𝑊𝑁,(3.6) where (𝑢,𝑣)𝑤𝐿(𝛼,𝛽),𝑁 is the discrete inner product of 𝑢 and 𝑣 associated with the shifted Jacobi-Gauss quadrature.

Hence, by setting 𝑢𝑁=𝑁3𝑘=0̃𝑎𝑘𝜙𝑘,𝐚=̃𝑎0,̃𝑎1,,̃𝑎𝑁3𝑇,𝑓𝑘=𝑓,𝜙𝑘𝑤𝐿(𝛼,𝛽),𝑁,𝑓𝐟=0,𝑓1𝑓,,𝑁3𝑇,̃𝑏𝑖𝑗=𝛾1(𝑥)𝜙𝑗,𝜙𝑖𝑤𝐿(𝛼,𝛽),𝑁,̃𝑐𝑖𝑗=𝛾2(𝑥)𝜙𝑗,𝜙𝑖𝑤𝐿(𝛼,𝛽),𝑁,𝑑𝑖𝑗=𝛾3(𝑥)𝜙𝑗,𝜙𝑖𝑤𝐿(𝛼,𝛽),𝑁,̃𝑏𝐵=𝑘𝑗,𝐶=̃𝑐𝑘𝑗,𝑑𝐷=𝑘𝑗,0𝑘,𝑗𝑁3.(3.7) Then, the linear system (3.6) becomes 𝐷𝐴+𝐵+𝐶+𝐚=𝐟,(3.8) where 𝐴 is given in Theorem 2.1.

4. SJC Method for Nonlinear Third-Order Differential Equations

In this section, we are interested in solving numerically the nonlinear third-order differential equation: 𝑢(𝑥)=𝐹𝑥,𝑢(𝑥),𝑢(𝑥),𝑢(𝑥),(4.1) with initial conditions 𝑢(0)=𝑢(0)=𝑢(0)=0.(4.2) It is well known that one can convert (4.1) into third-order system of first-order initial-value problems. Methods to solve systems of first-order differential equations are simply generalizations of the methods for a single first-order equation, for example, the classical Runge-Kutta of order four. Another alternative spectral method is to use the shifted Jacobi collocation method to solve (4.1) 𝑢𝑁(𝑥)=𝑁𝑗=0𝑏𝑗𝜙𝑘(𝑥).(4.3) then, making use of formula (2.7) enables one to express explicitly the derivatives 𝑢(𝑖)(𝑥), (𝑖=0,1,2) in terms of the expansion coefficients 𝑏𝑗. The criterion of spectral shifted Jacobi collocation method for solving approximately (4.1) is to find 𝑢𝑁(𝑥)𝑆𝑁(0,𝐿) such that 𝑢𝑁𝑥(𝛼,𝛽)𝐿,𝑁,𝑘𝑥=𝐹(𝛼,𝛽)𝐿,𝑁,𝑘,𝑢𝑁𝑥(𝛼,𝛽)𝐿,𝑁,𝑘,𝑢𝑁𝑥(𝛼,𝛽)𝐿,𝑁,𝑘,𝑢𝑁𝑥(𝛼,𝛽)𝐿,𝑁,𝑘,𝑘=0,1,,𝑁.(4.4) is satisfied exactly at the collocation points 𝑥(𝛼,𝛽)𝐿,𝑁,𝑘, 𝑘=0,1,,𝑁. In other words, we have to collocate (4.4) at the (𝑁+1) shifted Jacobi roots 𝑥(𝛼,𝛽)𝐿,𝑁,𝑘, which immediately yields 𝑁𝑗=0𝑏𝑗𝜙𝑘(𝑥)=𝐹𝑥,𝑁𝑗=0𝑏𝑗𝜙𝑘(𝑥),𝑁𝑗=0𝑏𝑗𝜙𝑘(𝑥),𝑁𝑗=0𝑏𝑗𝜙𝑘.(𝑥)(4.5) This constitutes a system of (𝑁+1) nonlinear algebraic equations in the unknown expansion coefficients 𝑏𝑗(𝑗=0,1,,𝑁), which can be solved by using any standard iteration technique, like Newton's iteration method.

5. Fifth-Order Differential Equations

In this section, we consider the fifth-order differential equation of the form: 𝑢(𝑣)+𝛾1𝑢(𝑖𝑣)+𝛾2𝑢+𝛾3𝑢+𝛾4𝑢+𝛾5𝑢=𝑓(𝑥),𝑥𝐼,𝑢(0)=𝑢(0)=𝑢(0)=𝑢(0)=𝑢(𝑖𝑣)(0)=0.(5.1) We define 𝑉𝑁=𝑣𝑁𝑆𝑁(0,𝐿)𝑢(0)=𝑢(0)=𝑢(0)=𝑢(0)=𝑢(𝑖𝑣).(0)=0(5.2) The results for fifth-order differential equations will be given without proofs.

5.1. SJG Method for Constant Coefficients

For 𝛾1, 𝛾2, 𝛾3, 𝛾4, and 𝛾5 are constants, we consider the following shifted Jacobi-Galerkin procedure for (5.1): Find 𝑢𝑁𝑉𝑁 such that 𝑢𝑁(𝑣),𝑣𝑁𝑤𝐿(𝛼,𝛽)+𝛾1𝑢𝑁(𝑖𝑣),𝑣𝑁𝑤𝐿(𝛼,𝛽)+𝛾2𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽)+𝛾3𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽)+𝛾4𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽)+𝛾5𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽)=𝑓,𝑣𝑁𝑤𝐿(𝛼,𝛽),𝑁,𝑣𝑁𝑉𝑁.(5.3) Now, we choose the basis functions Φ𝑘(𝑥) to be of the form: Φ𝑘(𝑥)=𝜉𝑘𝑃(𝛼,𝛽)𝐿,𝑘(𝑥)+̂𝜖𝑘𝑃(𝛼,𝛽)𝐿,𝑘+1(𝑥)+̂𝜀𝑘𝑃(𝛼,𝛽)𝐿,𝑘+2̂𝜁(𝑥)+𝑘𝑃(𝛼,𝛽)𝐿,𝑘+3(𝑥)+𝜇𝑘𝑃(𝛼,𝛽)𝐿,𝑘+4(𝑥)+̂𝜐𝑘𝑃(𝛼,𝛽)𝐿,𝑘+5(𝑥),𝑘=0,1,,𝑁5,(5.4) It is not difficult to show that the basis functions Φ𝑘(𝑥)𝑉𝑘+5 are given by Φ𝑘(𝑥)=𝜉𝑘𝑃(𝛼,𝛽)𝐿,𝑘(𝑥)+5(𝑘+1)(2𝑘+𝜆+2)𝑃(𝑘+𝛽+1)(2𝑘+𝜆+6)(𝛼,𝛽)𝐿,𝑘+1+(𝑥)10(𝑘+1)2(2𝑘+𝜆+1)(2𝑘+𝜆+4)(𝑘+𝛽+1)2(2𝑘+𝜆+6)2𝑃(𝛼,𝛽)𝐿,𝑘+2+(𝑥)10(𝑘+1)3(2𝑘+𝜆+1)2(𝑘+𝛽+1)3(2𝑘+𝜆+7)2𝑃(𝛼,𝛽)𝐿,𝑘+3+(𝑥)5(𝑘+1)4(2𝑘+𝜆+1)3(𝑘+𝛽+1)4(2𝑘+𝜆+6)2(𝑃2𝑘+𝜆+9)(𝛼,𝛽)𝐿,𝑘+4+(𝑥)(𝑘+1)5(2𝑘+𝜆+1)4(𝑘+𝛽+1)5(2𝑘+𝜆+6)5𝑃(𝛼,𝛽)𝐿,𝑘+5.(𝑥)(5.5) Therefore, for 𝑁5, we have 𝑉𝑁Φ=span0,Φ1,,Φ𝑁5.(5.6)

It is clear that (5.3) is equivalent to 𝑢𝑁(𝑣),Φ𝑘(𝑥)𝑤𝐿(𝛼,𝛽)+𝛾1𝑢𝑁(𝑖𝑣),Φ𝑘(𝑥)𝑤𝐿(𝛼,𝛽)+𝛾2𝑢𝑁,Φ𝑘(𝑥)𝑤𝐿(𝛼,𝛽)+𝛾3𝑢𝑁,Φ𝑘(𝑥)𝑤𝐿(𝛼,𝛽)+𝛾4𝑢𝑁,Φ𝑘(𝑥)𝑤𝐿(𝛼,𝛽)+𝛾5𝑢𝑁,Φ𝑘(𝑥)𝑤𝐿(𝛼,𝛽)=𝑓,Φ𝑘(𝑥)𝑤𝐿(𝛼,𝛽),𝑁,𝑘=0,1,,𝑁5.(5.7)

Let us denote 𝑓𝑘=𝑓,Φ𝑘(𝑥)𝑤𝐿(𝛼,𝛽),𝑁𝑓,𝐟=0,𝑓1,,𝑓𝑁5𝑇,𝑢𝑁(𝑥)=𝑁5𝑛=0𝑣𝑛Φ𝑛𝑣(𝑥),𝐯=0,𝑣1,,𝑣𝑁5𝑇.𝑟𝑖𝑗=Φ𝑗(𝑣),Φ𝑖𝑤𝐿(𝛼,𝛽),𝑞𝑖𝑗=Φ𝑗(𝑖𝑣),Φ𝑖𝑤𝐿(𝛼,𝛽),𝑦𝑖𝑗=Φ𝑗,Φ𝑖𝑤𝐿(𝛼,𝛽),𝑠𝑖𝑗=Φ𝑗,Φ𝑖𝑤𝐿(𝛼,𝛽),𝑡𝑖𝑗=Φ𝑗,Φ𝑖𝑤𝐿(𝛼,𝛽),𝑢𝑖𝑗=Φ𝑗,Φ𝑖𝑤𝐿(𝛼,𝛽),(5.8) then equation (5.7) is equivalent to the following matrix equation: 𝑅+𝛾1𝑄+𝛾2𝑌+𝛾3𝑆+𝛾4𝑇+𝛾5𝑈𝐯=𝐟,(5.9) where the nonzero elements of the matrices 𝑅, 𝑄, 𝑌, 𝑆, 𝑇, and 𝑈 are given explicitly in the following theorem.

Theorem 5.1. If one takes Φ𝑘(𝑥) as defined in (5.4), and if one denotes 𝑝𝑘𝑗=(Φ𝑗(𝑣)(𝑥),Φ𝑘(𝑥))𝑤𝐿(𝛼,𝛽), 𝑞𝑘𝑗=(Φ𝑗(𝑖𝑣)(𝑥),Φ𝑘(𝑥))𝑤𝐿(𝛼,𝛽), 𝑦𝑘𝑗=(Φ𝑗(𝑥),Φ𝑘(𝑥))𝑤𝐿(𝛼,𝛽),𝑠𝑘𝑗=(Φ𝑗(𝑥),Φ𝑘(𝑥))𝑤𝐿(𝛼,𝛽), 𝑡𝑘𝑗=(Φ𝑗(𝑥),Φ𝑘(𝑥))𝑤𝐿(𝛼,𝛽), and 𝑢𝑘𝑗=(Φ𝑗(𝑥),Φ𝑘(𝑥))𝑤𝐿(𝛼,𝛽). Then the nonzero elements (𝑟𝑘𝑗),(𝑞𝑘𝑗),(𝑦𝑘𝑗),(𝑠𝑘𝑗),(𝑡𝑘𝑗), and (𝑢𝑘𝑗) for 0𝑘,𝑗𝑁5 are given as follows: 𝑟𝑘𝑘=𝐿𝛼+𝛽4(2𝑘+𝜆+1)5(2𝑘+𝜆+1)4Γ(𝑘+6)(Γ(𝛼+1))2Γ(𝑘+𝛽+1)(𝑘+𝛽+1)5,𝑟Γ(𝑘+𝛼+1)Γ(𝑘+𝜆+5)𝑘𝑗=𝜉𝑘𝜉𝑗𝑂5(𝑗,𝑘,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+𝑂5(𝑗,𝑘+1,𝛼,𝛽)̂𝜖𝑘(𝛼,𝛽)𝐿,𝑘+1+𝑂5(𝑗,𝑘+2,𝛼,𝛽)̂𝜀𝑘(𝛼,𝛽)𝐿,𝑘+2+𝑂5̂𝜁(𝑗,𝑘+3,𝛼,𝛽)𝑘(𝛼,𝛽)𝐿,𝑘+3+𝑂5(𝑗,𝑘+4,𝛼,𝛽)𝜇𝑘(𝛼,𝛽)𝐿,𝑘+4+𝑂5(𝑗,𝑘+5,𝛼,𝛽)̂𝜐𝑘(𝛼,𝛽)𝐿,𝑘+5𝑞,𝑗=𝑘+𝑛,𝑛1,𝑘𝑗=𝜉𝑘𝜉𝑗𝑂4(𝑗,𝑘,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+𝑂4(𝑗,𝑘+1,𝛼,𝛽)̂𝜖𝑘(𝛼,𝛽)𝐿,𝑘+1+𝑂4(𝑗,𝑘+2,𝛼,𝛽)̂𝜀𝑘(𝛼,𝛽)𝐿,𝑘+2+𝑂4(̂𝜁𝑗,𝑘+3,𝛼,𝛽)𝑘(𝛼,𝛽)𝐿,𝑘+3+𝑂4(𝑗,𝑘+4,𝛼,𝛽)𝜇𝑘(𝛼,𝛽)𝐿,𝑘+4+𝑂4(𝑗,𝑘+5,𝛼,𝛽)̂𝜐𝑘(𝛼,𝛽)𝐿,𝑘+5𝑦,𝑗=𝑘+𝑛1,𝑛0,𝑘𝑗=𝜉𝑘𝜉𝑗𝑂3(𝑗,𝑘,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+𝑂3(𝑗,𝑘+1,𝛼,𝛽)̂𝜖𝑘(𝛼,𝛽)𝐿,𝑘+1+𝑂3(𝑗,𝑘+2,𝛼,𝛽)̂𝜀𝑘(𝛼,𝛽)𝐿,𝑘+2+𝑂3̂𝜁(𝑗,𝑘+3,𝛼,𝛽)𝑘(𝛼,𝛽)𝐿,𝑘+3+𝑂3(𝑗,𝑘+4,𝛼,𝛽)𝜇𝑘(𝛼,𝛽)𝐿,𝑘+4+𝑂3(𝑗,𝑘+5,𝛼,𝛽)̂𝜐𝑘(𝛼,𝛽)𝐿,𝑘+5𝑠,𝑗=𝑘+𝑛2,𝑛0,𝑘𝑗=𝜉𝑘𝜉𝑗𝑂2(𝑗,𝑘,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+𝑂2(𝑗,𝑘+1,𝛼,𝛽)̂𝜖𝑘(𝛼,𝛽)𝐿,𝑘+1+𝑂2(𝑗,𝑘+2,𝛼,𝛽)̂𝜀𝑘(𝛼,𝛽)𝐿,𝑘+2+𝑂2(̂𝜁𝑗,𝑘+3,𝛼,𝛽)𝑘(𝛼,𝛽)𝐿,𝑘+3+𝑂2(𝑗,𝑘+4,𝛼,𝛽)𝜇𝑘(𝛼,𝛽)𝐿,𝑘+4+𝑂2(𝑗,𝑘+5,𝛼,𝛽)̂𝜐𝑘(𝛼,𝛽)𝐿,𝑘+5𝑡,𝑗=𝑘+𝑛3,𝑛0,𝑘𝑗=𝜉𝑘𝜉𝑗𝑂1(𝑗,𝑘,𝛼,𝛽)(𝛼,𝛽)𝐿,𝑘+𝑂1(𝑗,𝑘+1,𝛼,𝛽)̂𝜖𝑘(𝛼,𝛽)𝐿,𝑘+1+𝑂1(𝑗,𝑘+2,𝛼,𝛽)̂𝜀𝑘(𝛼,𝛽)𝐿,𝑘+2+𝑂1̂𝜁(𝑗,𝑘+3,𝛼,𝛽)𝑘(𝛼,𝛽)𝐿,𝑘+3+𝑂1(𝑗,𝑘+4,𝛼,𝛽)𝜇𝑘(𝛼,𝛽)𝐿,𝑘+4+𝑂1(𝑗,𝑘+5,𝛼,𝛽)̂𝜐𝑘(𝛼,𝛽)𝐿,𝑘+5𝑢,𝑗=𝑘+𝑛4,𝑛0,𝑘𝑘=𝜉2𝑘(𝛼,𝛽)𝐿,𝑘+̂𝜖𝑘̂𝜖𝑘(𝛼,𝛽)𝐿,𝑘+1+̂𝜀𝑘̂𝜀𝑘(𝛼,𝛽)𝐿,𝑘+2+̂𝜁𝑘̂𝜁𝑘(𝛼,𝛽)𝐿,𝑘+3+𝜇𝑘𝜇𝑘(𝛼,𝛽)𝐿,𝑘+4+̂𝜐𝑘̂𝜐𝑘(𝛼,𝛽)𝐿,𝑘+5,𝑢𝑘+1,𝑘=𝑢𝑘,𝑘+1=𝜉𝑘𝜉𝑘+1̂𝜖𝑘(𝛼,𝛽)𝐿,𝑘+1+̂𝜖𝑘+1̂𝜀𝑘(𝛼,𝛽)𝐿,𝑘+2+̂𝜀𝑘+1̂𝜁𝑘(𝛼,𝛽)𝐿,𝑘+3+̂𝜁𝑘+1𝜇𝑘(𝛼,𝛽)𝐿,𝑘+4+𝜇𝑘+1̂𝜐𝑘(𝛼,𝛽)𝐿,𝑘+5,𝑢𝑘+2,𝑘=𝑢𝑘,𝑘+2=𝜉𝑘𝜉𝑘+2̂𝜀𝑘(𝛼,𝛽)𝐿,𝑘+2+̂𝜖𝑘+2̂𝜁𝑘(𝛼,𝛽)𝐿,𝑘+3+̂𝜀𝑘+2𝜇𝑘(𝛼,𝛽)𝐿,𝑘+4+̂𝜁𝑘+2̂𝜐𝑘(𝛼,𝛽)𝐿,𝑘+5,𝑢𝑘+3,𝑘=𝑢𝑘,𝑘+3=𝜉𝑘𝜉𝑘+3̂𝜁𝑘(𝛼,𝛽)𝐿,𝑘+3+̂𝜖𝑘+3𝜇𝑘(𝛼,𝛽)𝐿,𝑘+4+̂𝜀𝑘+3̂𝜐𝑘(𝛼,𝛽)𝐿,𝑘+5,𝑢𝑘+4,𝑘=𝑢𝑘,𝑘+4=𝜉𝑘𝜉𝑘+4𝜇𝑘(𝛼,𝛽)𝐿,𝑘+4+̂𝜖𝑘+4̂𝜐𝑘(𝛼,𝛽)𝐿,𝑘+5,𝑢𝑘+5,𝑘=𝑢𝑘,𝑘+5=𝜉𝑘𝜉𝑘+5̂𝜐𝑘(𝛼,𝛽)𝐿,𝑘+5,(5.10) where 𝑂𝑖(𝑗,𝑘,𝛼,𝛽)=𝐶𝑖(𝑗,𝑘,𝛼,𝛽)+̂𝜖𝑗𝐶𝑖(𝑗+1,𝑘,𝛼,𝛽)+̂𝜀𝑗𝐶𝑖+̂𝜁(𝑗+2,𝑘,𝛼,𝛽)𝑗𝐶𝑖(𝑗+3,𝑘,𝛼,𝛽)+𝜇𝑗𝐶𝑖(𝑗+4,𝑘,𝛼,𝛽)+̂𝜐𝑗𝐶𝑖(𝑗+5,𝑘,𝛼,𝛽).(5.11)

Proof. The proof of this theorem is not difficult, and it can be accomplished by following the same procedure used in proving Theorem 2.1.
In the following, we can always modify the right-hand side to take care of the nonhomogeneous initial conditions. Let us consider for instance the one-dimensional fifth-order differential equation (5.1) subject to the nonhomogeneous initial conditions: 𝑢(0)=𝑎+,𝑢(0)=𝑎,𝑢(0)=̃𝑎+,𝑢(0)=̃𝑎,𝑢(𝑖𝑣)(0)=𝑏+.(5.12) We proceed as follows.
Set 𝑉(𝑥)=𝑢(𝑥)+𝑏0+𝑏1𝑥+𝑏2𝑥2+𝑏3𝑥3+𝑏4𝑥4,(5.13) where 𝑏0=𝑎+,𝑏1=𝑎,𝑏2=̃𝑎+2,𝑏3=̃𝑎6,𝑏4=𝑏+.24(5.14) The transformation (5.13) turns the nonhomogeneous initial conditions (5.12) into the homogeneous initial conditions: 𝑉(0)=𝑉(0)=𝑉(0)=𝑉(0)=𝑉(𝑖𝑣)(0)=0.(5.15)
Hence, it suffices to solve the following modified one-dimensional fifth-order equation: 𝑉(𝑣)+𝛾1𝑉(𝑖𝑣)+𝛾2𝑉+𝛾3𝑉+𝛾4𝑉+𝛾5𝑉=𝑓(𝑥)in𝐼=(0,𝐿),(5.16) subject to the homogeneous initial conditions (5.15), where 𝑉(𝑥) is given by (5.13), and 𝑓(𝑥)=𝑓(𝑥)24𝛾1𝑏4+6𝛾2𝑏3+2𝛾3𝑏2+𝛾4𝑏1+𝛾5𝑏024𝛾2𝑏4+6𝛾3𝑏3+2𝛾4𝑏2+𝛾5𝑏1𝑥12𝛾3𝑏4+3𝛾4𝑏3+𝛾5𝑏2𝑥24𝛾4𝑏4+𝛾5𝑏3𝑥3𝛾5𝑏4𝑥4.(5.17)

5.2. Fifth-Order Equations with Variable Coefficients

Let us consider the fifth-order differential equation (5.1) with 𝛾1, 𝛾2, 𝛾3, 𝛾4, and 𝛾5 are variables. The pseudospectral Galerkin method for (5.1) is to find 𝑢𝑁𝑉𝑁 such that 𝑢𝑁(𝑣),𝑣𝑁𝑤𝐿(𝛼,𝛽)+𝛾1(𝑥)𝑢𝑁(𝑖𝑣),𝑣𝑁𝑤𝐿(𝛼,𝛽),𝑁+𝛾2(𝑥)𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽),𝑁+𝛾3(𝑥)𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽),𝑁+𝛾4(𝑥)𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽),𝑁+𝛾5(𝑥)𝑢𝑁,𝑣𝑁𝑤𝐿(𝛼,𝛽),𝑁=𝑓,𝑣𝑁𝑤𝐿(𝛼,𝛽),𝑁𝑣𝑁𝑉𝑁,(5.18) where (𝑢,𝑣)𝑤𝐿(𝛼,𝛽),𝑁 is the discrete inner product of 𝑢 and 𝑣 associated with the shifted Jacobi-Gauss quadrature (for details, see Section 3).

5.3. Nonlinear Fifth-Order Differential Equations

In this section, we are interested in solving numerically the nonlinear fifth-order differential equation: 𝑢(𝑣)(𝑥)=𝐹𝑥,𝑢(𝑥),𝑢(𝑥),𝑢(𝑥),𝑢(𝑥),𝑢(𝑖𝑣),(𝑥)(5.19) with initial conditions: 𝑢(0)=𝑢(0)=𝑢(0)=𝑢(0)=𝑢(𝑖𝑣)(0)=0.(5.20) It is well known that one can convert (5.19) into fifth-order system of first-order initial-value problems. Methods to solve systems of first-order differential equations are simply generalizations of the methods for a single first-order equation, for example, the classical Runge-Kutta of order four. Another alternative spectral method is to use the shifted Jacobi collocation method to solve (5.19): 𝑢𝑁(𝑥)=𝑁𝑗=0𝑏𝑗Φ𝑘(𝑥).(5.21) Then, making use of formula (2.7) enables one to express explicitly the derivatives 𝑢(𝑖)(𝑥), (𝑖=0,1,2,3,4) in terms of the expansion coefficients 𝑏𝑗. The criterion of spectral shifted Jacobi collocation method for solving approximately (5.19) is to find 𝑢𝑁(𝑥)𝑆𝑁(0,𝐿) such that 𝑢𝑁(𝑣)𝑥(𝛼,𝛽)𝐿,𝑁,𝑘𝑥=𝐹(𝛼,𝛽)𝐿,𝑁,𝑘,𝑢𝑁𝑥(𝛼,𝛽)𝐿,𝑁,𝑘,𝑢𝑁𝑥(𝛼,𝛽)𝐿,𝑁,𝑘,𝑢𝑁𝑥(𝛼,𝛽)𝐿,𝑁,𝑘,𝑢𝑁𝑥(𝛼,𝛽)𝐿,𝑁,𝑘,𝑢𝑁(𝑖𝑣)𝑥(𝛼,𝛽)𝐿,𝑁,𝑘,𝑘=0,1,,𝑁,(5.22) is satisfied exactly at the collocation points 𝑥(𝛼,𝛽)𝐿,𝑁,𝑘, 𝑘=0,1,,𝑁. In other words, we have to collocate (5.22) at the (𝑁+1) shifted Jacobi roots 𝑥(𝛼,𝛽)𝐿,𝑁,𝑘, which immediately yields 𝑁𝑗=0𝑏𝑗Φ𝑘(𝑣)(𝑥)=𝐹𝑥,𝑁𝑗=0𝑏𝑗Φ𝑘(𝑥),𝑁𝑗=0𝑏𝑗Φ𝑘(𝑥),𝑁𝑗=0𝑏𝑗Φ𝑘(𝑥),𝑁𝑗=0𝑏𝑗Φ𝑘(𝑥),𝑁𝑗=0𝑏𝑗Φ𝑘(𝑖𝑣).(𝑥)(5.23) This constitute a system of (𝑁+1) nonlinear algebraic equations in the unknown expansion coefficients 𝑏𝑗(𝑗=0,1,,𝑁), which can be solved by using any standard iteration technique, like Newton's iteration method.

6. Numerical Results

To illustrate the effectiveness of the proposed methods in the present paper, several test examples are carried out in this section. Comparisons of the results obtained by the present methods with those obtained by other methods reveal that the present methods are very efficient and more robust.

Example 6.1. Consider the linear third-order problem (see [23]): 𝑢(𝑥)+2𝑢(𝑥)𝑢[],(𝑥)2𝑢(𝑥)=𝑓(𝑥),𝑥0,3(6.1) subject to the initial condition: 𝑢(0)=1,𝑢(0)=2,𝑢(0)=0,(6.2) where f is selected such that exact solution is 1𝑢(𝑥)=36(6𝑥5)𝑒𝑥49𝑒2𝑥+14𝑒𝑥+43𝑒𝑥.(6.3)

Table 1 list the maximum pointwise error of 𝑢𝑢𝑁 using the SJG method with various choices of 𝑁. Numerical results of this problem show that the SJG method converges exponentially.

Example 6.2. Consider the linear third-order problem with variable coefficients: 𝑢cos(4𝑥)𝑢𝑒3𝑥𝑢+sin(𝑥)+𝑥3[],𝑢=𝑓(𝑥),𝑥0,3(6.4) subject to the initial condition: 𝑢(0)=1,𝑢(0)=2,𝑢(0)=0,(6.5) where f is selected such that exact solution is 1𝑢(𝑥)=36(6𝑥5)𝑒𝑥49𝑒2𝑥+14𝑒𝑥+43𝑒𝑥.(6.6)

Table 2 list the Maximum pointwise error, using the P-SJG method with various choices of 𝛼, 𝛽, and 𝑁. Numerical results of third-order differential equation with variable coefficients show that the P-SJG method converges exponentially.

Example 6.3. Consider the linear fifth-order problem (see [24]): 𝑢(𝑣)[],(𝑥)32𝑢(𝑥)=𝑓(𝑥),𝑥0,1(6.7) subject to the initial condition: 𝑢(0)=1,𝑢(0)=3,𝑢(0)=4,𝑢(0)=7,𝑢(𝑖𝑣)(0)=16,(6.8) where f is selected such that exact solution is 𝑢(𝑥)=𝑒2𝑥+sin𝑥.(6.9)

Table 3 list the maximum absolute error of 𝑢𝑢𝑁 using the SJG method with various choices of 𝛼, 𝛽, and 𝑁. It is seen that for the given initial conditions, the maximum absolute error in the He's variational iteration method [24] with eight iterations is 5.579104 (see, Table 2 in [24]).

Example 6.4. Consider the linear fifth-order problem with variable coefficients: 𝑢(𝑣)sin(3𝑥)𝑢(𝑖𝑣)𝑒2𝑥𝑢cos(𝑥)+𝑥2𝑢𝑥sin𝑥𝑢+𝑥2[],𝑢=𝑓(𝑥),𝑥0,2(6.10) subject to the initial condition: 𝑢(0)=1,𝑢(0)=1,𝑢(0)=0,𝑢(0)=4,𝑢(𝑖𝑣)(0)=4,(6.11) where f is selected such that exact solution is 𝑢(𝑥)=𝑥2sin𝑥+𝑒𝑥cos𝑥.(6.12)

Table 4 list the Maximum pointwise error, using the P-SJG method with various choices of 𝛼, 𝛽, and 𝑁. Numerical results of fifth-order differential equation with variable coefficients show that the P-SJG method converges exponentially.

Example 6.5. We consider in this example the third order nonlinear problem: 𝑢(3)(2𝑥)+𝑥𝑢(2)(𝑥)+𝑢(𝑥)2=14𝑥2cos𝑥+sin𝑥48𝑥2+𝑥5sin𝑥𝑥[],,𝑥0,1(6.13) with initial conditions given at three different points, 𝑢(0)=𝑢(1)(0)=𝑢(2)(0)=0.(6.14) The exact solution of this problem is 𝑢(𝑥)=𝑥2sin𝑥.(6.15)

In Table 5, we list the absolute errors obtained by the shifted Jacobi collocation method, with different values of 𝛼, 𝛽 and at N = 14.

Example 6.6. We consider in this example the fifth order nonlinear problem: 𝑢(5)(𝑥)+𝑢(𝑥)𝑢(4)[],(𝑥)=𝑓(𝑥),𝑥0,1(6.16) with initial conditions given at three different points, 𝑢(0)=𝑢(1)(0)=𝑢(2)(0)=𝑢(3)(0)=𝑢(4)(0)=0.(6.17) The exact solution of this problem is 𝑢(𝑥)=𝑥5cos𝑥.(6.18)

In Table 6, we list the absolute errors obtained by the shifted Jacobi collocation method, with different values of 𝛼, 𝛽 and at 𝑁=18.

7. Concluding Remarks

In this paper, we described a shifted Jacobi Galerkin method for third- and fifth-order ODEs with constant coefficients subject to homogeneous and nonhomogeneous initial conditions. The initial boundary conditions are satisfied exactly by expanding the unknown variable into a polynomial basis of functions which are built upon the shifted Jacobi polynomials. Because of the constant coefficients, the matrix elements of the discrete operators are provided explicitly, and this in turn greatly simplifies the steps and the computational effort for obtaining solutions. We have also presented some efficient direct solvers for the same equations with variable coefficients using P-SJG method.

An efficient and accurate numerical scheme based on the SJC spectral method is proposed for solving these equations. The problem is reduced to the solution of nonlinear algebraic equations. Through several numerical examples, we evaluate the accuracy and performance of the proposed algorithms. The algorithms are easy to implement and yield very accurate results.

Acknowledgments

This paper was funded by the Deanship of Scientific Research (DSR), King Abdulaziz University, Jeddah. The authors, therefore, acknowledge with thanks DSR technical and financial support. Also, they would like to thank the editor and the reviewers for their constructive comments and suggestions to improve the quality of the paper.