- Research
- Open Access
- Published:

# Extended cubic B-spline method for solving a linear system of second-order boundary value problems

*SpringerPlus*
**volume 5**, Article number: 1314 (2016)

## Abstract

A method based on extended cubic B-spline is proposed to solve a linear system of second-order boundary value problems. In this method, two free parameters, \(\lambda _{1}\) and \(\lambda _{2}\), play an important role in producing accurate results. Optimization of these parameters are carried out and the truncation error is calculated. This method is tested on three examples. The examples suggest that this method produces comparable or more accurate results than cubic B-spline and some other methods.

## Background

It is well-known that many real life phenomena in physics and engineering can be modelled by systems of linear and nonlinear differential equations. One class of these systems is of second order boundary value problems. The existence of solution to such system was studied in Chen et al. (2005), Cheng and Zhong (2005), Thompson and Tisdell (2002). Consider the following linear system of second-order boundary value problems:

where \(a\le x\le b\), \({f}_1(x)\) and \({f}_2(x)\) are continuous functions, and \({a}_i(x)\) and \({b}_i(x)\), for \(i=1,2,3,4,5\), are real-valued functions of *x* that are smooth enough.

There are many studies on the solutions of linear and nonlinear systems of second-order boundary value problems approximately. Amongst others are variational iteration, reproducing kernel, sinc-collocation, modified homotopy analysis, continuous genetic algorithm, He’s homotopy perturbation, Laplace homotopy analysis, homotopy perturbation-reproducing kernel, and local radial basis function based differential quadrature methods (Lu 2007; Geng and Cui 2007; Dehghan and Saadatmandi 2007; Bataineh et al. 2009; Arqub and Abo-Hammour 2014; Saadatmandi et al. 2009; Ogunlaran and Ademola 2015; Geng and Cui 2011; Dehghan and Nikpour 2013). The main purpose of our present study is to apply a spline function in solving Eq. (1). This equation had already been treated using cubic B-spline, cubic B-spline scaling functions, sinc-collocation, and spline collocation approaches (Caglar and Caglar 2009; Dehghan and Lakestani 2008; El-Gamel 2012; Khuri and Sayfy 2009).

In 2003, Han and Liu proposed an extension of cubic B-spline of degree four with one free parameter, \(\lambda\). This parameter is introduced within the basis function in order to increase the flexibility of the spline curve (Han and Liu 2003). Then, Xu and Wang generalized the extension to degree five and six (Gang and Guo-Zhao 2008). Our goal is to apply the simplest B-spline extension, that is, extended cubic B-spline of degree four, in solving Eq. (1). Linear and singular boundary value problems has already been solved using extended cubic B-spline of degree four and an approach of optimizing \(\lambda\) has been proposed (Hamid et al. 2011; Goh et al. 2011). The results are promising and thus become the motivation of this study.

In this paper, extended cubic B-spline will be discussed along with the extended cubic B-spline method (ECBM). Optimization of the free parameters and calculations on the truncation error will follow. Three examples will be presented and comparisons with other methods will be made.

## Extended cubic B-spline method

Extended cubic B-spline is an extension of B-spline Gang and Guo-Zhao (2008). One free parameter, \(\lambda\), is introduced within the basis function where this parameter can be used to alter the shape of the generated curve. The value of \(\lambda\) can be varied to obtain different numerical results. In this study, this value is optimized to produce approximate solutions with the least error.

### Extended cubic B-spline

Suppose that \(\left\{ x_{i} \right\} _{i=0}^{n}\) is a uniform partition of a finite interval [*a*, *b*] with \(n\in {\mathbb {Z}}^{+}\) such that \(a=x_{0}<x_{1}< \cdots <x_{n}=b.\) The partition can be extended using \(h=\frac{b-a}{n}\), \(x_{0}=a\), \(x_{i}=x_{0}+{i}{h}\), and \(i\in {\mathbb {Z}}\). Extended cubic B-spline basis function is established from a linear combination of the cubic B-spline basis function (Gang and Guo-Zhao 2008). Here, the blending function of degree four, \(E_{i}^{4}\), as shown in (2), is used.

