1 Introduction

Accurate and fast numerical solution of two-point boundary value problems for ordinary differential equations is necessary in many important scientific and engineering applications, e.g. reactant concentration in a chemical reactor, boundary layer theory, control and optimization theory, and flow networks in biology, areas of astrophysics such as the theory of stellar interiors, the thermal behavior of a spherical cloud of gas, isothermal gas spheres, and the theory of thermionic currents.

The aim of this paper is to introduce B-spline method for the numerical solution of the following class of linear and non-linear singular boundary value problems:

$$\begin{aligned} y^{(2r)}(x)+\frac{k_{_{1}}}{x}y^{\prime }(x)+\frac{k_{2}}{x^{2}}y(x)=f\left( x,y(x),y^{\prime }(x),\ldots ,y^{(2r-1)}(x)\right) ,\quad 0< x <1,\quad \quad \end{aligned}$$
(1.1)

subject to the boundary conditions

$$\begin{aligned} y (0)&=y^{\prime }(0)=0,\nonumber \\ y^{({j})}(0)&=\alpha _{{j}},\quad {j}=2,3,\ldots ,r-1,\nonumber \\ y^{({i})}(1)&=\beta _{{i}},\ {i}=0,1,\ldots ,r-1. \end{aligned}$$
(1.2)

The singular boundary-value problem has arises in many branches of applied mathematics and physics such as gas dynamics, nuclear physics, chemical reactions, atomic structures, atomic calculations, study of positive radial solutions of non-linear elliptic equations etc. In recent years, seeking numerical solutions of singular differential equations has been the focus of a number of authors [2, 46, 810, 13, 14, 17, 18, 21, 23].

In recent years, a lot of attention has been devoted to the study of B-spline method to investigate various scientific models. The efficiency of the method has been formally proved by many researchers [3, 1113, 15, 16, 20, 22, 24, 25]. Spline functions have some attractive properties. Due to the being piecewise polynomial, they can be integrated and differentiated easily. Since they have compact support, numerical methods in which spline functions are used as a basis function lead to matrix systems including band matrices. Such systems have solution algorithms with low computational cost.

The organization of the paper is as follows. In Sect. 2, we describe the basic formulation in terms of B-splines functions required for our subsequent development. Error analysis for the septic B-spline and the nonic B-spline are presented in Sect. 3. In Sect. 4, we introduce B-splines method and show how the method is used to solve linear singular higher-order boundary-value problem. Section 5 is devoted to the solution of non-linear singular higher-order boundary-value problem. Some numerical examples are presented in Sect. 6. Finally, Sect. 7 provides conclusions of the study.

2 The B-splines of \(d{\mathrm{th}}\) degree

The theory of spline functions is a very active field of approximation theory and boundary value problems, when numerical aspects are considered. In this paper we will be interested in the septic and nonic B-splines.

Consider equally spaced knots of a partition \(\Omega _{n}:0=x_{0}<x_{1}<\cdots <x_{n}=1\) with step \(h=\frac{1}{n}\), and \(x_{i}=ih\), for \(i=0,1,2,\ldots ,n\). Let \( S_{d}(\Omega _{n})\) is the space of continuously differentiable, piecewise, d-degree polynomials on \(\Omega _{n}\). That is \( S_{d}(\Omega _{n})\) is the space of the d-degree B-spline on \(\Omega _{n}\). The \( i\mathrm{th}\) B-spline basis, \( B_{i,d}(x)\), of degree d, \(i\in \mathbf Z \) is defined recursively as follows [8, 10]:

