1 Introduction

Sinc methods were introduced by Frank Stenger in [1] and expanded upon by him in [2]. Sinc functions were first analyzed in [3] and [4]. An extensive research of sinc methods for two-point boundary value problems can be found in [5, 6]. In [7, 8], parabolic and hyperbolic problems were discussed in detail. Some kind of singular elliptic problems were solved in [9], and the symmetric sinc-Galerkin method was introduced in [10]. Sinc domain decomposition was presented in [1113] and [14]. Iterative methods for symmetric sinc-Galerkin systems were discussed in [15, 16] and [17]. Sinc methods were discussed thoroughly in [18]. Applications of sinc methods can also be found in [19, 20] and [21]. The article [22] summarizes the results obtained to date on sinc numerical methods of computation. In [14], a numerical solution of a Volterra integro-differential equation by means of the sinc collocation method was considered. The paper [2] illustrates the application of a sinc-Galerkin method to an approximate solution of linear and nonlinear second-order ordinary differential equations, and to an approximate solution of some linear elliptic and parabolic partial differential equations in the plane. The fully sinc-Galerkin method was developed for a family of complex-valued partial differential equations with time-dependent boundary conditions [19]. Some novel procedures of using sinc methods to compute solutions to three types of medical problems were illustrated in [23], and sinc-based algorithm was used to solve a nonlinear set of partial differential equations in [24]. A new sinc-Galerkin method was developed for approximating the solution of convection diffusion equations with mixed boundary conditions on half-infinite intervals in [25]. The work which was presented in [26] deals with the sinc-Galerkin method for solving nonlinear fourth-order differential equations with homogeneous and nonhomogeneous boundary conditions. In [27], sinc methods were used to solve second-order ordinary differential equations with homogeneous Dirichlet-type boundary conditions.

2 Sinc functions preliminaries

Let C denote the set of all complex numbers, and for all zC, define the sine cardinal or sinc function by