Extended cubic B-spline basis will degenerate into cubic B-spline basis when \(\lambda =0\). For \(-8\le \lambda \le 1\), cubic B-spline and extended cubic B-spline share the same properties: partition of unity, non-negativity, \(C^{2}\) continuity, and local suport Hamid (2010). Figure 1 displays a family of extended cubic B-spline bases with different values of \(\lambda\).

From the basis function, an arbitrary spline curve can be generated by the following formula:

As a result, \(U(x,\lambda )\) is a piecewise polynomial functions of degree 4. Similarly, for \(-8\le \lambda \le 1\), cubic B-spline and extended cubic B-spline curves have the same properties: symmetry, geometric invariability, and convex hull Goh et al. (2011). The values of \(E_{i}\) and its derivatives \(E_{i}^{\prime}\), \(E_{i}^{\prime\prime}\) at the nodal points are tabulated in Table. 1.

### Extended cubic B-spline interpolation

Suppose that the spline curves \(U(x,\lambda _{1})\) and \(V(x,\lambda _{2})\) are the approximation to the exact solutions, *u*(*x*) and *v*(*x*), respectively, defined as follows:

Therefore, from Table 1, the values of \(U(x,\lambda _{1})\) ,\(U^{\prime} (x,\lambda _{1})\), \(U^{\prime\prime} (x,\lambda _{1})\), \(V(x,\lambda _{2})\) , \(V^{\prime}(x,\lambda _{2})\), and \(V^{\prime\prime}(x, \lambda _{2})\) at knot \(x_{i}\) can be simplified into Eqs. (4) and (5).

Equations (4) and (5) will be used in simplifying the terms in the system of boundary value problems.

## Solution of system of second order boundary value problem

In this part, a collocation approach based on extended cubic B-spline basis functions is used to obtain the numerical solutions of a class of systems of linear second order boundary value problems (1). The approximate solution (3) should satisfy the differential equation at points \(x_{i}\). This can be done by putting (3) into (1) resulting in Eqs. (6)–(9).

Equations (4)–(5) are substituted into Eqs. (6)–(9) resulting in a linear system of \(2(n+3)\) equations with \(2(n+3)\) unknowns, \(C_{-3}\), \(C_{-2},\ldots ,C_{n-1}\), \(D_{-3}\), \(D_{-2},\ldots ,D_{n-1}\). This system can be written in the matrix-vector

where \(Y=[ C_{-3} , C_{-2},\ldots , C_{n-1} , D_{-3} , D_{-2},\ldots ,D_{n-1}]^{T}\), \(Z=[0, f_{1}(x_{0}),\ldots , f_{1}(x_{n}), 0, 0, f_{2}(x_{0}),\ldots , f_{2}(x_{n}),0]^{T}\), and *X* is a \(2(n+3)\times 2(n+3)\) matrix given by

The four sub-matrices \(M_{1}\), \(M_{2}\), \(M_{3}\), and \(M_{4}\) are calculated as follows:

The elements of these sub-matrices are specified below for \(i=0, 1, \ldots , n\).

Equation (10) can be solved for values of \(C_{i}\)’s and \(D_{i}\)’s in terms of \(\lambda _{1}\) and \(\lambda _{2}\) by taking \(Y=X^{-1}Z\). Lastly, the numerical solution can be calculated after obtaining the values of \(\lambda _{1}\) or \(\lambda _{2}\) either by optimization or trial and error (Hamid et al. 2011).

## Optimizing the \(\lambda _{1}\) and \(\lambda _{2}\)

The approximate analytical solution is of the form

where \(C_{i}\)’s and \(D_{i}\)’s are obtained by solving a linear system of order \(2(n+3)\times 2(n+3)\). \(C_{i}\)’s and \(D_{i}\)’s are functions of *x*, \(\lambda _{1}\), and \(\lambda _{2}\). The approach used is adopted from Hamid et al. (2011, 2010). Equation (11) has three free parameters, *x*, \(\lambda _{1}\), and \(\lambda _{2}\). So, *U*(*x*) and *V*(*x*) can be written as \(U(x,\lambda _{1},\lambda _{2})\) and \(V(x,\lambda _{1},\lambda _{2})\) respectively. \(U(x,\lambda _{1},\lambda _{2})\) and \(V(x,\lambda _{1},\lambda _{2})\) are piecewise polynomials with *n* intervals, as in equation (12) and (13). Each \(U_{i}(x,\lambda _{1},\lambda _{2})\) and \(V_{i}(x,\lambda _{1},\lambda _{2})\), for \(i=1, 2,\ldots ,n\) are polynomials of degree four.