$$\begin{aligned} B_{i,0}(x)=\left\{ \begin{array}{ll} 1, &{} \quad x<x_{i+1}, \\ 0, &{}\quad \text{ otherwise }. \\ \end{array} \right. \end{aligned}$$
(2.1)

and

$$\begin{aligned} B_{i,d}(x)=\frac{x-x_{i}}{x_{i+d}-x_{i}}B_{i,d-1}(x)+\frac{x_{i+d+1}-x}{x_{i+d+1}-x_{i+1}}B_{i+1,d-1}(x), \end{aligned}$$
(2.2)

where \(d\ge 1\). The above relations shown in Eqs. (2.1) and (2.2) are usually referred to as the Cox-de Boor recursion formula, such that \(B_{i,d}\) are compactly supported, \(\sum _{i=-\infty }^{\infty }B_{i,d}(x)=1\), for all \( x\in \mathbf R \) and \( B_{i,d}\ge 0\). Since \(B_{0,d}(x)\) at the knot spans \((0,h),(h,2h),\ldots ,(eh,(e+1)h),\ldots ,(dh,(d+1)h)\), for \(0\le e\le d\), can be determined using the following equation,

$$\begin{aligned} B_{0,d}(x)&=\frac{1}{d!h^{d}}\left[ \sum _{i_{1}=0}^{d-e}\left[ g_{1}h-x\right] \,x^{i_{1}}\left( \sum _{i_{2}=i_{1}}^{d-e}\,\left[ g_{2}h-x\right] \,(x-h)^{j_{21}}\left( \sum _{i_{3}=i_{2}}^{d-e}\,\left[ g_{3}h-x\right] \right. \right. \right. \\&\quad \left. \left. \left. (x-2h)^{j_{32}}\ldots \left( \sum _{i_{e}=i_{e-1}}^{d-e}\,\left[ g_{e}\,h-x\right] \left( x-(e-1)h\right) ^{j_{e(e-1)}}\left( x-eh\right) ^{r_{e}}\right) \right) \right) \right] ,\\ \end{aligned}$$

where

$$\begin{aligned} r_{e}=d-e-i_{e}, g_{e}=d+1- i_{e}\quad \text{ and }\,\quad j_{e(e-1)}=i_{e}-i_{(e-1)}. \end{aligned}$$

3 Error analysis

3.1 Error analysis for the septic B-spline

The set of B-spline \(B_{j}(x),j=-7,-6,\ldots ,n-1\), form a basis for \(S_{7}(\Omega _{n})\). Thus we can define our septic B-spline basis in the form:

$$\begin{aligned} S(x)=\sum \limits _{j=-7}^{n-1}c_{j}B_{j}(x),\quad x\in [0,1]. \end{aligned}$$
(3.1)

Denote by \(S_{i}=S(x_{i}), S^{(p)}_{i}=S^{(p)}(x_{i})\) for all p. Table 1 exhibits the coefficients of septic B-spline \( B_{i,7} \) and their derivatives, at the knots \( {x_{i}, i=0,1,2, \ldots ,n}\).

Table 1 The coefficients of \( B_{i, 7}\) and its derivatives at the knots points

For any function g evaluated at the nodes \(x_{i}\), we define \(\Gamma \) by:

$$\begin{aligned} \Gamma {g_{i}}=g_{i-7}+120g_{i-6}+1191g_{i-5}+2416g_{i-4}+1191g_{i-3}+120g_{i-2}+g_{i-1}, \end{aligned}$$
(3.2)

then the following recursive relations can be reduced:

$$\begin{aligned} \Gamma {S^{\prime }_{i}}&=\frac{7}{h}\left[ -S_{i-7}-56S_{i-6}-245S_{i-5}+245S_{i-3}+56S_{i-2}+S_{i-1}\right] ,\end{aligned}$$
(3.3)
$$\begin{aligned} \Gamma {S^{\prime \prime }_{i}}&=\frac{42}{h^{2}}\left[ S_{i-7}+24S_{i-6}+15S_{i-5}-80S_{i-4}+15S_{i-3}+24S_{i-2}+S_{i-1}\right] ,\end{aligned}$$
(3.4)
$$\begin{aligned} \Gamma {S^{(3)}_{i}}&=\frac{210}{h^{3}}\left[ -S_{i-7}-8S_{i-6}+19S_{i-5}-19S_{i-3}+8S_{i-2}+S_{i-1}\right] ,\end{aligned}$$
(3.5)
$$\begin{aligned} \Gamma {S^{(4)}_{i}}&=\frac{840}{h^{4}}\left[ S_{i-7}-9S_{i-5}+16S_{i-4}-9S_{i-3}+S_{i-1}\right] ,\end{aligned}$$
(3.6)
$$\begin{aligned} \Gamma {S^{(5)}_{i}}&=\frac{2520}{h^{5}}\left[ -S_{i-7}+4S_{i-6}-5S_{i-5}+5S_{i-3}-4S_{i-2}+S_{i-1}\right] , \end{aligned}$$
(3.7)

and

$$\begin{aligned} \Gamma {S^{(6)}_{i}}=\frac{5040}{h^{6}}\left[ S_{i-7}-6S_{i-6}+15S_{i-5}-20S_{i-4}+15S_{i-3}-6S_{i-2}+S_{i-1}\right] . \end{aligned}$$
(3.8)

Lemma 3.1

Let S be the septic-spline interpolation of \(y\in C^{14}[0,1]\) defined by (3.1), then the following relations hold for \(i=0,1,2,\ldots ,n\)

$$\begin{aligned} \Gamma {S^{\prime }_{i}}&=5040\,y^{\prime }_{i-4}+1680\,h^{2}y^{(3)}_{i-4}+266\,h^{4}y^{(5)}_{i-4}+\frac{80}{3}\,h^{6}y^{(7)}_{i-4}+\text{ O }\left( h^{8}\right) ,\end{aligned}$$
(3.9)
$$\begin{aligned} \Gamma {S^{\prime \prime }_{i}}&=5040\,y^{\prime \prime }_{i-4}+1680\,h^{2}y^{(4)}_{i-4}+266\,h^{4}y^{(6)}_{i-4}+\frac{53}{2}\,h^{6}y^{(8)}_{i-4}+\text{ O }\left( h^{8}\right) ,\end{aligned}$$
(3.10)
$$\begin{aligned} \Gamma {S^{(3)}_{i}}&=5040\,y^{(3)}_{i-4}+1680\,h^{2}y^{(5)}_{i-4}+266\,h^{4}y^{(7)}_{i-4}+\frac{55}{2}\,h^{6}y^{(9)}_{i-4}+\text{ O }\left( h^{8}\right) ,\end{aligned}$$
(3.11)
$$\begin{aligned} \Gamma {S^{(4)}_{i}}&=5040\,y^{(4)}_{i-4}+1680\,h^{2}y^{(6)}_{i-4}+273\,h^{4}y^{(8)}_{i-4}+\frac{82}{3}\,h^{6}y^{(10)}_{i-4}+\text{ O }\left( h^{8}\right) ,\end{aligned}$$
(3.12)
$$\begin{aligned} \Gamma {S^{(5)}_{i}}&=5040\,y^{(5)}_{i-4}+1680\,h^{2}y^{(7)}_{i-4}+245\,h^{4}y^{(9)}_{i-4}+\frac{64}{3}\,h^{6}\,y^{(11)}_{i-4}+\text{ O }\left( h^{8}\right) ,\end{aligned}$$
(3.13)
$$\begin{aligned} \Gamma {S^{(6)}_{i}}&=5040\,y^{(6)}_{i-4}+1260\,h^{2}y^{(8)}_{i-4}+147\,h^{4}y^{(10)}_{i-4}+\frac{32}{3}\,h^{6}y^{(12)}_{i-4}+\text{ O }\left( h^{8}\right) . \end{aligned}$$
(3.14)

Proof

By substituting with Taylor series expansions of \(y_{i-7},\,y_{i-6},\,y_{i-5},\,y_{i-3},\,y_{i-2}\) and \(y_{i-1}\) about \(x_{i-4}\) in Eqs. (3.3)–(3.8), the above relations are obtained. \(\square \)

Theorem 3.1

If \(y\in C^{14}[0,1]\) and S is the septic B-spline interpolation of y defined by (3.1), then we have

$$\begin{aligned}&\displaystyle S^{(6)}_{i}=y^{(6)}_{i}-\frac{h^{2}}{12}y^{(8)}_{i}+\frac{h^{4}}{240}y^{(10)}_{i}-\frac{h^{6}}{6048}y^{(12)}_{i}+\text{ O }\left( h^{8}\right) ,\\&\displaystyle S^{(5)}_{i}=y^{(5)}_{i}-\frac{h^{4}}{240}y^{(9)}_{i}+\frac{h^{6}}{3024}y^{(11)}_{i}+\text{ O }\left( h^{8}\right) ,\\&\displaystyle S^{(4)}_{i}=y^{(4)}_{i}+\frac{h^{4}}{720}y^{(8)}_{i}-\frac{h^{6}}{3024}y^{(10)}_{i}+\text{ O }\left( h^{8}\right) ,\\&\displaystyle S^{(3)}_{i}=y^{(3)}_{i}+\frac{h^{4}}{6048}y^{(9)}_{i}+\text{ O }\left( h^{8}\right) ,\\&\displaystyle S^{\prime \prime }_{i}=y^{\prime \prime }_{i}-\frac{h^{6}}{30{,}240}y^{(8)}_{i}+\text{ O }\left( h^{8}\right) ,\\&\displaystyle S^{\prime }_{i}=y^{\prime }_{i}+\text{ O }\left( h^{8}\right) . \end{aligned}$$

Proof

Consider any function \(g\in C^{14}[0,1]\)\(\Gamma {g}\) is defined as shown in Eq. (3.2). It can be easily proved that

$$\begin{aligned} \Gamma {g_{i}}=5040\,g_{i-4}+1680\,h^{2}g^{\prime \prime }_{i-4}+266\,h^{4}g^{(4)}_{i-4}+\frac{80}{3}\,h^{6}g^{(6)}_{i-4}+\text{ O }\left( h^{8}\right) . \end{aligned}$$
(3.15)

If we assume that

$$\begin{aligned} g_{i}=y^{(6)}_{i}-\frac{h^{2}}{12}y^{(8)}_{i}+\frac{h^{4}}{240}\,y^{(10)}_{i}-\frac{h^{6}}{6048}\,y^{(12)}_{i}, \end{aligned}$$

then using Eq. (3.15) yields:

$$\begin{aligned} \Gamma {g_{i}}=5040\,y^{(6)}_{i}+1260\,h^{2}y^{(8)}_{i}+147\,h^{4}y^{(10)}_{i}+\frac{32}{3}\,h^{6}y^{(12)}_{i}+\text{ O }\left( h^{8}\right) . \end{aligned}$$
(3.16)

Let

$$\begin{aligned} d_{6,i}= S^{(6)}_{i}-\left( 5040y^{(6)}_{i}+1260\,h^{2}y^{(8)}_{i}+147\,h^{4}y^{(10)}_{i}+\frac{32}{3}\,h^{6}y^{(12)}_{i} \right) , \end{aligned}$$

subtracting Eq. (3.16) from Eq. (3.14) yields:

$$\begin{aligned} \Gamma {d_{6,i}}=\text{ O }\left( h^{8}\parallel {y^{14}}\parallel \right) . \end{aligned}$$
(3.17)

If we assume that

$$\begin{aligned} g_{i}=y^{(5)}_{i}-\frac{h^{4}}{240}\,y^{(9)}_{i}+\frac{h^{6}}{3024}\,y^{(11)}_{i}, \end{aligned}$$

then using Eq. (3.15) yields:

$$\begin{aligned} \Gamma {g_{i}}=5040\,y^{(5)}_{i}+1680\,h^{2}y^{(7)}_{i}+245\,h^{4}y^{(9)}_{i}+\frac{64}{3}\,h^{6}y^{(11)}_{i}+\text{ O }\left( h^{8}\right) . \end{aligned}$$
(3.18)

Let

$$\begin{aligned} d_{5,i}= S^{(5)}_{i}-\left( 5040\,y^{(5)}_{i}+1680\,h^{2}y^{(7)}_{i}+245\,h^{4}y^{(9)}_{i}+\frac{64}{3}\,h^{6}y^{(11)}_{i} \right) , \end{aligned}$$

subtracting Eq. (3.18) from Eq. (3.13) yields:

$$\begin{aligned} \Gamma {d_{5,i}}=O\left( h^{8}\parallel {y^{14}}\parallel \right) . \end{aligned}$$
(3.19)

If we assume that

$$\begin{aligned} g_{i}=y^{(4)}_{i}+\frac{h^{4}}{720}\,y^{(8)}_{i}-\frac{h^{6}}{3024}\,y^{(10)}_{i}, \end{aligned}$$

then using Eq. (3.15) yields:

$$\begin{aligned} \Gamma {g_{i}}=5040\,y^{(4)}_{i}+1680\,h^{2}y^{(6)}_{i}+273\,h^{4}y^{(8)}_{i}+\frac{82}{3}\,h^{6}y^{(10)}_{i}+\text{ O }\left( h^{8}\right) . \end{aligned}$$
(3.20)

Let

$$\begin{aligned} d_{4,i}= S^{(4)}_{i}-\left( 5040\,y^{(4)}_{i}+1680\,h^{2}y^{(6)}_{i}+273\,h^{4}y^{(8)}_{i}+\frac{82}{3}\,h^{6}y^{(10)}_{i} \right) , \end{aligned}$$

subtracting Eq. (3.20) from Eq. (3.12) yields:

$$\begin{aligned} \Gamma {d_{4,i}}=\text{ O }\left( h^{8}\parallel {y^{14}}\parallel \right) . \end{aligned}$$
(3.21)

If we assume that

$$\begin{aligned} g_{i}=y^{(3)}_{i}+\frac{h^{6}}{6048}\,y^{(9)}_{i}, \end{aligned}$$

then using Eq. (3.15) yields:

$$\begin{aligned} \Gamma {g_{i}}=5040\,y^{(3)}_{i}+1680\,h^{2}y^{(5)}_{i}+266\,h^{4}y^{(7)}_{i}+\frac{55}{2}\,h^{6}y^{(9)}_{i}+\text{ O }\left( h^{8}\right) . \end{aligned}$$
(3.22)

Let

$$\begin{aligned} d_{3,i}= S^{(3)}_{i}-\left( 5040\,y^{(3)}_{i}+1680\,h^{2}y^{(5)}_{i}+266\,h^{4}y^{(7)}_{i}+\frac{5}{2}\,h^{6}y^{(9)}_{i} \right) , \end{aligned}$$

subtracting Eq. (3.22) from Eq. (3.11) yields:

$$\begin{aligned} \Gamma {d_{3,i}}=\text{ O }\left( h^{8}\parallel {y^{14}}\parallel \right) . \end{aligned}$$
(3.23)

If we assume that

$$\begin{aligned} g_{i}=y^{\prime \prime }_{i}-\frac{h^{6}}{30{,}240}\,y^{(8)}_{i}, \end{aligned}$$

then using Eq. (3.15) yields:

$$\begin{aligned} \Gamma {g_{i}}=5040\,y^{\prime \prime }_{i}+1680\,h^{2}y^{(4)}_{i}+266\,h^{4}y^{(6)}_{i}+\frac{53}{2}\,h^{6}y^{(8)}_{i}+\text{ O }\left( h^{8}\right) . \end{aligned}$$
(3.24)

Let

$$\begin{aligned} d_{2,i}= S^{\prime \prime }_{i}-\left( 5040\,y^{\prime \prime }{i}+1680\,h^{2}y^{(4)}_{i}+266\,h^{4}y^{(6)}_{i}+\frac{53}{2}\,\,h^{6}y^{(8)}_{i} \right) , \end{aligned}$$

subtracting Eq. (3.24) from Eq. (3.10) yields:

$$\begin{aligned} \Gamma {d_{2,i}}=\text{ O }\left( h^{8}\parallel {y^{14}}\parallel \right) . \end{aligned}$$
(3.25)

If we assume that \(g_{i}=y^{\prime }_{i}\),  then using equation (3.15) yields:

$$\begin{aligned} \Gamma {g_{i}}=5040\,y^{\prime }_{i}+1680\,h^{2}y^{(3)}_{i}+266\,h^{4}y^{(5)}_{i}+\frac{80}{3}\,h^{6}y^{(7)}_{i}+\text{ O }\left( h^{8}\right) . \end{aligned}$$
(3.26)

Let \(d_{1,i}=\left( S^{\prime \prime }_{i}-\left( 5040y^{\prime }{i}+1680h^{2}y^{(3)}_{i}+266h^{4}y^{(5)}_{i}+\frac{80}{3}h^{6}y^{(7)}_{i} \right) \right) \), subtracting Eq. (3.26) from Eq. (3.9) yields:

$$\begin{aligned} \Gamma {d_{1,i}}=\text{ O }\left( h^{8}\parallel {y^{14}}\parallel \right) . \end{aligned}$$
(3.27)

Since the coefficient matrices of the systems of equations (3.17), (3.19), (3.21), (3.23), (3.25) and ( 3.27) are diagonally dominant and their inverses are bounded then \(d_{k,i}=\text{ O }\left( h^{8}\right) ,\,k=1,2,\ldots ,6,\, i=0,1,2, \ldots ,n\), hence; the proof of all relations of the above theorem is completed. \(\square \)

3.2 Error analysis for the nonic B-spline

The set of B-spline \(B_{j}(x),j=-9,-8,\ldots ,n-1\), form a basis for \(S_{9}(\Omega _{n})\). Thus we can define our nonic B-spline basis in the form:

$$\begin{aligned} S(x)=\sum \limits _{j=-9}^{n-1}c_{j}B_{j}(x),\quad x\in [0,1]. \end{aligned}$$
(3.28)

Table 2 exhibits the coefficients of nonic B-spline \( B_{i,9} \) and their derivatives, at the knots \( {x_{i}, i=0,1,2, \ldots ,n}\).

Table 2 The coefficients of \( B_{i, 9}\) and its derivatives at the knots points

For any function g evaluated at the nodes \(x_{i}\), we define \(\Gamma \) by:

$$\begin{aligned} \Gamma {g_{i}}&=g_{i-9}+502\,g_{i-8}+14{,}608\,g_{i-7}+88{,}234\,g_{i-6}+156{,}190\,g_{i-5}\nonumber \\&\quad +88{,}234\,g_{i-4}+14{,}608\,g_{i-3} +502\,g_{i-2}+g_{i-1}, \end{aligned}$$
(3.29)

Then the following recursive relations can be reduced:

$$\begin{aligned} \Gamma {S^{\prime }_{i}}&=\frac{9}{h}\big [-S_{i-9}-246\,S_{i-8}-4046\,S_{i-7}-11{,}326\,S_{i-6}+11{,}326\,S_{i-4}\nonumber \\&\quad \quad \quad +40{,}46S_{i-3}+246S_{i-2}+S_{i-1}\big ], \end{aligned}$$
(3.30)
$$\begin{aligned} \Gamma {S^{\prime \prime }_{i}}&=\frac{72}{h^{2}}\big [S_{i-9}+118S_{i-8}+952S_{i-7}+154S_{i-6}-24{,}50S_{i-5}+154S_{i-4}\nonumber \\&\quad +952S_{i-3}+118S_{i-2}+S_{i-1}\big ], \end{aligned}$$
(3.31)
$$\begin{aligned} \Gamma {S^{(3)}_{i}}&=\frac{504}{h^{3}}\big [-S_{i-9}-54S_{i-8}-134S_{i-7}+434S_{i-6}-434S_{i-4}+134S_{i-3}\nonumber \\&\quad +54S_{i-2}+S_{i-1}\big ], \end{aligned}$$
(3.32)
$$\begin{aligned} \Gamma {S^{(4)}_{i}}&=\frac{3024}{h^{4}}\big [S_{i-9}+18S_{i-8}-32S_{i-7}-86S_{i-6}+190S_{i-5}-86S_{i-4} -32S_{i-3}\nonumber \\&\quad +18S_{i-2}+S_{i-1}\big ], \end{aligned}$$
(3.33)
$$\begin{aligned} \Gamma {S^{(5)}_{i}}&=\frac{15{,}120}{h^{5}}\big [-S_{i-9}-6S_{i-8}+34S_{i-7}-46S_{i-6}+46S_{i-4}-34S_{i-3}\nonumber \\&\quad +6S_{i-2}+S_{i-1}\big ], \end{aligned}$$
(3.34)
$$\begin{aligned} \Gamma {S^{(6)}_{i}}&=\frac{60{,}480}{h^{6}}[S_{i-9}-2S_{i-8}-8S_{i-7}+34S_{i-6}-50S_{i-5}+34S_{i-4}-8S_{i-3}\nonumber \\&\quad -2S_{i-2}+S_{i-1}], \end{aligned}$$
(3.35)
$$\begin{aligned} \Gamma {S^{(7)}_{i}}&=\frac{181{,}440}{h^{7}}[-S_{i-9}+6S_{i-8}-14S_{i-7}+14S_{i-6}-14S_{i-4}+14S_{i-3}\nonumber \\&\quad -6S_{i-2}+S_{i-1}], \end{aligned}$$
(3.36)
$$\begin{aligned} \Gamma {S^{(8)}_{i}}&=\frac{362{,}880}{h^{8}}[S_{i-9}-8S_{i-8}+28S_{i-7}-56S_{i-6}+70S_{i-5}-56S_{i-4}+28S_{i-3}\nonumber \\&\quad -8S_{i-2}+S_{i-1}]. \end{aligned}$$
(3.37)

Lemma 3.2

Let S be the nonic B-spline interpolation of \(y\in C^{16}[0,1]\) defined by (3.28), then the following relations hold for \(i=0,1,2,\ldots ,n\)

$$\begin{aligned} \Gamma {S^{\prime }_{i}}&=362{,}880y^{\prime }_{i-5}+151{,}200\,h^{2}y^{(3)}_{i-5}+30{,}240\,h^{4}y^{(5)}_{i-5}+3870\,h^{6}y^{(7)}_{i-5}+\nonumber \\&\quad \frac{713}{2}\,h^{8}y^{(8)}_{i-5}+\text{ O }\left( h^{10}\right) , \end{aligned}$$
(3.38)
$$\begin{aligned} \Gamma {S^{\prime \prime }_{i}}&=362{,}880y^{\prime \prime }_{i-5}+151{,}200\,h^{2}y^{(4)}_{i-5}+30{,}240\,h^{4}y^{(6)}_{i-5}+3870\,h^{6}y^{(8)}_{i-5}+\nonumber \\&\quad \frac{1784}{5}\,h^{8}y^{(10)}_{i-5}+\text{ O }\left( h^{10}\right) , \end{aligned}$$
(3.39)
$$\begin{aligned} \Gamma {S^{(3)}_{i}}&=362{,}880y^{(3)}_{i-5}+1{,}151{,}200\,h^{2}y^{(5)}_{i-5}+30{,}240\,h^{4}y^{(7)}_{i-5}+3870\,h^{6}y^{9}_{i-5}+\nonumber \\&\quad \frac{1772}{5}\,h^{8}y^{(11)}_{i-5}+\text{ O }\left( h^{10}\right) , \end{aligned}$$
(3.40)
$$\begin{aligned} \Gamma {S^{(4)}_{i}}&=362{,}880y^{(4)}_{i-5}+151{,}200\,h^{2}y^{(6)}_{i-5}+30{,}240\,h^{4}y^{(8)}_{i-5}+3858\,h^{6}y^{(10)}_{i-5}+\nonumber \\&\quad \frac{1789}{5}h^{8}y^{(12)}_{i-5}+\text{ O }\left( h^{10}\right) , \end{aligned}$$
(3.41)
$$\begin{aligned} \Gamma {S^{(5)}_{i}}&=362{,}880y^{(5)}_{i-5}+151{,}200\,h^{2}y^{(7)}_{i-5}+30{,}240\,h^{4}y^{(9)}_{i-5}+3930\,h^{6}y^{(11)}_{i-5}+\nonumber \\&\quad 371\,h^{8}y^{(13)}_{i-5}+\text{ O }\left( h^{10}\right) , \end{aligned}$$
(3.42)
$$\begin{aligned} \Gamma {S^{(6)}_{i}}&=362{,}880y^{(6)}_{i-5}+151{,}200\,h^{2}y^{(8)}_{i-5}+30{,}744\,h^{4}y^{(10)}_{i-5}+3960\,h^{6}y^{(12)}_{i-5}+\nonumber \\&\quad 359\,h^{8}y^{(14)}_{i-5}+\text{ O }\left( h^{10}\right) . \end{aligned}$$
(3.43)
$$\begin{aligned} \Gamma {S^{(7)}_{i}}&=362{,}880y^{(7)}_{i-5}+151{,}200\,h^{2}y^{(9)}_{i-5}+28{,}728\,h^{4}y^{(11)}_{i-5}+3360\,h^{6}y^{(13)}_{i-5}+\nonumber \\&\quad \frac{1371}{5}h^{8}y^{(15)}_{i-5}+\text{ O }\left( h^{10}\right) , \end{aligned}$$
(3.44)
$$\begin{aligned} \Gamma {S^{(8)}_{i}}&=362{,}880\,y^{(8)}_{i-5}+120{,}960\, h^{2}y^{(10)}_{i-5}+19{,}152\, h^{4}y^{(12)}_{i-5}+1920\, h^{6}y^{(14)}_{i-5}+\nonumber \\&\quad \frac{1371}{10}\, h^{8}y^{(16)}_{i-5}+\text{ O }\left( h^{10}\right) . \end{aligned}$$
(3.45)

Proof

By substituting with Taylor series expansions of \(y_{i-9},\,y_{i-8},\,y_{i-7},\,y_{i-6},\,y_{i-4},\) \(\,y_{i-3},\,y_{i-2}\) and \(y_{i-1}\) about \(x_{i-5}\) in equations (3.30)–(3.45), the above relations are obtained. \(\square \)

Theorem 3.2

If \(y\in C^{16}[0,1]\) and S is the nonic B-spline interpolation of y defined by (3.28), then we have

$$\begin{aligned}&\displaystyle S^{(8)}_{i}=y^{(8)}_{i}-\frac{h^{2}}{12}y^{(10)}_{i}+\frac{h^{4}}{240}y^{(12)}_{i}-\frac{h^{6}}{6048}y^{(14)}_{i}+\frac{h^{8}}{172{,}800}y^{(16)}+\text{ O }\left( h^{10}\right) ,\\&\displaystyle S^{(7)}_{i}=y^{(7)}_{i}-\frac{h^{4}}{240}y^{(11)}_{i}+\frac{h^{6}}{3024}y^{(13)}_{i}-\frac{h^{8}}{57{,}600}y^{(15)}_{i-5}+\text{ O }\left( h^{10}\right) ,\\&\displaystyle S^{(6)}_{i}=y^{(6)}_{i}+\frac{h^{4}}{720}y^{(10)}_{i}-\frac{h^{6}}{3024}y^{(12)}_{i}+\frac{h^{8}}{34{,}560}y^{(14)}_{i}+\text{ O }\left( h^{10}\right) ,\\&\displaystyle S^{(5)}_{i}=y^{(5)}_{i}+\frac{h^{6}}{6048}y^{(11)}_{i}-\frac{h^{8}}{34{,}560}y^{(13)}_{i}+\text{ O }\left( h^{10}\right) ,\\&\displaystyle S^{(4)}_{i}=y^{(4)}_{i}-\frac{h^{6}}{30{,}240}y^{(10)}_{i}+\frac{h^{8}}{57{,}600}y^{(12)}_{i}+\text{ O }\left( h^{10}\right) ,\\&\displaystyle S^{(3)}_{i}=y^{(3)}_{i}-\frac{h^{8}}{172{,}800}y^{(11)}_{i}+\text{ O }\left( h^{10}\right) ,\\&\displaystyle S^{\prime \prime }_{i}=y^{\prime \prime }_{i}+\frac{h^{8}}{12{,}096{,}000}y^{(10)}_{i}+\text{ O }\left( h^{10}\right) ,\\&\displaystyle S^{\prime }_{i}=y^{\prime }_{i}+\text{ O }\left( h^{10}\right) , \end{aligned}$$

Proof

Consider any function \(g\in C^{16}[0,1]\)\(\Gamma {g}\) is defined as shown in Eq. (3.29). It can be easily proved that

$$\begin{aligned} \Gamma {g_{i}}= & {} 362{,}880g_{i}+151{,}200\, h^{2}g^{\prime \prime }_{i}+30{,}240\,h^{4}g^{(4)}_{i}\nonumber \\&+3870\, h^{6}g^{(6)}_{i}+\frac{713}{2}\, h^{8}g^{(8)}_{i}+\text{ O }\left( h^{10}\right) . \end{aligned}$$
(3.46)

If we assume that

$$\begin{aligned} g_{i}=y^{(8)}_{i}-\frac{h^{2}}{12}\,y^{(10)}_{i}+\frac{h^{4}}{240}\,y^{(12)}_{i}-\frac{h^{6}}{6048}\,y^{(14)}_{i}+\frac{h^{8}}{172{,}800}\,y^{16}_{i} \end{aligned}$$

then using Eq. (3.46) yields:

$$\begin{aligned} \Gamma {g_{i}}= & {} 362{,}880\,y^{(8)}_{i-5}+120{,}960\,h^{2}y^{(10)}_{i-5}+19{,}152\,h^{4}y^{(12)}_{i-5}+1920\,h^{6}y^{(14)}_{i-5}\nonumber \\&+\frac{1371}{10}\,h^{8}y^{(16)}_{i-5}+\text{ O }\left( h^{10}\right) . \end{aligned}$$
(3.47)

Let

$$\begin{aligned} \tilde{d}_{8,i}= & {} S^{(8)}_{i-5}-\left( 362{,}880\,y^{(8)}_{i-5}+120{,}960\, h^{2}y^{(10)}_{i-5}+19{,}152\, h^{4}y^{(12)}_{i-5}\right. \nonumber \\&\left. +1920\, h^{6}y^{(14)}_{i-5}+ \frac{1371}{10} h^{8}y^{(16)}_{i-5} \right) , \end{aligned}$$

subtracting Eq. (3.47) from Eq. (3.45) yields:

$$\begin{aligned} \Gamma {\tilde{d}_{8,i}}=\text{ O }\left( h^{10}\parallel {y^{16}}\parallel \right) . \end{aligned}$$
(3.48)

If we assume that

$$\begin{aligned} g_{i}=y^{(7)}_{i}-\frac{h^{4}}{240}\,y^{(11)}_{i}+\frac{h^{6}}{3024}\,y^{(13)}_{i}-\frac{h^{8}}{57{,}600}\,y^{(15)}_{i}, \end{aligned}$$

then using Eq. (3.46) yields:

$$\begin{aligned} \Gamma {g_{i}}= & {} 362{,}880\,y^{(7)}_{i-5}+151{,}200\, h^{2}y^{(9)}_{i-5}+28{,}728\, h^{4}y^{(11)}_{i-5}+3360\,h^{6}y^{(13)}_{i-5}\nonumber \\&+\frac{1371}{5}\,h^{8}y^{(15)}_{i-5}+\text{ O }\left( h^{10}\right) . \end{aligned}$$
(3.49)

Let

$$\begin{aligned} \tilde{d}_{7,i}= & {} S^{(7)}_{i-5}-\left( 362{,}880\,y^{(7)}_{i-5}+151{,}200\, h^{2}y^{(9)}_{i-5}+28{,}728\, h^{4}y^{(11)}_{i-5}\right. \nonumber \\&\left. +3360 h^{6}y^{(13)}_{i-5}+ \frac{1371}{5} \,h^{8}y^{(15)}_{i-5}\right) , \end{aligned}$$

subtracting Eq. (3.49) from Eq. (3.44) yields:

$$\begin{aligned} \Gamma {\tilde{d}_{7,i}}=\text{ O }\left( h^{10}\parallel {y^{16}}\parallel \right) . \end{aligned}$$
(3.50)

If we assume that

$$\begin{aligned} g_{i}=y^{(6)}_{i}+\frac{h^{4}}{720}\,y^{(10)}_{i}-\frac{h^{6}}{3024}\,y^{(12)}_{i}+\frac{h^{8}}{34{,}560}\,y^{(14)}_{i}, \end{aligned}$$

then using Eq. (3.46) yields:

$$\begin{aligned} \Gamma {g_{i}}= & {} 362{,}880\,y^{(6)}_{i-5}+151{,}200\,h^{2}y^{(8)}_{i-5}+30{,}744\,h^{4}y^{(10)}_{i-5}+3960\,h^{6}y^{(12)}_{i-5}\nonumber \\&+359\,h^{8}y^{(14)}_{i-5}+\text{ O }\left( h^{10}\right) . \end{aligned}$$
(3.51)

Let

$$\begin{aligned} \tilde{d}_{6,i}= & {} S^{(6)}_{i-5}-\bigg (362{,}880\,y^{(6)}_{i-5}+151{,}200\, h^{2}y^{(8)}_{i-5}+30{,}744\, h^{4}y^{(10)}_{i-5}\nonumber \\&+3960\, h^{6}y^{(12)}_{i-5}+359\, h^{8}y^{(14)}_{i-5} \bigg ), \end{aligned}$$

subtracting Eq. (3.51) from Eq. (3.43) yields:

$$\begin{aligned} \Gamma {\tilde{d}_{6,i}}=\text{ O }\left( h^{10}\parallel {y^{16}}\parallel \right) . \end{aligned}$$
(3.52)

If we assume that \(g_{i}=y^{(5)}_{i}+\frac{h^{6}}{6048}y^{(11)}_{i}-\frac{h^{8}}{34560}y^{(13)}_{i}\),  then using Eq. (3.46) yields:

$$\begin{aligned} \Gamma {g_{i}}= & {} 362{,}880\,y^{(5)}_{i}+151{,}200\, h^{2}y^{(7)}_{i}+30{,}240\, h^{4}y^{(9)}_{i}\nonumber \\&+\,3930\, h^{6}y^{(11)}_{i}+371\, h^{8}y^{(13)}_{i}+\text{ O }\left( h^{8}\right) . \end{aligned}$$
(3.53)

Let

$$\begin{aligned} \tilde{d}_{5,i}= & {} S^{(5)}_{i}-\left( 362{,}880\,y^{(5)}_{i}+151{,}200\, h^{2}y^{(7)}_{i}+30{,}240\, h^{4}y^{(9)}_{i}\right. \nonumber \\&\left. +\,3930\, h^{6}y^{(11)}_{i}+371\, h^{8}y^{(13)}_{i}\right) , \end{aligned}$$

subtracting Eq. (3.53) from Eq. (3.42) yields:

$$\begin{aligned} \Gamma {\tilde{d}_{5,i}}=\text{ O }\left( h^{10}\parallel {y^{16}}\parallel \right) . \end{aligned}$$
(3.54)

If we assume that

$$\begin{aligned} g_{i}=y^{(4)}_{i}-\frac{h^{6}}{30{,}240}\,y^{(10)}_{i}+\frac{h^{8}}{57{,}600}\,y^{(12)}_{i}, \end{aligned}$$

then using Eq. (3.46) yields:

$$\begin{aligned} \Gamma {g_{i}}= & {} 362{,}880\,y^{(4)}_{i-5}+151{,}200\, h^{2}y^{(6)}_{i-5}+30{,}240\, h^{4}y^{(8)}_{i-5}\nonumber \\&+3858\, h^{6}y^{(10)}_{i-5}+\frac{1789}{5}\, h^{8}y^{(12)}_{i-5}+\text{ O }\left( h^{10}\right) . \end{aligned}$$
(3.55)

Let

$$\begin{aligned} \tilde{d}_{4,i}= & {} S^{(4)}_{i}-\left( 362{,}880\,y^{(4)}_{i}+151{,}200\, h^{2}y^{(6)}_{i}+30{,}240\, h^{4}y^{(8)}_{i}\right. \nonumber \\&\left. +3858\, h^{6}y^{(10)}_{i}+\frac{1789}{5}\, h^{8}y^{(12)}_{i} \right) , \end{aligned}$$

subtracting Eq. (3.55) from Eq. (3.41) yields:

$$\begin{aligned} \Gamma {\tilde{d}_{4,i}}=\text{ O }\left( h^{10}\parallel {y^{16}}\parallel \right) . \end{aligned}$$
(3.56)

If we assume that \(g_{i}=y^{(3)}_{i}-\frac{h^{8}}{172{,}800}y^{(11)}_{i}\),  then using Eq. (3.15) yields:

$$\begin{aligned} \Gamma {g_{i}}= & {} 362{,}880 y^{(3)}_{i}+151{,}200 h^{2}y^{(5)}_{i}+30{,}240 h^{4}y^{(7)}_{i}\nonumber \\&+3870 h^{6}y^{(9)}_{i}+\frac{1772}{5} h^{8}y^{(11)}_{i}+\text{ O }\left( h^{11}\right) . \end{aligned}$$
(3.57)

Let

$$\begin{aligned} \tilde{d}_{3,i}= & {} S^{(3)}_{i}-\left( 362{,}880\,y^{(3)}_{i}+151{,}200\, h^{2}y^{(5)}_{i}+30{,}240\, h^{4}y^{(7)}_{i}\right. \nonumber \\&\left. +3870\, h^{6}y^{(9)}_{i}+\frac{1772}{5}\, h^{8}y^{(11)}_{i} \right) , \end{aligned}$$

subtracting Eq. (3.57) from Eq. (3.40) yields:

$$\begin{aligned} \Gamma {\tilde{d}_{3,i}}=\text{ O }\left( h^{10}\parallel {y^{16}}\parallel \right) . \end{aligned}$$
(3.58)

If we assume that \(g_{i}=y^{\prime \prime }_{i}+\frac{h^{8}}{12{,}096{,}000}\,y^{(10)}_{i}\),  then using Eq. (3.15) yields:

$$\begin{aligned} \Gamma {g_{i}}= & {} 362{,}880y^{\prime \prime }_{i}+151{,}200\, h^{2}y^{(4)}_{i}+30{,}240\, h^{4}y^{(6)}_{i}\nonumber \\&+3870\, h^{6}y^{(8)}_{i}+\frac{1784}{5}\, h^{8}y^{(10)}_{i}+\text{ O }\left( h^{10}\right) . \end{aligned}$$
(3.59)

Let

$$\begin{aligned} \tilde{d}_{2,i}= & {} S^{\prime \prime }_{i}-\left( 362{,}880\, y^{\prime \prime }_{i}+151{,}200\, h^{2}y^{(4)}_{i}+30{,}240\, h^{4}y^{(6)}_{i}\right. \nonumber \\&\left. +3870\, h^{6}y^{(8)}_{i}+\frac{1784}{5}\, h^{8}y^{(10)}_{i} \right) , \end{aligned}$$

subtracting Eq. (3.59) from Eq. (3.39) yields:

$$\begin{aligned} \Gamma {\tilde{d}_{2,i}}=\text{ O }\left( h^{10}\parallel {y^{16}}\parallel \right) . \end{aligned}$$
(3.60)

If we assume that \(g_{i}=y^{\prime }_{i}\),  then using Eq. (3.47) yields:

$$\begin{aligned} \Gamma {g_{i}}= & {} 362{,}880\, y^{\prime }_{i}+151{,}200\, h^{2}y^{(3)}_{i}+30{,}240\, h^{4}y^{(5)}_{i}\nonumber \\&+3870\, h^{6}y^{(7)}_{i}+\frac{713}{2}\, h^{8}y^{(9)}_{i}+\text{ O }\left( h^{10}\right) . \end{aligned}$$
(3.61)

Let

$$\begin{aligned} \tilde{d}_{1,i}=S^{\prime }_{i}-\bigg (362{,}880y^{\prime }_{i}+151{,}200\, h^{2}y^{(3)}_{i}+30{,}240\, h^{4}y^{(5)}_{i}+3870\, h^{6}y^{(7)}_{i}+\frac{713}{2}\, h^{8}y^{(9)}_{i}. \bigg ), \end{aligned}$$

subtracting Eq. (3.61) from Eq. (3.38) yields:

$$\begin{aligned} \Gamma {\tilde{d}_{1,i}}=\text{ O }\left( h^{10}\parallel {y^{16}}\parallel \right) . \end{aligned}$$
(3.62)

Since the coefficient matrices of the systems of Eqs. (3.48), (3.50), (3.52), (3.54), (3.56), (3.58), (3.60) and (3.62) are diagonally dominant and their inverses are bounded then \(\tilde{d}_{k,i}=O(h^{10}),\,k=1(1)6,\,i=0, 1, 2, \ldots , n\), hence; the proof of all relations of this theorem is completed. \(\square \)

4 Linear singular higher-order boundary-value problems

To overcome the singularity at \(x=0\), we apply L’Hopital’s rule as x approaches zero to the terms \(\frac{k}{x}y^{\prime }(x)\) and \(\frac{k}{x^{2}}y(x)\) in Eq. (1.1) as follows [8]:

$$\begin{aligned} \lim _{x\rightarrow 0}\left[ y^{(2r)}(x)+\frac{k_{1}}{x}y^{\prime }(x)+\frac{k_{2}}{x^{2}}y(x)\right] =\lim _{x\rightarrow 0}\left[ f(x,y(x),y^{\prime }(x),\ldots ,y^{(2r-1)}(x))\right] , \end{aligned}$$

since

$$\begin{aligned} \lim _{x\rightarrow 0}\frac{k_{1}}{x}y^{\prime }(x)=\frac{0}{0},\Rightarrow \lim _{x\rightarrow 0}\frac{k_{1}}{1}y^{\prime \prime }(x)=k_{1}y^{\prime \prime }(0), \end{aligned}$$

similarly

$$\begin{aligned} \lim _{x\rightarrow 0}\frac{k_{2}}{x^{2}}y(x)=\frac{0}{0},\Rightarrow \lim _{x\rightarrow 0}\frac{k_{2}}{2}y^{\prime \prime }(x)=\frac{k_{2}}{2}y^{\prime \prime }(0). \end{aligned}$$

So the BVP in Eq. (1.1) is modified at the singular point \(x=0\) to the following form

$$\begin{aligned} y^{(2r)}(0)+\left( k_{1}+\frac{k_{2}}{2}\right) y^{\prime \prime }(0)=f\left( 0,y(0),y^{\prime }(0),\ldots ,y^{(2r-1)}(0)\right) . \end{aligned}$$
(4.1)

Let the solution y(x) of the problem (1.1)–(4.1) be approximated by

$$\begin{aligned} y(x_{i})=\sum \limits _{j=-d}^{n-1}\,c_{j}\,B_{j}(x_{i}), \end{aligned}$$
(4.2)

where \(c_j\) are unknown real coefficients and \(B_j(x)\) are the (2r+1)-degree B-spline functions. Let \(x_0, x_1, \ldots , x_n\) be \(n + 1\) grid points in the interval [0, 1] so that \( x_i = ih, i = 0, 1, 2, \ldots , n\) where

$$\begin{aligned} x_0=0,\quad x_n=1,\quad \text{ and }\quad h=\frac{1}{n} \end{aligned}$$

It is required that the approximate solution satisfies the differential equation at the points \(x = x_i\), and we can easily deduce the following

$$\begin{aligned}&y^{\prime }(x_{i})=\sum \limits _{j=-d}^{n-1}\,c_{j}\,B^{\prime }_{j}(x_{i}),\quad y^{(2r)}(x_{i})=\sum \limits _{j=-d}^{n-1}\,c_{j}\,B^{(2r)}_{j}(x_{i}),\quad r=2,3,4,\nonumber \\&\quad \text{ and }\quad d=2r+1. \end{aligned}$$
(4.3)

Theorem 4.1

If the assumed approximate solution of the problem (1.1)–(4.1) is (4.2) then the discrete collocation system for the determination of the unknown coefficients \(\{c_j\}_{j=-d}^{n-1}\) is given by

$$\begin{aligned} \sum \limits _{j=-d}^{n-1}\,\left[ B_{j}^{(2r)}(x_{i})+\frac{k_{1}}{x_{i}}B^{\prime }_{j}(x_{i})+\frac{k_{2}}{x_{i}^{^{2}}}B_{j}(x_{i})\right] \,c_{j}=f(x_{i}), \end{aligned}$$
(4.4)

and

$$\begin{aligned} \sum \limits _{j=-d}^{n-1}\,\left[ B_{j}^{(2r)}(0)+\left( k_{1}+\frac{k_{2}}{2}\right) B^{\prime \prime }_{j}(0)\right] \,c_{j}= f(0), \end{aligned}$$
(4.5)

and boundary conditions (1.2) can be written as

$$\begin{aligned} \begin{array}{ll} &{} \displaystyle \sum \limits _{j=-d}^{n-1}c_jB_j(0) = 0, \quad \sum \limits _{j=-d}^{n-1}c_jB^{\prime }_j(0) = 0,\quad \sum \limits _{j=-d}^{n-1}\,c_{j}\,B_{j}^{(i)}(0)=\alpha _{i}, \quad i=2,3,\ldots ,r-1.\\ &{}\displaystyle \sum \limits _{j=-d}^{n-1}\,c_{j}\,B_{j}^{(i)}(1) =\beta _{i}, \quad i=0,1,\ldots ,r-1. \end{array} \end{aligned}$$
(4.6)

Proof

We replace each term of (1.1)–(4.1) with its corresponding approximation given by (4.3) and substituting \(x = x_i\) and applying the collocation to it. \(\square \)

Then the system in (4.4)–(4.6) takes the matrix form

$$\begin{aligned} \mathbf A\,C =\mathbf F , \end{aligned}$$
(4.7)

i.e.

$$\begin{aligned} \left[ \begin{array}{c} \mathbf A _{0}\\ \mathbf A \\ \mathbf A _{n}\\ \end{array} \right] \, \left( \begin{array}{c} c_{-d} \\ c_{-d+1} \\ \vdots \\ c_{n-2} \\ c_{n-1} \\ \end{array} \right) = \left[ \begin{array}{c} \mathbf F _{0}\\ \mathbf F \\ \mathbf F _{n}\\ \end{array} \right] , \end{aligned}$$
(4.8)
$$\begin{aligned} \mathbf F _{0}= \left( \begin{array}{c} 0 \\ 0 \\ \alpha _{2} \\ \vdots \\ \alpha _{r-1} \\ \end{array} \right) ,\quad \mathbf F = \left( \begin{array}{c} f(x_{0}) \\ f(x_{1}) \\ \vdots \\ \vdots \\ f(x_{n}) \\ \end{array} \right) ,\quad \mathbf F _{n}= \left( \begin{array}{c} \beta _{r-1}\\ \beta _{r-2}\\ \vdots \\ \beta _{1} \\ \beta _{0} \\ \end{array} \right) , \end{aligned}$$
$$\begin{aligned} \mathbf A _{0}= \left[ \begin{array}{c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c} B_{-d}(x_{0}) &{} B_{-d+1}(x_{0}) &{} \cdots &{} B_{-1}(x_{0}) &{} 0 &{} \cdots &{} 0 \\ B^{\prime }_{-d}(x_{0}) &{} B^{\prime }_{-d+1}(x_{0}) &{} \quad &{} B^{\prime }_{-1}(x_{0}) &{} 0 &{} \cdots &{} 0\\ \vdots &{} \vdots &{} \quad &{} \vdots &{} \vdots &{} \quad &{} \vdots \\ B_{-d}^{(r-1)}(x_{0}) &{} B_{-d+1}^{(r-1)}(x_{0}) &{} \cdots &{} B_{-1}^{(r-1)}(x_{0}) &{} 0 &{} \cdots &{} 0 \\ \end{array} \right] , \end{aligned}$$
$$\begin{aligned} \mathbf A _{n}= \left[ \begin{array}{ccccccc} 0 &{} \cdots &{} 0 &{} B_{-d}^{(r-1)}(x_{n}) &{} B_{-d+1}^{(r-1)}(x_{n}) &{} \cdots &{} B_{-1}^{(r-1)}(x_{n}) \\ \vdots &{} \quad &{} \vdots &{} \vdots &{} \vdots &{} \quad &{} \vdots \\ 0 &{} \cdots &{} 0 &{} B^{\prime }_{-d}(x_{n}) &{} B^{\prime }_{-d+1}(x_{n}) &{} \cdots &{} B^{\prime }_{-1}(x_{n})\\ 0 &{} \cdots &{} 0 &{} B_{-d}(x_{n}) &{} B_{-d+1}(x_{n}) &{} \cdots &{} B_{-1}(x_{n}) \\ \end{array} \right] , \end{aligned}$$

and

$$\begin{aligned} \mathbf A = \left[ \begin{array}{c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c} w_{00} &{} w_{01} &{} \cdots &{} w_{0(d-1)} &{} 0 &{} \cdots &{} \cdots &{} 0 \\ 0 &{} w_{11} &{} w_{12} &{} \cdots &{} w_{1(d)} &{} 0 &{} 0 &{} \vdots \\ \vdots &{} 0 &{} w_{22} &{} w_{23} &{} \cdots &{} w_{2(d+1)} &{} 0 &{} \quad \\ \quad &{} \vdots &{} 0 &{} \ddots &{} \quad &{} \ddots &{} \quad &{} \vdots \\ \vdots &{} \quad &{} \quad &{} \quad &{} \quad &{} \quad &{} \quad &{} 0 \\ 0 &{} \quad &{} \quad &{} \quad &{} w_{n-1(n-1)} &{} \cdots &{} w_{n-1(n-2)} &{} 0 \\ 0 &{} \cdots &{} \quad &{} \cdots &{} 0 &{} w_{n(-d+n)} &{} \cdots &{} w_{n(n-1)} \\ \end{array} \right] . \end{aligned}$$

Notice that, \( \mathbf A _{0}\) is  \( n+1\,\times \, r \)  dimensional matrix, its coefficients are the coefficients of the boundary conditions equations at \( x_{0},(x=0)\), \( \mathbf A _{n}\) is  \( n+1\,\times \, r \,\) dimensional matrix, its coefficients are the coefficients of the boundary conditions equations at \( x_{n},(x=1)\) and \( \mathbf A \) is a (2r+1)-diagonal matrix of order  \( n+1\,\times \,n+2r+1\, \) with d non-zero bands, such that its elements have the following form:

$$\begin{aligned} w_{ijj}= & {} B_{-d+jj}^{(2r)}(0)+\left( a_{2}(0)+k_{1}+\frac{k_{2}}{2}\right) B^{\prime \prime }_{-d+jj}(0),\quad {for}\quad x=0,\\ w_{ijj}= & {} B_{-d+jj}^{(2r)}\left( x_{i})+\frac{k_{1}}{x_{i}}B^{\prime }_{-d+jj}(x_{i}\right) +\frac{k_{2}}{x_{i}^{2}}B_{-d+jj}(x_{i}),\quad {for}\quad x_{i}\ne 0, \end{aligned}$$

where \( jj=i,i+1,\ldots ,n+d-1 \), and \( i=1, 2,\ldots ,n \). Now, we have a linear system of \( n+2r+1 \) equations of the \( n+d \) unknown coefficients, namely, \(\{C_j\}_{j=-d}^{n-1}\). We can obtain the coefficients of the approximate solution by solving this linear system by Q-R method.

5 Non-linear singular higher-order boundary-value problems

In the case of non-linear problems, the quesilinearization technique has been used to linearize the given non-linear (1.1)–(4.1) to a sequence of a linear differential equations [10]. We choose a reasonable initial approximation for the function y(x) in \( f\left( x, y(x), y^{\prime }(x), \ldots , y^{(2r-1)}(x)\right) \), call it as \( y^{0}(x) \), and expand \( f\left( x,y(x),y^{\prime }(x),\ldots ,y^{(2r-1)}(x)\right) \) around the function \( y^{0}(x) \), then we obtain

$$\begin{aligned} f\left( x,y^{1},(y^{\prime })^{1},\ldots ,\left( y^{(2r-1)}\right) ^{1}\right)&=f\left( x,y^{0},(y^{\prime })^{0},\ldots ,\left( y^{(2r-1)}\right) ^{0}\right) \\&\quad +\left( y^{1}-y^{0}\right) \left( \frac{\partial f}{\partial y}\right) _{\left( x, y^{0}, (y^{\prime })^{0}, \ldots , \left( y^{2r-1}\right) ^{0}\right) }+ \cdots , \end{aligned}$$

or in general, we can write the first two-terms of the expansion for \( m= 0, 1, 2, \ldots \), ( m is the iteration index) as:

$$\begin{aligned}&f\left( x,y^{m+1}(x),(y^{\prime })^{m+1}(x),\ldots ,(y^{(2r-1)}\right) ^{m+1}(x))\nonumber \\&\quad =f\left( x,y^{m}(x),(y^{\prime })^{m}(x),\ldots ,\left( y^{(2r-1)}\right) ^{m}(x)\right) \nonumber \\&\quad \quad + \left( y^{m+1}(x) -y^{m}(x)\right) \left( \frac{\partial f}{\partial y}\right) _{\left( x, y^{m}(x), (y^{\prime })^{m}(x), \ldots , \left( y^{2r-1}\right) ^{m}(x)\right) } \end{aligned}$$
(5.1)

Substituting Eq. (5.1) in Eqs. (1.1) and (4.1), the non-linear differential equation will be converted to system of \( m+1\) linear differential equations written as

$$\begin{aligned}&\left( y^{(2r)}\right) ^{m+1}(x)+\frac{k_{1}}{x }(y^{\prime })^{m+1}(x )+ \left( \frac{k_{2}}{x ^{2}}-\left( \frac{\partial f}{\partial y}\right) _{(x , y^{m}(x ), (y^{\prime })^{m}(x ), \ldots , \left( y^{2r-1}\right) ^{m}(x ))}\right) y^{m+1}(x ) \nonumber \\&\quad =f\left( x,y^{m}(x ),(y^{\prime })^{m}(x ),\ldots ,\left( y^{(2r-1)}\right) ^{m}(x )\right) \nonumber \\&\quad \quad - y^{m}(x )\left( \frac{\partial f}{\partial y}\right) _{\left( x, y^{m}(x ), (y^{\prime })^{m}(x ), \ldots , \left( y^{2r-1}\right) ^{m}(x )\right) },\quad x \ne 0, \end{aligned}$$
(5.2)

and

$$\begin{aligned}&\left( y^{(2r)}\right) ^{m+1}(0)+\left( k_{1}+\frac{k_{2}}{2}\right) (y^{\prime \prime })^{m+1}(0)-y^{m+1}(0)\left( \frac{\partial f}{\partial y}\right) _{\left( 0, y^{m}(0), (y^{\prime })^{m}(0), \ldots , \left( y^{2r-1}\right) ^{m}(0)\right) } \nonumber \\&\quad =f\left( 0,y^{m}(0),(y^{\prime })^{m}(0),\ldots ,\left( y^{(2r-1)}\right) ^{m}(0)\right) ,\quad x = 0,\quad \end{aligned}$$
(5.3)

subject to the boundary conditions

$$\begin{aligned} y^{m+1}(0)&=(y^{\prime })^{m+1}(0)=0, \nonumber \\ \left( y^{(i)}\right) ^{m+1}(0)&=\alpha _{{i}},\quad i=2,3,\ldots , r-1,\\ \left( y^{(i)}\right) ^{ m+1} (1)&=\beta _{{i}}, \quad i=0,1, \nonumber \ldots , r-1. \end{aligned}$$
(5.4)

Now, we seek a function y(x) that approximates the solution of Eqs. (5.2)–(5.3), which may be represented at \( n+1\) knots \({x_{i}}\). Hence, \( y(x_{i})\) and its \((2r)^\mathbf{th }\) derivatives can be written at \((m+1)^\mathbf{th }\) iteration as

$$\begin{aligned} \begin{aligned} y^{m+1}(x_{i})&=\sum \limits _{j=-d}^{n-1}\,c^{m+1}_{j}\,B_{j}(x_{i}),\quad (y^{\prime })^{m+1}(x_{i})=\sum \limits _{j=-d}^{n-1}\,c^{m+1}_{j}\,B^{\prime }_{j}(x_{i}),\\ (y^{\prime \prime })^{m+1}(x_{i})&=\sum \limits _{j=-d}^{n-1}\,c_{j}\,B^{\prime \prime }_{j}(x_{i}),\quad (y^{2r})^{m+1}(x_{i})=\sum \limits _{j=-d}^{n-1}\,c^{m+1}_{j}\,B^{2r}_{j}(x_{i}), \end{aligned} \end{aligned}$$
(5.5)

where \( c_{j}^{m+1} \) are unknown real coefficients.

Theorem 5.1

If the assumed approximate solution of the problem (5.2)–(5.3) is (5.5) then the discrete collocation system for the determination of the unknown coefficients \(\{c_j\}_{j=-d}^{n-1}\) is given by

$$\begin{aligned}&\sum \limits _{j=-d}^{n-1}\,c_{j}^{m+1}\,B_{j}^{(2r)}(x_{i})+\frac{k_{1}}{x_{i}}B^{\prime }_{j}(x_{i})+ \left( \frac{k_{2}}{x_{i}^{2}}-\left( \frac{\partial f}{\partial y}\right) _ {\left( x_{i}, y^{m}(x_{i}), (y^{\prime })^{m}(x_{i}), \ldots , \left( y^{(2r-1)}\right) ^{m}(x_{i})\right) }\right) B_{j}(x_{i}) \nonumber \\&\quad = f(x_{i},y^{m}(x_{i}),(y^{\prime })^{m}(x_{i}),\ldots ,\left( y^{(2r-1)}\right) ^{m}(x_{i})) \nonumber \\&\quad \quad - y^{m}(x_{i})\left( \frac{\partial f}{\partial y}\right) _{(x_{i}, y^{m}(x_{i}), (y^{\prime })^{m}(x_{i}), \ldots , \left( y^{2r-1}\right) ^{m}(x_{i}))},\quad x_{i}\ne 0, \end{aligned}$$
(5.6)

and

$$\begin{aligned}&\sum \limits _{j=-d}^{n-1}\,c_{j}^{m+1}\,B_{j}^{(2r)}(0)+\left( k_{1}+\frac{k_{2}}{2}\right) B^{\prime \prime }_{j}(x_{i}) -\left( \frac{\partial f}{\partial y}\right) _{\left( 0, y^{m}(0), (y^{\prime })^{m}(0), \ldots , \left( y^{(2r-1)}\right) ^{m}(0)\right) }B_{j}(x_{i})\nonumber \\&\quad = f(0,y^{m}(0),(y^{\prime })^{m}(0),\ldots ,\left( y^{(2r-1)}\right) ^{m}(0)),\quad x_{i}= 0, \end{aligned}$$
(5.7)

Proof

We replace each term of (5.2)–(5.3) with its corresponding approximation given by (5.5) and substituting \(x = x_i\) and applying the collocation to it. \(\square \)

Then the system in (5.6)–(5.7) takes the matrix form

$$\begin{aligned} \mathbf Q ^{m}\,\mathbf C ^{m+1}=\mathbf D ^{m}, \end{aligned}$$
(5.8)
$$\begin{aligned} \left[ \begin{array}{c} \mathbf Q ^{m}_{0}\\ \mathbf Q ^{m}\\ \mathbf Q ^{m}_{n}\\ \end{array} \right] \left[ \begin{array}{c} c_{-d}^{m+1}\\ c_{-d+1}^{m+1}\\ \vdots \\ \\ c_{n-1}^{m+1}\\ \end{array} \right] = \left[ \begin{array}{c} \mathbf D ^{m}_{0}\\ \mathbf D ^{m}\\ \mathbf D ^{m}_{n}\\ \end{array} \right] , \end{aligned}$$
(5.9)

where

$$\begin{aligned} \mathbf D ^{m}_{0}= \left[ \begin{array}{c} 0 \\ 0 \\ \alpha _{2} \\ \vdots \\ \alpha _{r-1} \\ \end{array}\right] ,\quad \mathbf D ^{m}_{n}= \left[ \begin{array}{c} \beta _{r-1}\\ \beta _{r-2}\\ \vdots \\ \beta _{1} \\ \beta _{0} \\ \end{array} \right] , \end{aligned}$$
$$\begin{aligned} \mathbf D ^{m}= \left[ \begin{array}{c} g^{m}(0, y^{m}(0), (y^{\prime })^{m}(0), \ldots , \left( y^{(2r-1)}\right) ^{m}(0)) \\ g^{m}(x_{1}, y^{m}(x_{1}), (y^{\prime })^{m}(x_{1}), \ldots , \left( y^{(2r-1)}\right) ^{m}(x_{1})) \\ \vdots \\ \vdots \\ g^{m}(x_{n}, y^{m}(x_{n}), (y^{\prime })^{m}(x_{n}), \ldots , \left( y^{(2r-1)}\right) ^{m}(x_{n})) \\ \end{array} \right] , \end{aligned}$$
$$\begin{aligned} \mathbf Q ^{m}_{0}= \left[ \begin{array}{c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c} B_{-d}(x_{0}) &{} B_{-d+1}(x_{0}) &{} \cdots &{} B_{-1}(x_{0}) &{} 0 &{} \cdots &{} 0 \\ B^{\prime }_{-d}(x_{0}) &{} B^{\prime }_{-d+1}(x_{0}) &{} \quad &{} B^{\prime }_{-1}(x_{0}) &{} 0 &{} \cdots &{} 0\\ \vdots &{} \vdots &{} \quad &{} \vdots &{} \vdots &{} \quad &{} \vdots \\ B_{-d}^{(r-1)}(x_{0}) &{} B_{-d+1}^{(r-1)}(x_{0}) &{} \cdots &{} B_{-1}^{(r-1)}(x_{0}) &{} 0 &{} \cdots &{} 0 \\ \end{array} \right] , \end{aligned}$$
$$\begin{aligned} \mathbf Q ^{m}_{n}= \left[ \begin{array}{c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c@{\quad }c} 0 &{} \cdots &{} 0 &{} B_{-d}^{(r-1)}(x_{n}) &{} B_{-d+1}^{(r-1)}(x_{n}) &{} \cdots &{} B_{-1}^{(r-1)}(x_{n}) \\ \vdots &{} \quad &{} \vdots &{} \vdots &{} \vdots &{} \quad &{} \vdots \\ 0 &{} \cdots &{} 0 &{} B^{\prime }_{-d}(x_{n}) &{} B^{\prime }_{-d+1}(x_{n}) &{} \cdots &{} B^{\prime }_{-1}(x_{n})\\ 0 &{} \cdots &{} 0 &{} B_{-d}(x_{n}) &{} B_{-d+1}(x_{n}) &{} \cdots &{} B_{-1}(x_{n}) \\ \end{array} \right] , \end{aligned}$$

and

$$\begin{aligned} \mathbf Q ^{m}= \left[ \begin{array}{ccccccccc} v_{00} &{} v_{01} &{} \cdots &{} v_{0(d-1)} &{} 0 &{} \cdots &{} \quad &{} \cdots &{} 0 \\ 0 &{} v_{11} &{} v_{12} &{} \cdots &{} v_{1(d)} &{} 0 &{} \quad &{} 0 &{} \vdots \\ \vdots &{} 0 &{} v_{22} &{} v_{23} &{} \cdots &{} v_{2(d+1)} &{} 0 &{} \quad &{} \quad \\ \quad &{} \vdots &{} 0 &{} \ddots &{} \quad &{} \ddots &{} \quad &{} \quad &{} \vdots \\ \vdots &{} \quad &{} \quad &{} \quad &{} \quad &{} \quad &{} \quad &{} \quad &{} 0 \\ 0 &{} \quad &{} \quad &{} \quad &{} v_{n-1(n-1)} &{} v_{n-1(-d+n-1)} &{} \cdots &{} v_{n-1(n-2)} &{} 0 \\ 0 &{} \cdots &{} \quad &{} \cdots &{} 0 &{} v_{n(-d+n)} &{} v_{n(-d+n+1)} &{} \cdots &{} v_{n(n-1)} \\ \end{array} \right] . \end{aligned}$$

where:

$$\begin{aligned}&g^{m}\left( x_{0}, y^{m}(x_{0}), (y^{\prime })^{m}(x_{0}), \ldots , \left( y^{(2r-1)}\right) ^{m}(x_{0})\right) \\&\quad = f(0,y^{m}(0),(y^{\prime })^{m}(0),\ldots ,\left( y^{(2r-1)}\right) ^{m}(0)),\quad x_{i}= 0. \\&g^{m}\left( x_{i}, y^{m}(x_{i}), (y^{\prime })^{m}(x_{i}), \ldots , \left( y^{(2r-1)}\right) ^{m}(x_{i})\right) \\&\quad = f\left( x_{i},y^{m}(x_{i}),(y^{\prime })^{m}(x_{i}),\ldots ,\left( y^{(2r-1)}\right) ^{m}(x_{i})\right) \\&\quad \quad -y^{m}(x_{i})\left( \frac{\partial f}{\partial y}\right) _{(x_{i}, y^{m}(x_{i}), (y^{\prime })^{m}(x_{i}), \ldots , \left( y^{2r-1}\right) ^{m}(x_{i}))},\quad x_{i}\ne 0. \end{aligned}$$

Notice that, \( \mathbf Q ^{m}_{0}\) is \( n+1\times r \) dimensional matrix, its coefficients are the coefficients of the boundary conditions at \( x_{0},(x=0)\), \( \mathbf Q ^{m}_{n}\) is \( n+1\,\times \, r \) dimensional matrix, its coefficients are the coefficients of the boundary conditions equations at \( x_{n},(x=1)\) and \( \mathbf Q ^{m}\) is a (2r+1)-diagonal matrix of order \( n+1\,\times \, n+2r+1 \) with d non-zero bands, such that its elements have the following form:

$$\begin{aligned} v_{izz}&=B_{-d+zz}^{(2r)}(0)+\left( k_{1}+\frac{k_{2}}{2}\right) B^{\prime \prime }_{-d+zz}(0),\\&\quad -\left( \frac{\partial f}{\partial y}\right) _{\left( 0, y^{m}(0), (y^{\prime })^{m}(0), \ldots , \left( y^{(2r-1)}\right) ^{m}(0)\right) }B_{-d+zz}(0), \quad x_{i}=0,\\ v_{izz}&=B_{-d+zz}^{(2r)}(x_{i})+\frac{k_{1}}{x_{i}}B^{\prime }_{-d+zz}(x_{i})\\&\quad +\left( \frac{k_{2}}{x_{i}^{2}}-\left( \frac{\partial f}{\partial y}\right) _{\left( x_{i}, y^{m}(x_{i}), (y^{\prime })^{m}(x_{i}), \ldots , \left( y^{(2r-1)}\right) ^{m}(x_{i})\right) }\right) B_{-d+zz}(x_{i}),\quad x_{i}\ne 0, \end{aligned}$$

where \( zz=i,i+1,\ldots ,n+d-1 \), and \( i=1, 2,\ldots ,n \). Now, we have a linear system of \( n+2r+1 \) equations of the \( n+2r+1 \) unknown coefficients, namely, \( {c^{m}_{j}, j= - d,\ldots , n-1, m=0, 1, \ldots }\) We can obtain the coefficients of the approximate solution by solving this linear system.

6 Numerical results

We present some test examples constructed so that the analytical solution was known before-hand. The performance of the B-spline method is measured by the maximum absolute error \(E_{B-\text{ spline }}\) which is defined as

$$\begin{aligned} E_{B-\text{ spline }}=|y_{\text{ exact }} - y_{B-\text{ spline }}|. \end{aligned}$$

All computations were carried out using MATLAB 7.01. For the two first examples, we use B-spline of \(9^{th}\) degree, the coefficients of \( B_{i,9}\) and their derivatives, at the knots \( {x_{i}, i=0, 1, 2, \ldots , n} \) are shown in Table 2 and the two last examples, we use B-spline of \(7^{th}\) degree, the coefficients of \( B_{i,7}\) and their derivatives, at the knots \( {x_{i}, i=0, 1, 2, \ldots , n} \) are shown in Table 1.

Example 1

This is linear BVP

$$\begin{aligned} y^{(8)}+\frac{1}{x}y^{\prime }+\frac{1}{x^{2}}y= e^{x}\left( x^{3}+25x^{2}+172x+336\right) , \quad 0<x\le 1, \end{aligned}$$

subject to the boundary conditions:

$$\begin{aligned}&y(0) = y^{\prime }(0)=y^{\prime \prime }(0)=0, \quad y^{\prime \prime \prime }(0)=6,\\&y(1) = e, \quad y^{\prime }(1)=4e, \quad y^{\prime \prime }(1)=13e, \quad y^{\prime \prime \prime }(1)=34e \end{aligned}$$

whose exact solution is

$$\begin{aligned} y(x)=x^{3}e^{x} . \end{aligned}$$

This problem is solved using nonic B-spline \( B_{9}(x_{i}), i=0, 1, \ldots , n\) with \(n=20\). The results are tabulated in Table 3. Also, the maximum absolute errors of the results at different n obtained by our method are tabulated in Table 4.

Table 3 Exact solution and B-spline solution at \(n=20\) for Example 1
Table 4 Maximum absolute error in the solutions for Example 1

Example 2

This is linear BVP

$$\begin{aligned} y^{(8)}+\frac{1}{x}y^{\prime }+\frac{1}{x^{2}}y =3-4x,\quad 0<x\le 1, \end{aligned}$$

subject to the boundary conditions

$$\begin{aligned}&y(0)=0, \quad y^{\prime }(0)=0, \quad y^{\prime \prime }(0)=2, \quad y^{\prime \prime \prime }(0)=-6,\\&y(1)=0, \quad y^{\prime }(1)=-1, \quad y^{\prime \prime }(1)=-4, \quad y^{\prime \prime \prime }(1)=-6, \end{aligned}$$

whose exact solution is

$$\begin{aligned} y(x)=x^{2}(1-x) \end{aligned}$$

This problem is solved using nonic B-spline \( B_{9}(x_{i}), i=0, 1, \ldots , n\) with \(n=10\). The results are tabulated in Table 5.

Table 5 Exact solution and B-spline solution at \(n=10\) for Example 2

Example 3

Consider the nonlinear boundary value problem

$$\begin{aligned} y^{(6)}+\frac{1}{x}y^{\prime }+\frac{1}{x^{2}}y=3-e^{-x}y^{2} -4x+x^{4}e^{-x}(1-x)^{2},\quad 0<x\le 1, \end{aligned}$$

subject to the boundary conditions

$$\begin{aligned}&y(0)=0, \quad y^{\prime }(0)=0, \quad y^{\prime \prime }(0)=2, \\&y(1)=0, \quad y^{\prime }(1)=-1, \quad y^{\prime \prime }(1)=-4, \end{aligned}$$

whose exact solution is

$$\begin{aligned} y(x)=x^{2}(1-x) \end{aligned}$$

This problem is solved using septic B-spline \( B_{7}(x_{i}), i=0, 1, \ldots , n\) with \(n=20\) with \(m=2\). The results are tabulated in Table 6.

Table 6 Exact solution and B-spline solution at \(n=20,\,m=2\) for Example 3

Example 4

This is nonlinear BVP

$$\begin{aligned} y^{(6)}+\frac{1}{x}y^{\prime }+\frac{1}{x^{2}}y=\frac{y}{1+y}+ 3-4x-\frac{x^{2}(1-x)}{1+x^{2}(1-x)},\quad 0<x\le 1, \end{aligned}$$

subject to the boundary conditions

$$\begin{aligned} \begin{array}{ll} y(0) = 0, \quad y^{\prime }(0)=0, \quad y^{\prime \prime }(0)=2, \\ y(1) = 0, \quad y^{\prime }(1)=-1, \quad y^{\prime \prime }(1)=-4, \end{array} \end{aligned}$$

whose exact solution is

$$\begin{aligned} y(x)=x^{2}(1-x). \end{aligned}$$

This problem is solved using septic B-spline \( B_{7}(x_{i}), i=0, 1, \ldots , n\) with \(n=20\) with \(m=2\). The results are tabulated in Table 7.

Table 7 Exact solution and B-spline solution at \(n=20,\,m=2\) for Example 4

7 Conclusion

We presented a method for solving singular linear and nonlinear higher-order boundary value problem. This method is easy to implement and yields the desired accuracy and numerical results demonstrate this. We observed that the method works well for non-linear differential equations. Thus the proposed method is suggested as an efficient method for solving this problem.