sinc(z)={ sin ( π z ) π z , y 0 , 1 , y = 0 .
(2.1)

For h>0, the translated sinc function with evenly spaced nodes is given by

sinc(k,h)(z)={ sin ( π z k h h ) π z k h h , z k h , 1 , z = k h .
(2.2)

For various values of k, the sinc basis function S(k,π/4)(x) on the whole real line <x< is illustrated in Figure 1. For various values of h, the central function S(0,h)(x) is illustrated in Figure 2.

Figure 1
figure 1

The basis functions S(k,h)(x) for k=1,0,1 with h=π/4 .

Figure 2
figure 2

Central sinc basis function S(0,h)(x) for h=π/2,π/4,π/8 .

If a function f(x) is defined over the real line, then for h>0, the series

C(f,h)(x)= k = f(kh)sinc ( x k h h )
(2.3)

is called the Whittaker cardinal expansion of f whenever this series converges. The infinite strip D s of the complex w plane, where d>0, is given by

D s { w = u + i v : | v | < d π 2 } .
(2.4)

In general, approximations can be constructed for infinite, semi-infinite and finite intervals. Define the function

w=ϕ(z)=ln ( z 1 z )
(2.5)

which is a conformal mapping from D E , the eye-shaped domain in the z-plane, onto the infinite strip D S , where

D E =z= { x + i y : | arg ( z 1 z ) | < d π 2 } .
(2.6)

This is shown in Figure 3.

Figure 3
figure 3

The relationship between the eye-shaped domain D E and the infinite strip D S .

For the sinc-Galerkin method, the basis functions are derived from the composite translated sinc functions

S h (z)=S(k,h)(z)=sinc ( ϕ ( z ) k h h )
(2.7)

for z D E . These are shown in Figure 4 for real values x. The function z= ϕ 1 (w)= e w 1 + e w is an inverse mapping of w=ϕ(z). We may define the range of ϕ 1 on the real line as

Γ= { ϕ 1 ( u ) D E : < u < }
(2.8)

the evenly spaced nodes { k h } k = on the real line. The image which corresponds to these nodes is denoted by

x k = ϕ 1 (kh)= e k h 1 + e k h .
(2.9)

A list of conformal mappings may be found in Table 1 [6].

Figure 4
figure 4

Three adjacent members S(k,h)ϕ(x) when k=1,0,1 and h= π 8 of the mapped sinc basis on the interval (0,1) .

Table 1 Conformal mappings and nodes for some subintervals of R

Definition 2.1 Let D E be a simply connected domain in the complex plane C, and let D E denote the boundary of D E . Let a, b be points on D E and ϕ be a conformal map D E onto D S such that ϕ(a)= and ϕ(b)=. If the inverse map of ϕ is denoted by φ, define

Γ= { ϕ 1 ( u ) D E : < u < }
(2.10)

and z k =φ(kh), k=1,2, .

Definition 2.2 Let B( D E ) be the class of functions F that are analytic in D E and satisfy

ψ ( L + u ) |F(z)|dz0,as u=,
(2.11)

where

L= { i y : | y | < d π 2 } ,
(2.12)

and those on the boundary of D E satisfy

T(F)= D E |F(z)dz|<.
(2.13)

The proof of following theorems can be found in [2].

Theorem 2.1 Let Γ be (0,1), FB( D E ), then for h>0 sufficiently small,

Γ F(z)dzh j = F ( z j ) ϕ ( z j ) = i 2 D F ( z ) k ( ϕ , h ) ( z ) sin ( π ϕ ( z ) / h ) dz I F ,
(2.14)

where

|k(ϕ,h) | z D =| e [ i π ϕ ( z ) h sgn ( Im ϕ ( z ) ) ] | z D = e π d h .
(2.15)

For the sinc-Galerkin method, the infinite quadrature rule must be truncated to a finite sum. The following theorem indicates the conditions under which an exponential convergence results.

Theorem 2.2 If there exist positive constants α, β and C such that

| F ( x ) ϕ ( x ) |C{ e α | ϕ ( x ) | , x ψ ( ( , ) ) , e β | ϕ ( x ) | , x ψ ( ( 0 , ) ) ,
(2.16)

then the error bound for the quadrature rule (2.14) is

| Γ F(x)dxh j = N N F ( x j ) ϕ ( x j ) |C ( e α N h α + e β N h β ) +| I F |.
(2.17)

The infinite sum in (2.14) is truncated with the use of (2.16) to arrive at the inequality (2.17). Making the selections

(2.18)
(2.19)

where is an integer part of the statement and N is the integer value which specifies the grid size, then

Γ F(x)dx=h j = N N F ( x j ) ϕ ( x j ) +O ( e ( π α d N ) 1 / 2 ) .
(2.20)

We used Theorems 2.1 and 2.2 to approximate the integrals that arise in the formulation of the discrete systems corresponding to a second-order boundary value problem.

Theorem 2.3 Let ϕ be a conformal one-to-one map of the simply connected domain D E onto D S . Then

(2.21)
(2.22)
(2.23)

3 The sinc-Galerkin method for singular Dirichlet-type boundary value problems

Consider the following problem:

y +P(x) y +Q(x)y=F(x)
(3.1)

with Dirichlet-type boundary condition

y(a)=0,y(b)=0,
(3.2)

where P, Q and F are analytic on D. We consider sinc approximation by the formula

(3.3)
(3.4)

The unknown coefficients c k in Eq. (3.3) are determined by orthogonalizing the residual with respect to the sinc basis functions. The Galerkin method enables us to determine the c k coefficients by solving the linear system of equations

L y N F , S ( k , h ) ϕ ( x ) =0,k=N,N+1,,N1,N.
(3.5)

Let f 1 and f 2 be analytic functions on D and the inner product in (3.5) be defined as follows:

f 1 , f 2 = Γ w(x) f 1 (x) f 2 (x)dx,
(3.6)

where w is the weight function. For the second-order problems, it is convenient to take [2].

w(x)= 1 ϕ ( x ) .
(3.7)

For Eq. (3.1), we use the notations (2.21)-(2.23) together with the inner product that, given (3.5) [2], showed to get the following approximation formulas:

(3.8)
(3.9)
(3.10)
(3.11)

where w k =w( x k ). If we choose h= ( π d / α N ) 1 / 2 and w(x)=1/ ϕ (x) as given in [2] the accuracy for each equation between (3.8)-(3.11) will be O( N 1 / 2 e ( π d α N ) 1 / 2 ).

Using (3.5), (3.8)-(3.11), we obtain a linear system of equations for 2N+1 numbers c k .

The 2N+1 linear system given in (3.5) can be expressed by means of matrices. Let m=2N+1, and let S m and c m be a column vector defined by

S m (x)=( S N S N + 1 S N ), c m =( c N c N + 1 c N ).
(3.12)

Let A m (y) denote a diagonal matrix whose diagonal elements are y( x N ),y( x N + 1 ),,y( x N ) and non-diagonal elements are zero, and also let I m ( 0 ) , I m ( 1 ) and I m ( 2 ) denote the matrices

(3.13)
(3.14)
(3.15)

With these notations, the discrete system of equations in (3.5) takes the form:

(3.16)

Theorem 3.1 Let c be an m-vector whose jth component is c j . Then the system (3.16) yields the following matrix system, the dimensions of which are (2N+1)×(2N+1):

Φc= A m F w ϕ .
(3.17)

Now we have a linear system of (2N+1) equations of the (2N+1) unknown coefficients. If we solve (3.17) by using LU or QR decomposition methods, we can obtain c j coefficients for the approximate sinc-Galerkin solution

y(x) y N (x)= k = N N c k S(k,h)ϕ(x).
(3.18)

4 Examples

Three examples were given in order to illustrate the performance of the sinc-Galerkin method to solve a singular Dirichlet-type boundary value problem in this section. The discrete sinc system defined by (3.18) was used to compute the coefficients c j ; j=N,,N for each example. All of the computations were done by an algorithm which we have developed for the sinc-Galerkin method. The algorithm automatically compares the sinc-method with the exact solutions. It is shown in Tables 2-4 and Figures 5-7 that the sinc-Galerkin method is a very efficient and powerful tool to solve singular Dirichlet-type boundary value problems.

Figure 5
figure 5

Approximation to the exact solution: the red colored curve displays the exact solution and the green one is the approximate solution of Eq. ( 4.1 ).

Figure 6
figure 6

Approximation to the exact solution: the red colored curve displays the exact solution and the green one is the approximate solution of Eq. ( 4.2 ).

Figure 7
figure 7

Approximation to the exact solution: the red colored curve displays the exact solution and the green one is the approximate solution of Eq. ( 4.3 ).

Table 2 The numerical results for the approximate solutions obtained by sinc-Galerkin in comparison with the exact solutions of Eq. ( 4.1 ) for N=100
Table 3 The numerical results for the approximate solutions obtained by sinc-Galerkin in comparison with the exact solutions of Eq. ( 4.2 ) for N=100
Table 4 The numerical results for the approximate solutions obtained by sinc-Galerkin in comparison with the exact solutions of Eq. ( 4.3 ) for N=100

Example 4.1 Consider the following singular Dirichlet-type boundary value problem on the interval [0,1]:

d 2 d x 2 y ( x ) + y ( x ) x ( x 1 ) = 72 1 , 045 x 2 + 12 1 , 045 x 3 + 1 209 x 4 + 1 / 19 x 5 , y ( 0 ) = 0 , y ( 1 ) = 0 .
(4.1)

The exact solution of (4.1) is

y ( x ) = 1 , 834 , 592 887 , 331 , 445 x + 917 , 296 887 , 331 , 445 x 2 + 458 , 648 887 , 331 , 445 x 3 188 , 072 34 , 571 , 355 x 4 + 1 , 4131 29 , 252 , 685 x 5 + 32 278 , 597 x 6 + 1 817 x 7 .

We choose the weight function according to [2], ϕ(x)=ln( 1 1 x ), w(x)= 1 ϕ ( x ) , and by taking d=π/2, h= 2 N , x k = e k h 1 + e k h for N=8,16,32,100, the solutions inFigure 5 and Table 2 are achieved.

Example 4.2 Let us have the following form of a singular Dirichlet-type boundary value problem on the interval [0,1]:

d 2 d x 2 y ( x ) 1 x d d x y ( x ) + y ( x ) x ( x + 1 ) = x 3 , y ( 0 ) = 0 , y ( 1 ) = 0 .
(4.2)

The problem has an exact solution like

y ( x ) = 1 144 ( 14 ln ( x + 1 ) x + 14 ln ( x + 1 ) 14 x + 6 x 2 12 x 2 ln ( 2 ) 2 x 3 + 4 x 3 ln ( 2 ) + x 4 2 x 4 ln ( 2 ) + 9 x 5 18 x 5 ln ( 2 ) ) / ( 1 + 2 ln ( 2 ) ) ,

where ϕ(x)=ln( 1 1 x ), w(x)= 1 ϕ ( x ) .By taking d=π/2, h= 2 N , x k = e k h 1 + e k h for N=8,16,32,100,we get the solutions in Figure 6 and Table 3.

Example 4.3 The following problem is given on the interval [1,4]:

d 2 d x 2 y ( x ) d d x y ( x ) = ( x 4 ) , y ( 1 ) = 0 , y ( 4 ) = 0 ,
(4.3)

where the exact solution of (4.3) is y(x)= x 2 e 4 x 2 e 1 + 15 e x 6 x e 4 + 6 x e 1 7 e 4 8 e 1 2 ( e 4 e 1 ) .

In this case, ϕ(x)=ln( x + 1 4 x ), w(x)= 1 ϕ ( x ) , and by taking d=π/2, h= 2 N , x k = 1 + 4 e k h 1 + e k h for N=8,16,32,100, we get results in Figure 7 and Table 4 .

5 Conclusion

The sinc-Galerkin method was employed to find the solutions of second-order Dirichlet-type boundary value problems on some closed real interval. The main purpose was to find the solution of boundary value problems which arise from the singular problems. The examples show that the accuracy improves with increasing number of sinc grid points N. We have also developed a very efficient and rapid algorithm to solve second-order Dirichlet-type BVPs with the sinc-Galerkin method on the Maple computer algebra system. All of the above computations and graphical representations were prepared by using Maple.

We give the Maple code in the Appendix section.

Appendix: Maple code which we developed for the sinc-Galerkin approximation