From the general form of the problem in (1), \(f_{1}(x)\) and \(f_{2}(x)\) are moved to the left-hand side of the equations, as in (14).

Substituting the approximate solutions, \(U(x,\lambda _{1},\lambda _{2})\) and \(V(x,\lambda _{1},\lambda _{2})\) and its derivatives into (14), we have

Equation (15) is like a version of error formula. From this equation, we have

which can be expanded into Eqs. (16) and (17).

Since \(D_{1}(x,\lambda _{1},\lambda _{2})\) and \(D_{2}(x,\lambda _{1},\lambda _{2})\) are piecewise functions with *n* equations, it is wise to have some representatives from every sub-interval. The representative is taken to be the midpoint of every sub-interval. Therefore, \(x^{*}_{i}=\frac{x_{i}+x_{i+1}}{2}\), for \(i=0, 1,\ldots , n-1\). Evaluating \(D_{1}(x,\lambda _{1},\lambda _{2})\) and \(D_{2}(x,\lambda _{1},\lambda _{2})\) at \(\left\{ x^{*}_{i} \right\} _{i=0}^{n-1}\) would produce a sequence of 2*n* expressions containing \(\lambda _{1}\) and \(\lambda _{2}\),

By handling Eqs. (18) and (19) as the error at collocation points, the expressions are combined using the two-norm formula resulting equation (20). This equation measures the accuracy of the approximated solution, \(U(x,\lambda _{1},\lambda _{2})\) and \(V(x,\lambda _{1},\lambda _{2})\) without including the exact solution.

Also, from Eq. (20) we can obtain \(d_{2}(\lambda _{1},\lambda _{2})\) which is assumed to be easier to calculate than the former.

On the other hand, we can combine the expressions using one-norm formula, as in (22).

This is done to make comparisons between results of \(d_{1}(\lambda _{1},\lambda _{2})\), \(d_{2}(\lambda _{1},\lambda _{2})\), and \(d_{3}(\lambda _{1},\lambda _{2})\) in terms of computational time and accuracy. \(d_{3}(\lambda _{1},\lambda _{2})\) is significantly more simplified that the other two. Finally, we can substitute the optimized value of \(\lambda _{1}\) and \(\lambda _{2}\) in the approximate solution for the problems.

## Error estimation

The technique for finding the error estimate as in Kadalbajoo and Kumar (2007) is extended to the system of linear second order differential equations. In this part, a truncation error for the present method in the interval [0, 1] is presented. Suppose that *u*(*x*) and *v*(*x*) are functions with continuous derivatives in [0, 1]. By using the formulas of *u*(*x*) in (4), the following relationship can be obtained.

Similarly, Eqs. (24)–(26) can be derived, where \(U^{\prime\prime\prime} (x_{i+},\lambda _{1})\) and \(U^{\prime\prime} (x_{i-},\lambda _{1})\) represent \(U^{\prime\prime\prime} (x_{i},\lambda _{1})\) in \((x_{i},x_{i+1})\) and \((x_{i-1},x_{i})\), respectively.

By using the operator notation \(E(U(x_{i}))=U(x_{i+1})\), Eq. (23) can be written as Sastry (2012)

By expanding \(E= e^{hD}\) in powers of *hD*, we get

Upon simplification, we have

Therefore,

Similar approach is applied on Eqs. (24)–(26) that results in relations (28)–(30).

By using \(e_{1}(x)=U(x,\lambda _{1})-u(x)\) and substituting relations (27)–(30) in the Taylor series expansion of \(e_{1}(x_{i}+\theta h)\), we obtain

Similarly, we can use the definition \(e_{2}(x)=V(x,\lambda _{2})-v(x)\) to have

Therefore, the extended cubic B-spline has a truncation error of order \(h^{2}\). Apparently, the value of \(\lambda _{1}\) and \(\lambda _{2}\) have influences on the order.

## Results and discussions

Several examples are discussed to demonstrate the efficiency of the proposed method. The results are compared with that of variational iteration, analytical approximation, sinc-collocation, reproducing kernel, He’s homotopy perturbation, Laplace homotopy analysis, and B-spline methods (Lu 2007; Geng and Cui 2007; Dehghan and Saadatmandi 2007; Saadatmandi et al. 2009; Ogunlaran and Ademola 2015; Caglar and Caglar 2009). The results are also presented with different values of *n*. Calculations were carried out using Wolfram Mathematica 10 with Intel(R) Core(TM) i5 CPU 3GHz processor, 4.00 GB RAM. The optimization can only be done for \(n\le 5\) due to the computational limit of the computer. Numerical errors are calculated using infinite and two norms, as respectively follows:

###
*Example 1*

Consider the following system Lu (2007),

where \(0<x <1\), \(f_{1}(x)=-\pi ^{2} \sin (\pi x)+(2x-1) \pi \cos (\pi x) + (2x-1) \cos (\pi x)\), and \(f_{2}(x)=2+x \sin (\pi x)\). The exact solutions are \(u(x)=\sin (\pi x)\) and \(v(x)=x^{2}-x\).

Table 2 displays the values of \(\lambda _{1}\) and \(\lambda _{2}\) when \(d_{1}(\lambda _{1},\lambda _{2})\), \(d_{2}(\lambda _{1},\lambda _{2})\), and \(d_{3}(\lambda _{1},\lambda _{2})\) are minimized for \(n=5\). The \(L_{\infty }\) and \(L_{2}\) for each pair are also presented. From the table, it can be deduced that minimizing \(d_{3}(\lambda _{1},\lambda _{2})\) is the best option because the results are comparable and the computational time is significantly less than that of \(d_{1}(\lambda _{1},\lambda _{2})\) and \(d_{2}(\lambda _{1},\lambda _{2})\). Therefore, the chosen values of \(\lambda _{1}\) and \(\lambda _{2}\) are −6.639145E−02 and \(1.161882E{-}06\), respectively. Also, it can be observed that minimizing \(d_{2}(\lambda _{1},\lambda _{2})\) gives similar results with minimizing \(d_{1}(\lambda _{1},\lambda _{2})\) with significantly less computational time.

The approximate and exact solutions at the nodal points are displayed in Table 3. From the table, the approximate solutions agree with the exact solutions. Hence, for this example, the results are acceptable and accurate. The plots of the numerical results are shown in Figs. 2 and 3. Comparisons between the \(L_{\infty }\) of ECBM, He’s homotopy perturbation method (Saadatmandi et al. 2009), and Laplace homotopy analysis method (Ogunlaran and Ademola 2015) were made in Table 4. ECBM produced more accurate results than both methods except for the results of *u*(*x*) generated by the Laplace homotopy analysis method (Ogunlaran and Ademola 2015). Moreover, the numerical results for Example 1 when \(\lambda _{1}=-1.0E{-}03\), \(\lambda _{2}=0\), and \(n=41\) are shown in Tables 5 and 6. In this case, the values of \(\lambda _{1}\) and \(\lambda _{2}\) were obtained by trial and error. From the table, the ECBM produced more accurate results than variational iteration method (VIM) and cubic B-spline method (CBM). The norms for both *n* are shown in Table 7. It can be observed that ECBM improves the accuracy of CBM significantly.

###
*Example 2*

Consider the following equations Khuri and Sayfy (2009),

where \(0 \le x \le 1\), \(f_{1}(x)=-2(x+1) \cos (x)+\pi \cos (\pi x) + 2x \sin (\pi x)+(4x-2x^{2}-4) \sin (x)\), and \(f_{2}(x)=-4(x-1)\cos (x)-2(2-x^{2}+x^{3})\sin (x)-( \pi ^{2}-1) \sin (\pi x)\). The exact solutions are \(u(x)=2(1-x)\sin (x)\), and \(v(x)=\sin ( \pi x)\).

Table 8 displays the values of \(\lambda _{1}\) and \(\lambda _{2}\) when \(d_{1}(\lambda _{1},\lambda _{2})\), \(d_{2}(\lambda _{1},\lambda _{2})\), and \(d_{3}(\lambda _{1},\lambda _{2})\) are minimized for \(n=5\), with their respective \(L_{\infty }\) and \(L_{2}\). Again, minimizing \(d_{3}(\lambda _{1},\lambda _{2})\) is the best option because the results are comparable and the computational time is significantly less than that of \(d_{1}(\lambda _{1},\lambda _{2})\) and \(d_{2}(\lambda _{1},\lambda _{2})\). Therefore, the chosen values of \(\lambda _{1}\) and \(\lambda _{2}\) are −1.269208E−02 and \(-6.634523E{-}02\), respectively. For this example, minimizing \(d_{2}(\lambda _{1},\lambda _{2})\) gives similar results with minimizing \(d_{1}(\lambda _{1},\lambda _{2})\) with almost similar computational time.

The approximate and exact solutions at the nodal points are displayed in Table 9. Again, from the table, the approximate solutions agree with the exact solutions. The plots of the numerical results are shown in Figs. 4 and 5. The numerical results for \(\lambda _{1}=\lambda _{2}=-1.0E{-}03\) and \(n=25\) are shown in Tables 10 and 11 and compared with reproducing kernel and sinc methods (Geng and Cui 2007; Dehghan and Saadatmandi 2007). The values of \(\lambda _{1}\) and \(\lambda _{2}\) were obtained by trial and error. It can be seen that ECBM produced results with significantly higher accuracy than the other two. The infinite and two norms are shown in Table 12. For this example, ECBM improves the accuracy of CBM for *u*(*x*) and gives out similar results for *v*(*x*).

###
*Example 3*

Finally, we consider the system Caglar and Caglar (2009),

where \(0<x <1\). The exact solutions are \(u(x)=x^{2}-x\) and \(v(x)=x-x^{2}\).

Table 13 displays the values of \(\lambda _{1}\) and \(\lambda _{2}\) when \(d_{1}(\lambda _{1},\lambda _{2})\), \(d_{2}(\lambda _{1},\lambda _{2})\), and \(d_{3}(\lambda _{1},\lambda _{2})\) are minimized for \(n=5\) together with the values of \(L_{\infty }\) and \(L_{2}\). Minimizing \(d_{3}(\lambda _{1},\lambda _{2})\) is the best option because the computational time is significantly less than that of \(d_{1}(\lambda _{1},\lambda _{2})\) and \(d_{2}(\lambda _{1},\lambda _{2})\). However, the minimizing values of \(\lambda _{1}\) and \(\lambda _{2}\) are equivalent to CBM. It can also be observed that minimizing \(d_{2}(\lambda _{1},\lambda _{2})\) gives similar results with minimizing \(d_{1}(\lambda _{1},\lambda _{2})\) with a little less computational time.

The approximate and exact solutions at the nodal points are displayed in Table 14. The plots of the numerical results are shown in Figs. 6 and 7. The numerical results for \(n=21\) and \(\lambda _{1}=\lambda _{2}=1.25E{-}14\) are shown in Table 15 and compared with CBM Caglar and Caglar (2009). The values of \(\lambda _{1}\) and \(\lambda _{2}\) were obtained by trial and error. It can be seen that ECBM produced slightly more accurate results than CBM. The infinite and two norms are shown in Table 16.

## Conclusions

In this research, a new method for finding approximate solutions for a system of second order boundary value problems based on extended cubic B-spline was proposed. This method is called extended cubic B-spline method. The error estimation was carried out and the truncation error was found to be of order \(h^2\), whereby the values of the free parameters \(\lambda _{1}\) and \(\lambda _{2}\) have influence on the order. This method improved the accuracy of its predecessor, CBM, and produced more accurate results than some other numerical methods. It is also found that minimizing the one-norm term, \(d_3(\lambda _1,\lambda _2)\) is sufficient to obtain the optimized values of \(\lambda _1\) and \(\lambda _2\). More work can be done in the optimizing technique to improve the computational time.

## References

Arqub OA, Abo-Hammour Z (2014) Numerical solution of systems of second-order boundary value problems using continuous genetic algorithm. Inf Sci 279:396–415

Bataineh AS, Noorani MSM, Hashim I (2009) Modified homotopy analysis method for solving systems of second-order BVPs. Commun Nonlinear Sci Numer Simul 14(2):430–442

Caglar N, Caglar H (2009) B-spline method for solving linear system of second-order boundary value problems. Comput Math Appl 57(5):757–762

Chen S, Hu J, Chen L, Wang C (2005) Existence results for n-point boundary value problem of second order ordinary differential equations. J Comput Appl Math 180(2):425–432

Cheng X, Zhong C (2005) Existence of positive solutions for a second-order ordinary differential system. J Math Anal Appl 312(1):14–23

Dehghan M, Saadatmandi A (2007) The numerical solution of a nonlinear system of second-order boundary value problems using the sinc-collocation method. Math Comput Model 46(11):1434–1441

Dehghan M, Lakestani M (2008) Numerical solution of nonlinear system of second-order boundary value problems using cubic B-spline scaling functions. Int J Comput Math 85(9):1455–1461

Dehghan M, Nikpour A (2013) Numerical solution of the system of second-order boundary value problems using the local radial basis functions based differential quadrature collocation method. Appl Math Model 37(18):8578–8599

El-Gamel M (2012) Sinc-collocation method for solving linear and nonlinear system of second-order boundary value problems. Appl Math 3(11):1627

Gang X, Guo-Zhao W (2008) Extended cubic uniform B-spline and \(\alpha\)-B-spline. Acta Autom Sin 34(8):980–984

Geng F, Cui M (2007) Solving a nonlinear system of second order boundary value problems. J Math Anal Appl 327(2):1167–1181

Geng F, Cui M (2011) Homotopy perturbation-reproducing kernel method for nonlinear systems of second order boundary value problems. J Comput Appl Math 235(8):2405–2411

Goh J, Majid AA, Ismail AIM (2011) Extended cubic uniform B-spline for a class of singular boundary value problems. Sci Asia 37(1):79–82

Hamid NNA (2010) Splines for linear two-point boundary value problems. MSc thesis, Universiti Sains Malaysia

Hamid NNA, Majid AA, Ismail AIM (2011) Extended cubic B-spline method for linear two-point boundary value problems. Sains Malays 40(11):1285–1290

Han XL, Liu SJ (2003) An extension of the cubic uniform B-spline curves. J Comput Aided Des Comput Graph 15(5):576–578

Kadalbajoo MK, Kumar V (2007) B-spline method for a class of singular two-point boundary value problems using optimal grid. Appl Math Comput 188(2):1856–1869

Khuri SA, Sayfy A (2009) Spline collocation approach for the numerical solution of a generalized system of second-order boundary-value problems. Appl Math Sci 3(45):2227–2239

Lu J (2007) Variational iteration method for solving a nonlinear system of second-order boundary value problems. Comput Math Appl 54(7):1133–1138

Ogunlaran OM, Ademola AT (2015) On the Laplace homotopy analysis method for a nonlinear system of second-order boundary value problems. Gen 26(2):11–22

Saadatmandi A, Dehghan M, Eftekhari A (2009) Application of He’s homotopy perturbation method for non-linear system of second-order boundary value problems. Nonlinear Anal Real World Appl 10(3):1912–1922

Sastry SS (2012) Introductory methods of numerical analysis. PHI Learning Pvt, Ltd

Thompson HB, Tisdell C (2002) Boundary value problems for systems of difference equations associated with systems of second-order ordinary differential equations. Appl Math Lett 15(6):761–766

## Authors' contributions

ASH suggested the method and the problem and wrote the first version of the paper and carried out the works to generate results using Mathematica. NNAH checked the paper and the Mathematica program, gave constructive comments and suggestions to ASH to improve the quality of the paper. AIMI did the final checking and reviewing. All authors read and approved the final manuscript.

### Acknowlegements

We thank Dr. Abedel-Karrem Alomari and Maher Hailat for their help in this study. Also the authors would like to thank the Editor-in-Chief and the reviewers for their valuable suggestions to improve this work.

### Competing interests

The authors declare that they have no competing interests.

## Author information

## Rights and permissions

**Open Access** This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.

## About this article

### Cite this article

Heilat, A.S., Hamid, N.N.A. & Ismail, A.I.M. Extended cubic B-spline method for solving a linear system of second-order boundary value problems.
*SpringerPlus* **5, **1314 (2016) doi:10.1186/s40064-016-2936-4

#### Received

#### Accepted

#### Published

#### DOI

### Keywords

- Boundary value problem
- System
- Linear
- Extended cubic B-spline