Skip to main content

Solving nonlinear third-order three-point boundary value problems by boundary shape functions methods

Abstract

For nonlinear third-order three-point boundary value problems (BVPs), we develop two algorithms to find solutions, which automatically satisfy the specified three-point boundary conditions. We construct a boundary shape function (BSF), which is designed to automatically satisfy the boundary conditions and can be employed to develop new algorithms by assigning two different roles of free function in the BSF. In the first algorithm, we let the free functions be complete functions and the BSFs be the new bases of the solution, which not only satisfy the boundary conditions automatically, but also can be used to find solution by a collocation technique. In the second algorithm, we let the BSF be the solution of the BVP and the free function be another new variable, such that we can transform the BVP to a corresponding initial value problem for the new variable, whose initial conditions are given arbitrarily and terminal values are determined by iterations; hence, we can quickly find very accurate solution of nonlinear third-order three-point BVP through a few iterations. Numerical examples confirm the performance of the new algorithms.

Introduction

Boundary value problems (BVPs) have a lot of applications, like engineering technique, control theory and optimization, the boundary layer of fluid mechanics, aero-elasticity, sandwich beam analysis and beam deflection theory, electromagnetic waves, theory of thin film and incompressible flows. While for the conditions for the existence and uniqueness of solutions of third-order BVPs one may refer to [13], for the existence and uniqueness of third-order three-point BVPs one can read [46].

Some researchers studied and solved third-order BVPs with different boundary conditions, for instance, using finite difference method [7, 8], quintic splines [9], quartic splines [10], non-polynomial spline [11], quartic B-splines [12], Haar wavelets method [13], exponential trial functions method [14], method of fundamental solution [15, 16], and the backward substitution method [17]. With the advent of computers, it has gained importance to develop more accurate and efficient numerical methods to solve higher-order BVPs. There are plenty of the related studies in the second-order and third-order BVPs that have appeared in the literature, see [1821].

For the third-order three-point nonlinear BVP, it is difficult to exactly satisfy the boundary conditions, unless one designs the algorithm to exactly satisfy all the boundary conditions. In the paper we propose new numerical methods for solving the nonlinear third-order three-point BVPs, designing the algorithms to automatically satisfy the three-point boundary conditions, which are based on a novel concept of boundary shape function.

We arrange the paper as follows. In Sect. 2, we introduce third-order three-point nonlinear BVP with separated boundary conditions and general non-separated boundary conditions. In Sect. 3, we construct a boundary shape function and prove that it can automatically satisfy the specified three-point boundary conditions, where an arbitrary free function is existent in the boundary shape function. In Sect. 4, we develop the first numerical algorithm based on the collocation technique and the trial functions, which are generated from the boundary shape functions by asking the bases of solution to satisfy the three-point boundary conditions automatically. The shooting method is introduced in Sect. 5, where two examples are given to compare the numerical results computed by the boundary shape function method (BSFM) in Sect. 4 to that obtained by the shooting method. Taking advantage of the new concept of boundary shape function, it is easy to develop the second iterative algorithm to solve the third-order nonlinear BVPs with three-point boundary conditions in Sect. 6, where two numerical examples are tested. In Sect. 7, we extend the idea of boundary shape function to the nonlinear third-order BVP with general non-separated three-point boundary conditions. Finally, some conclusions are drawn in Sect. 8.

Third-order nonlinear boundary value problem

Let us consider a third-order nonlinear ordinary differential equation (ODE)

$$ y'''(x)=F \bigl(x,y(x),y'(x),y''(x)\bigr),\quad 0 < x < \ell , $$
(1)

with separated three-point boundary conditions

$$\begin{aligned}& c_{11} y(0)+c_{12}y'(0)+c_{13}y''(0)=b_{1}, \end{aligned}$$
(2)
$$\begin{aligned}& c_{21} y(a)+c_{22}y'(a)+c_{23}y''(a)=b_{2}, \end{aligned}$$
(3)
$$\begin{aligned}& c_{31} y(\ell )+c_{32}y'( \ell )+c_{33}y''(\ell )=b_{3}, \end{aligned}$$
(4)

where \(0< a<\ell \) and \(b_{1}\), \(b_{2}\), and \(b_{3}\) are constants, which may be zeros.

The general non-separated three-point boundary conditions:

$$\begin{aligned}& {\mathcal{L}}_{1}\bigl[y(0),y'(0),y''(0),y(a),y'(a),y''(a),y( \ell ),y'(\ell ),y''( \ell ) \bigr]=b_{1}, \end{aligned}$$
(5)
$$\begin{aligned}& {\mathcal{L}}_{2}\bigl[y(0),y'(0),y''(0),y(a),y'(a),y''(a),y( \ell ),y'(\ell ),y''( \ell ) \bigr]=b_{2}, \end{aligned}$$
(6)
$$\begin{aligned}& {\mathcal{L}}_{3}\bigl[y(0),y'(0),y''(0),y(a),y'(a),y''(a),y( \ell ),y'(\ell ),y''( \ell ) \bigr]=b_{3} \end{aligned}$$
(7)

will be considered later, where \({\mathcal{L}}_{1}\), \({\mathcal{L}}_{2}\), and \({\mathcal{L}}_{3}\) are linear operators.

The boundary shape function

The boundary shape function (BSF) is such a function that it satisfies the prescribed boundary conditions automatically. Apparently, the exact solution of the considered BVP is one member of the BSF, since it must satisfy the boundary conditions. In general, the numerical method used to approximate the exact solution cannot guarantee to automatically satisfy the boundary conditions exactly. We are going to devise a powerful method to solve Eqs. (1)–(4) based on the boundary shape functions. The idea of boundary shape function was used to solve the BVP with multipoint boundary conditions [22] and the singularly perturbed BVP with Robin boundary conditions [23]. The present problem with third-order nonlinear ODE (1), which is endowed with three-point boundary conditions (2)–(4) or the general non-separated three-point boundary conditions (5)–(7), is more difficult to be solved than the second-order BVPs in [22, 23]. We pursue this issue by the newly constructed BSF, which is a novel method for solving Eqs. (1)–(4), not yet reported in the literature.

We seek the polynomial type shape functions \(s_{k}(x)\), \(k=1,2,3\), satisfying

$$\begin{aligned}& \textstyle\begin{cases} c_{11} s_{1}(0)+c_{12}s_{1}'(0)+c_{13}s_{1}''(0)=1, \\ c_{21} s_{1}(a)+c_{22}s_{1}'(a)+c_{23}s_{1}''(a)=0, \\ c_{31} s_{1}(\ell )+c_{32}s_{1}'(\ell )+c_{33}s_{1}''(\ell )=0, \end{cases}\displaystyle \end{aligned}$$
(8)
$$\begin{aligned}& \textstyle\begin{cases} c_{11} s_{2}(0)+c_{12}s_{2}'(0)+c_{13}s_{2}''(0)=0, \\ c_{21} s_{2}(a)+c_{22}s_{2}'(a)+c_{23}s_{2}''(a)=1, \\ c_{31} s_{2}(\ell )+c_{32}s_{2}'(\ell )+c_{33}s_{2}''(\ell )=0, \end{cases}\displaystyle \end{aligned}$$
(9)
$$\begin{aligned}& \textstyle\begin{cases} c_{11} s_{3}(0)+c_{12}s_{3}'(0)+c_{13}s_{3}''(0)=0, \\ c_{21} s_{3}(a)+c_{22}s_{3}'(a)+c_{23}s_{3}''(a)=0, \\ c_{31} s_{3}(\ell )+c_{32}s_{3}'(\ell )+c_{33}s_{3}''(\ell )=1. \end{cases}\displaystyle \end{aligned}$$
(10)

Depending on the values of the coefficient matrix \(c_{ij}\), \(i,j=1,2,3\), there are many solutions of \(s_{k}(x)\), \(k=1,2,3\). However, we prefer the lower orders shape functions and do not go into the details to the derivations of \(s_{k}(x)\), \(k=1,2,3\). For each example, we will list \(s_{k}(x)\), \(k=1,2,3\), explicitly.

Theorem 1

For any free function \(f(x)\in {\mathcal{C}}^{2}[0,\ell ]\), if \(s_{k}(x)\), \(k=1,2,3\), satisfy Eqs. (8)(10), then the boundary shape function \(B(x)\), given by

$$\begin{aligned} B(x) =&f(x)+s_{1}(x)\bigl[b_{1}-c_{11} f(0)-c_{12}f'(0)-c_{13}f''(0) \bigr] \\ & {}+s_{2}(x)\bigl[b_{2}-c_{21} f(a)-c_{22}f'(a)-c_{23}f''(a) \bigr] \\ &{} +s_{3}(x)\bigl[b_{3}-c_{31} f(\ell )-c_{32}f'(\ell )-c_{33}f''( \ell )\bigr], \end{aligned}$$
(11)

is existent and satisfies the separated boundary conditions:

$$\begin{aligned}& c_{11} B(0)+c_{12}B'(0)+c_{13}B''(0)=b_{1}, \\ \end{aligned}$$
(12)
$$\begin{aligned}& c_{21} B(a)+c_{22}B'(a)+c_{23}B''(a)=b_{2}, \\ \end{aligned}$$
(13)
$$\begin{aligned}& c_{31} B(\ell )+c_{32}B'( \ell )+c_{33}B''(\ell )=b_{3}. \end{aligned}$$
(14)

Proof

The existence of \(B(x)\) is guaranteed by the existence of \(s_{k}(x)\), \(k=1,2,3\), and the existence of a free function \(f(x)\in {\mathcal{C}}^{2}[0,\ell ]\). We prove Eq. (12) at first. Inserting \(x=0\) into Eq. (11), we have

$$\begin{aligned} B(0) =&f(0)+s_{1}(0)\bigl[b_{1}-c_{11} f(0)-c_{12}f'(0)-c_{13}f''(0) \bigr] \\ &{} +s_{2}(0)\bigl[b_{2}-c_{21} f(a)-c_{22}f'(a)-c_{23}f''(a) \bigr] \\ &{} +s_{3}(0)\bigl[b_{3}-c_{31} f(\ell )-c_{32}f'(\ell )-c_{33}f''( \ell )\bigr]. \end{aligned}$$
(15)

Taking the differential of Eq. (11) and then inserting \(x=0\) leads to

$$\begin{aligned} B'(0) =&f'(0)+s_{1}'(0) \bigl[b_{1}-c_{11} f(0)-c_{12}f'(0)-c_{13}f''(0) \bigr] \\ &{} +s_{2}'(0)\bigl[b_{2}-c_{21} f(a)-c_{22}f'(a)-c_{23}f''(a) \bigr] \\ &{}+s_{3}'(0)\bigl[b_{3}-c_{31} f(\ell )-c_{32}f'(\ell )-c_{33}f''( \ell )\bigr]. \end{aligned}$$
(16)

Similarly, taking twice differentials of Eq. (11) and then inserting \(x=0\) yields

$$\begin{aligned} B''(0) =&f''(0)+s_{1}''(0) \bigl[b_{1}-c_{11} f(0)-c_{12}f'(0)-c_{13}f''(0) \bigr] \\ &{} +s_{2}''(0)\bigl[b_{2}-c_{21} f(a)-c_{22}f'(a)-c_{23}f''(a) \bigr] \\ &{} +s_{3}''(0)\bigl[b_{3}-c_{31} f(\ell )-c_{32}f'(\ell )-c_{33}f''( \ell )\bigr]. \end{aligned}$$
(17)

From Eqs. (15)–(17) it follows that

$$\begin{aligned}& c_{11} B(0)+c_{12}B'(0)+c_{13}B''(0) \\& \quad =c_{11}f(0)+c_{11}s_{1}(0) \bigl[b_{1}-c_{11} f(0)-c_{12}f'(0)-c_{13}f''(0) \bigr] \\& \qquad {} +c_{11}s_{2}(0)\bigl[b_{2}-c_{21} f(a)-c_{22}f'(a)-c_{23}f''(a) \bigr] \\& \qquad {} +c_{11}s_{3}(0)\bigl[b_{3}-c_{31} f(\ell )-c_{32}f'(\ell )-c_{33}f''( \ell )\bigr] \\& \qquad {} +c_{12} f'(0)+c_{12}s_{1}'(0) \bigl[b_{1}-c_{11} f(0)-c_{12}f'(0)-c_{13}f''(0) \bigr] \\& \qquad {}+c_{12}s_{2}'(0) \bigl[b_{2}-c_{21} f(a)-c_{22}f'(a)-c_{23}f''(a) \bigr] \\& \qquad {} +c_{12}s_{3}'(0) \bigl[b_{3}-c_{31} f(\ell )-c_{32}f'( \ell )-c_{33}f''(\ell )\bigr] \\& \qquad {} +c_{13} f''(0)+c_{13}s_{1}''(0) \bigl[b_{1}-c_{11} f(0)-c_{12}f'(0)-c_{13}f''(0) \bigr] \\& \qquad {} +c_{13}s_{2}''(0) \bigl[b_{2}-c_{21} f(a)-c_{22}f'(a)-c_{23}f''(a) \bigr] \\& \qquad {} +c_{13} s_{3}''(0) \bigl[b_{3}-c_{31} f(\ell )-c_{32}f'( \ell )-c_{33}f''(\ell )\bigr] \\& \quad =c_{11}f(0)+c_{12}f(0)+c_{13} f''(0) \\& \qquad {}+\bigl[c_{11}s_{1}(0)+c_{12}s_{1}'(0)+c_{13}s_{1}''(0) \bigr] \bigl[b_{1}-c_{11} f(0)-c_{12}f'(0)-c_{13}f''(0) \bigr] \\& {\qquad }+\bigl[c_{11}s_{2}(0)+c_{12}s_{2}'(0)+c_{13}s_{2}''(0) \bigr] \bigl[b_{2}-c_{21} f(a)-c_{22}f'(a)-c_{23}f''(a) \bigr] \\& \qquad {}+\bigl[c_{11}s_{3}(0)+c_{12}s_{3}'(0)+c_{13} s_{3}''(0)\bigr] \bigl[b_{3}-c_{31} f( \ell )-c_{32}f'(\ell )-c_{33}f''( \ell )\bigr]. \end{aligned}$$
(18)

With the aids of the first equations in Eqs. (8)–(10), Eq. (18) is reduced to

$$\begin{aligned} c_{11} B(0)+c_{12}B'(0)+c_{13}B''(0) =&c_{11}f(0)+c_{12}f(0)+c_{13} f''(0) \\ &{}+b_{1}-c_{11} f(0)-c_{12}f'(0)-c_{13}f''(0)=b_{1}. \end{aligned}$$
(19)

Thus, Eq. (12) was proven. The proofs of Eqs. (13) and (14) can be done similarly. □

In Theorem 1, there exists a free function \(f(x)\), which will be very useful for the development of the novel algorithms to solve the nonlinear third-order three-point BVPs. We have to stress that the shape functions \(s_{1}(x)\), \(s_{2}(x)\), \(s_{3}(x)\) are not unique; however, the lower-order shape functions are preferred.

First numerical algorithm

Based on the concept of boundary shape functions, we can develop a new algorithm of the boundary shape function method (BSFM) to solve Eq. (1) under three-point boundary conditions (2)–(4).

For Eq. (1), we first choose some suitable basis functions \(\phi _{j}(x), j\in {\mathbb{N}}\), which are linearly independent and complete. Then we have the following result.

Theorem 2

For any function \(\phi _{j}(x)\in {\mathcal{C}}^{3}[0,\ell ]\),

$$\begin{aligned} E_{j}(x) =&\phi _{j}(x) +s_{1}(x)\bigl[b_{1}-c_{11}\phi _{j}(0)-c_{12} \phi _{j}'(0)-c_{13} \phi _{j}''(0)\bigr] \\ &{} +s_{2}(x)\bigl[b_{2}-c_{21}\phi _{j}(a)-c_{22}\phi _{j}'(a)-c_{23} \phi _{j}''(a)\bigr] \\ &{} +s_{3}(x)\bigl[b_{3}-c_{31}\phi _{j}(\ell )-c_{32}\phi _{j}'( \ell )-c_{33} \phi _{j}''( \ell )\bigr] \end{aligned}$$
(20)

satisfies

$$\begin{aligned}& c_{11} E_{j}(0)+c_{12}E_{j}'(0)+c_{13}E_{j}''(0)=b_{1}, \\& c_{21} E_{j}(a)+c_{22}E_{j}'(a)+c_{23}E_{j}''(a)=b_{2}, \\& c_{31} E_{j}(\ell )+c_{32}E_{j}'( \ell )+c_{33}E_{j}''(\ell )=b_{3}. \end{aligned}$$
(21)

Proof

It is a direct extension of Theorem 1 to the basis function \(f(x)=\phi _{j}(x)\) and the new basis \(B(x)=E_{j}(x)\). □

Now we describe a simple method to solve \(y(x)\) in Eqs. (1)–(4). We assume that the solution \(y(x)\) can be expanded by a set of trial functions \(E_{j}(x)\):

$$ y(x)=\sum_{j=1}^{m} a_{j} E_{j}(x), $$
(22)

where \(a_{j}\) are unknown coefficients to be determined, and

$$ \sum_{j=1}^{m} a_{j}=1 $$
(23)

guarantees that \(y(x)\), expressed by Eq. (22), automatically satisfies three-point boundary conditions (2)–(4). Due to this reason, we only need to consider Eq. (1) being satisfied by \(y(x)\) in Eq. (22).

Let \({\mathbf{a}}:=\{a_{j}\}\) whose dimension is m. The algorithm of the boundary shape function method (BSFM) for solving \(y(x)\) in Eqs. (1)–(4) is summarized as follows.

  1. (i)

    Derive \(s_{1}(x)\), \(s_{2}(x)\), \(s_{3}(x)\), give m, \(n_{c}\), the initial guess of \({\mathbf{a}}_{0}\) and the convergence criterion ϵ, and then compute \(x_{i}=i\ell /(n_{c}+1)\), \(i=1,\ldots ,n_{c}\).

  2. (ii)

    For \(k=0,1,2,\ldots \) , we repeat the following steps: Solving the following algebraic equations system to obtain a:

    $$\begin{aligned}& \sum_{j=1}^{m} a_{j} E_{j}'''(x_{i})=F \Biggl(x_{i},\sum_{j=1}^{m} a_{j} E_{j}(x_{i}),\sum _{j=1}^{m} a_{j} E_{j}'(x_{i}), \sum_{j=1}^{m} a_{j} E_{j}''(x_{i}) \Biggr), \quad i=1,\ldots ,n_{c}, \\& \sum_{j=1}^{m} a_{j}=1. \end{aligned}$$

Then we have \({\mathbf{a}}_{k+1}\). If \({\mathbf{a}}_{k+1}\) converges according to a given stopping criterion \(r_{k}:=\|{\mathbf{a}}_{k+1}-{\mathbf{a}}_{k}\|< \epsilon \), then stop; otherwise, go to step (ii). When \({\mathbf{a}}:=\{a_{j}\}\) is found, \(y(x)\) is obtained from Eq. (22).

Shooting method

The shooting method is well known and well established to solve BVPs [24]. We briefly sketch the shooting method to solve Eqs. (1)–(4), which requires to adjust any two unknown initial values missed in Eq. (2) such that the resulting integrated values of \([y(a),y'(a),y''(a)]\) and \([y(\ell ),y'(\ell ),y'(\ell )]\) after integrating Eq. (1) from \(x=0\) to \(x=a\) and to \(x=\ell \) can match the boundary conditions at \(x=a\) in Eq. (3) and at \(x=\ell \) in Eq. (4).

For the purpose of demonstration, we assume that \(c_{12}\neq 0\) in Eq. (2) and let

$$ \alpha :=y(0), \qquad \beta :=y''(0) $$
(24)

denote two unknown initial values. Then, by Eq. (2), we can derive another unknown initial value

$$ y'(0)=y'_{0}:= \frac{b_{1}-c_{11}\alpha -c_{13}\beta }{c_{12}}. $$
(25)

Then we apply the fictitious time integration method (FTIM) developed by Liu and Atluri [25] to find α and β to match other two boundary conditions in Eqs. (3) and (4), which is obtained by the following iterations:

$$\begin{aligned}& \alpha _{k+1}=\alpha _{k}- \frac{\nu \Delta t}{1+t_{k}} R_{1}( \alpha _{k},\beta _{k}), \end{aligned}$$
(26)
$$\begin{aligned}& \beta _{k+1}=\beta _{k}- \frac{\nu \Delta t}{1+t_{k}} R_{2}(\alpha _{k}, \beta _{k}), \end{aligned}$$
(27)

where \(t_{k}=k\Delta t\) is a fictitious time and Δt is a time increment, and \(R_{1}\) and \(R_{2}\) denote the residuals in terms of boundary conditions (3) and (4):

$$ \begin{aligned} &R_{1}:=c_{21} y(a)+c_{22}y'(a)+c_{23}y''(a)-b_{2}, \\ & R_{2}:=c_{31} y( \ell )+c_{32}y'( \ell )+c_{33}y''(\ell )-b_{3}, \end{aligned} $$
(28)

where \(R_{1}\) and \(R_{2}\) are implicit functions of α and β.

The iterative algorithm, by using the shooting method to solve \(y(x)\) of Eqs. (1)–(4), is given as follows. (i) Give Δt, ν, the initial guesses of \(\alpha _{0}\) and \(\beta _{0}\) and the convergence criterion \(\varepsilon _{0}\), and \(\Delta x=\ell /N\). (ii) Repeat \(k=0,1,2,\ldots \) , integrating Eq. (1) by the fourth-order Runge–Kutta method (RK4) with \(y(0)=\alpha _{k}\), \(y'(0)=y'_{0}\), \(y''(0)=\beta _{k}\) and with \(N_{1}=\ell /a\) steps from \(x=0\) to \(x=a\) and with N steps from \(x=0\) to \(x=\ell \). Taking

$$ \alpha _{k+1}=\alpha _{k}-\frac{\nu \Delta t}{1+t_{k}} R_{1}(\alpha _{k}, \beta _{k}),\quad \beta _{k+1}=\beta _{k}-\frac{\nu \Delta t}{1+t_{k}} R_{2}( \alpha _{k},\beta _{k}), $$

if \(\alpha _{k+1}\) and \(\beta _{k+1}\) converge according to a given stopping criterion

$$ r_{k}:=\sqrt{(\alpha _{k+1}-\alpha _{k})^{2}+( \beta _{k+1}-\beta _{k})^{2}}< \varepsilon _{0}, $$

then terminate the iteration; otherwise, go to (ii) for the next iteration.

Example 1

We first consider the following three-point BVP [26]:

$$\begin{aligned}& \begin{aligned} &y'''(x)-a_{0} y'(x)+b_{0}=0,\quad 0 < x < 1, \\ &y'(0)=0,\qquad y(1/2)=0,\qquad y'(1)=0, \end{aligned} \end{aligned}$$
(29)

whose exact solution is

$$ y(x)=\frac{b_{0}}{a_{0}^{3}} \biggl[ \sinh \frac{a_{0}}{2}- \sinh (a_{0} x) +a_{0} \biggl(x-\frac{1}{2} \biggr) +\tanh \frac{a_{0}}{2} \biggl( \cosh (a_{0} x)-\cosh \frac{a_{0}}{2} \biggr) \biggr]. $$
(30)

For this problem, we take the following trial functions:

$$ \textstyle\begin{cases} \phi _{i}(x)=\frac{e^{i (x-1/2)}-1}{e^{i/2}-1},& i=-m_{1},\ldots ,-1,1, \ldots ,m_{1}, \\ \phi _{0}(x)=0. \end{cases} $$
(31)

Through some operations, we can obtain \(s_{1}(x)=x-11x^{2}/4+3x^{3}/2\), \(s_{2}(x)=6x^{2}-4x^{3}\) and \(s_{3}(x)=x^{3}/2-x^{2}/4\). Under the following parameters \(a_{0}=2\), \(b_{0}=-3\), \(m_{1}=5\) (\(m=11\)), \(n_{c}=100\), and \(\epsilon =10^{-8}\) the algorithm converges after 153 steps as shown in Fig. 1(a). From Fig. 1(b) we can find that the numerical solution \(y(x)\) is very close to the exact one with the maximum error (ME) being \(2.23\times 10^{-11}\). The comparison of the errors in absolute values between the BSFM and other methods shows that the accuracy is much better than that computed in [27, 28] with about three orders, and than that computed by Li and Wu [29] with about five orders. In Table 1, we list the numerical solutions and the absolute errors at different positions, where 1.31E(−11) means that the absolute error is \(1.31\times 10^{-11}\), etc.

Figure 1
figure 1

For Example 1 of a three-point BVP solved by the BSFM, (a) showing convergence behavior and (b) comparing numerical and exact solutions and showing numerical error

Table 1 For Example 1, showing the numerical solutions and the absolute errors obtained by the BSFM at different points

If we adjust the parameters to \(a_{0}=5\), \(b_{0}=1\) as those employed by Pandey [8], the algorithm BSFM converges after 55 steps and the ME is \(2.6\times 10^{-11}\), which is also much better than that computed in [8].

By using the shooting method presented above, we take \(a_{0}=2\), \(b_{0}=-3\), \(\Delta t=0.01\), \(\nu =50\), \(N=100\), \(R_{1}=y(1/2)\), \(R_{2}=y'(1)\), and the initial guesses \(\alpha =0\) and \(\beta =0\), which is convergence with 43 iterations under \(\varepsilon _{0}=10^{-10}\) and the maximum error is \(1.51\times 10^{-2}\). It can be seen that the convergence speed of the shooting method is faster than that of the BSFM; however, the accuracy of the BSFM with \(\mathrm{ME}=2.23\times 10^{-11}\) is much better than that of the shooting method with about nine orders as shown in Fig. 2(a).

Figure 2
figure 2

Comparing the numerical errors obtained by the shooting method and the BSFM for (a) Example 1 and (b) Example 2

Example 2

Then we consider the following three-point BVP [28, 30]:

$$\begin{aligned}& y'''(x)+ \frac{e^{x/2}}{2}y''(x)-2e^{x}\sin \sqrt{x}y(x)=h(x), \quad 0 < x < 1, \\& y(0)=0,\qquad y(1/2)=0,\qquad y(1)=0, \\& h(x)=6+e^{x/2} \biggl(3x-\frac{3}{2} \biggr)-xe^{x} \bigl(1-3x+2x^{2}\bigr) \sin \sqrt{x}, \end{aligned}$$
(32)

whose exact solution is

$$ y(x)=x(x-1) \biggl(x-\frac{1}{2} \biggr). $$
(33)

We apply the BSFM to solve this problem with the following trial functions:

$$ \phi _{j}(x)=x^{j}, \quad j=1,\ldots ,m, $$
(34)

and the solution is expressed by

$$ y(x)=\sum_{j=1}^{m} a_{j} E_{j}(x), $$
(35)

where \(E_{j}(x)\) were given by Eq. (20).

We can obtain \(s_{1}(x)=1-3x+2x^{2}\), \(s_{2}(x)=4x-4x^{2}\), and \(s_{3}(x)=2x^{2}-x\). Under the following parameters \(m=4\), \(n_{c}=50\), and \(\epsilon =10^{-10}\), the algorithm converges after two steps as shown in Fig. 3(a). From Fig. 3(b) we can find that the numerical solution \(y(x)\) is very close to the exact one with ME being \(7.69\times 10^{-13}\). The accuracy is much better than that computed in [28, 30] with about six orders.

Figure 3
figure 3

For Example 2 of a three-point BVP solved by the BSFM, (a) showing convergence behavior and (b) comparing numerical and exact solutions and showing numerical error

By using the shooting method, we take \(\Delta t=0.01\), \(\nu =300\), \(N=100\), \(R_{1}=y(1/2)\), \(R_{2}=y(1)\), and the initial guesses \(\alpha =0\) and \(\beta =0\), which is convergence with 80 iterations under \(\varepsilon _{0}=10^{-10}\) and the maximum error is \(5.17\times 10^{-5}\). It can be seen that both the convergence speed of the BSFM is faster than that of the shooting method and the accuracy of the BSFM with \(\mathrm{ME}=7.69\times 10^{-13}\) is much better than that of the shooting method with about eight orders as shown in Fig. 2(b).

Second numerical algorithm

On the other hand, based on the concept of boundary shape function, we can develop another iterative algorithm to solve Eqs. (1)–(4). According to Theorem 1, \(B(x)\) given in Eq. (11) satisfies the three-point boundary conditions in Eqs. (2)–(4). Thus, when we consider the variable transformation from \(y(x)\) to a new variable \(u(x)\),

$$\begin{aligned} y(x) =&u(x)+s_{1}(x)\bigl[b_{1}-c_{11}u(0)-c_{12}u'(0)-c_{13}u''(0) \bigr] \\ &{} +s_{2}(x)\bigl[b_{2}-c_{21} u(a)-c_{22}u'(a)-c_{23}u''(a) \bigr] \\ &{} +s_{3}(x)\bigl[b_{3}-c_{31}u( \ell )-c_{32}u'(\ell )-c_{33}u''( \ell )\bigr], \end{aligned}$$
(36)

for any function \(u(x)\in {\mathcal{C}}^{3}[0,\ell ]\), the above \(y(x)\) automatically satisfies boundary conditions (2)–(4).

Inserting Eq. (36) for \(y(x)\) into Eq. (1), we generate a new third-order ODE for \(u(x)\):

$$ u'''(x)=H \bigl(x,u(x),u'(x),u''(x);{ \mathbf{z}}\bigr), $$
(37)

which can be viewed as an initial value problem (IVP), whose initial values are given arbitrarily, say, \(u(0)=u'(0)=u''(0)=0\). However, there are a number of unknown parameters \(u(a)\), \(u'(a)\), \(u''(a)\), \(u(\ell )\), \(u'(\ell )\), \(u''(\ell )\) to be determined, which are collected as \({\mathbf{z}}:=[u(a), u'(a), u''(a), u(\ell ), u'(\ell ), u''(\ell )]^{\text{T}}\).

Letting

$$ u_{1}(x):=u(x), \qquad u_{2}(x):=u'(x), \qquad u_{3}(x):=u''(x), $$
(38)

from Eq. (37) it follows that

$$\begin{aligned}& u_{1}'(x)=u_{2}(x), \\& u_{2}'(x)=u_{3}(x), \\& u_{3}'(x)=H\bigl(x,u_{1}(x),u_{2}(x),u_{3}(x);{ \mathbf{z}}\bigr), \end{aligned}$$
(39)

which are subjected to the given initial conditions \(u_{1}(0)\), \(u_{2}(0)\), and \(u_{3}(0)\). Unfortunately, \({\mathbf{z}}:=[u_{1}(a), u_{2}(a), u_{3}(a), u_{1}(\ell ), u_{2}(\ell ), u_{3}( \ell )]^{\text{T}}\) is an unknown vector. If z is available, we can apply the RK4 to integrate the ODEs in Eq. (39) and then \(y(x)\) is obtained from Eq. (36).

The iterative algorithm BSFM for solving \(y(x)\) of Eqs. (1)–(4) is summarized as follows.

  1. (i)

    Derive \(s_{1}(x)\), \(s_{2}(x)\), \(s_{3}(x)\), give \(u_{1}(0)\), \(u_{2}(0)\), \(u_{3}(0)\), an initial guess of \({\mathbf{z}}_{0}\), and the convergence criterion ϵ, and then compute \(\Delta x=\ell /N\) with N given.

  2. (ii)

    For \(k=0,1,2,\ldots \) , we repeat the following iterations: Applying the RK4 to integrate the following ODEs with \(N_{1}=a/\Delta x\) steps to \(x=a\), and N steps to \(x=\ell \):

    $$\begin{aligned}& u_{1}'(x)=u_{2}(x), \\& u_{2}'(x)=u_{3}(x), \\& u_{3}'(x)=H\bigl(x,u_{1}(x),u_{2}(x),u_{3}(x);{ \mathbf{z}}_{k}\bigr). \end{aligned}$$

Taking

$$ {\mathbf{z}}_{k+1}=\bigl[u_{1}(a), u_{2}(a), u_{3}(a), u_{1}(\ell ), u_{2}( \ell ), u_{3}(\ell )\bigr]^{\text{T}}, $$

if \({\mathbf{z}}_{k+1}\) converges according to a given stopping criterion \(r_{k}:=\|{\mathbf{z}}_{k+1}-{\mathbf{z}}_{k}\|< \epsilon \), then stop; otherwise, go to step (ii). When \(u(x)=u_{1}(x)\) is solved, \(y(x)\) is obtained from Eq. (36).

Example 3

We recast Example 2 to a nonlinear one:

$$\begin{aligned}& y'''(x)+ \frac{e^{x/2}}{2}y''(x)-2e^{x}\sin \sqrt{x}y(x)+y''(x)^{2}=h(x), \quad 0 < x < 1, \\& y(0)=0,\qquad y(1/2)=0,\qquad y(1)=0, \\& h(x)=6+e^{x/2} \biggl(3x-\frac{3}{2} \biggr)-xe^{x} \bigl(1-3x+2x^{2}\bigr) \sin \sqrt{x}+(6x-3)^{3}, \end{aligned}$$
(40)

whose exact solution is given by Eq. (33).

We apply the above iterative algorithm BSFM to solve this problem with \(s_{1}(x)=1-3x+2x^{2}\), \(s_{2}(x)=4x-4x^{2}\), and \(s_{3}(x)=2x^{2}-x\). Under the following parameters \(u_{1}(0)=u_{2}(0)=u_{3}(0)=0\), \({\mathbf{z}}_{0}=(0,0)^{\text{T}}\), \(N=500\), and \(\epsilon =10^{-10}\), the algorithm converges after 1148 iterations as shown in Fig. 4(a). From Fig. 4(b) we can find that the numerical solution \(y(x)\) is very close to the exact one with ME being \(7.42\times 10^{-11}\). Although the nonlinear three-point BVP is considered here, the accuracy is much better than that computed in [28, 30] with about four orders. In Table 2, we list the numerical solutions and the absolute errors at different positions.

Figure 4
figure 4

For Example 3 of a nonlinear three-point BVP solved by the BSFM, (a) showing convergence behavior and (b) comparing numerical and exact solutions and showing numerical error

Table 2 For Example 3, showing the numerical solutions and the absolute errors obtained by the BSFM at different points

By using the shooting method, we take \(\Delta t=0.01\), \(\nu =200\), \(N=100\), \(R_{1}=y(1/2)\), \(R_{2}=y(1)\), and the initial guesses \(\alpha =0\) and \(\beta =0\), which is convergence with 71 iterations under \(\varepsilon _{0}=10^{-10}\) and the maximum error is \(1.8\times 10^{-2}\). It can be seen that both the convergence speed of the BSFM is faster than that of the shooting method and the accuracy of the BSFM with \(\mathrm{ME}=7.42\times 10^{-11}\) is much better than that of the shooting method with about nine orders as shown in Fig. 5(a).

Figure 5
figure 5

Comparing the numerical errors obtained by the shooting method and the BSFM for (a) Example 3 and (b) Example 4

Example 4

We consider the following nonlinear three-point BVP:

$$\begin{aligned}& \begin{aligned} &y'''(x)+y'(x)^{2}-y^{3}(x)=h(x), \quad 0 < x < 1, \\ &y(0)=0, \qquad y'(1/2)-y''(1/2)= \pi ^{2} e^{1/2},\qquad y(1)=0, \end{aligned} \end{aligned}$$
(41)

whose exact solution is given by \(y(x)=e^{x}\sin (\pi x)\) such that \(h(x)\) can be computed by inserting \(y(x)=e^{x}\sin (\pi x)\) into Eq. (41).

We apply the BSFM to solve this problem with \(s_{1}(x)=1-x/2-x^{2}/2\), \(s_{2}(x)=x/2-x^{2}/2\) and \(s_{3}(x)=x/2+x^{2}/2\). Under the following parameters \(u_{1}(0)=u_{2}(0)=u_{3}(0)=0\), \({\mathbf{z}}_{0}=(0,0,0)^{\text{T}}\), \(N=200\), and \(\epsilon =10^{-10}\) the algorithm converges after 31 iterations as shown in Fig. 6(a). From Fig. 6(b) we can find that the numerical solution \(y(x)\) is very close to the exact one with ME being \(6.24\times 10^{-10}\). Although the nonlinear three-point BVP is considered here, the accuracy is very good. In Table 3, we list the numerical solutions and the absolute errors at different positions.

Figure 6
figure 6

For Example 4 of a nonlinear three-point BVP solved by the BSFM, (a) showing convergence behavior and (b) comparing numerical and exact solutions and showing numerical error

Table 3 For Example 4, showing the numerical solutions and the absolute errors obtained by the BSFM at different points

By using the shooting method, we take \(\Delta t=0.01\), \(\nu =90\), \(N=100\), \(R_{1}=y(1/2)-y''(1/2)-\pi ^{2} e^{1/2}\), \(R_{2}=y(1)\), and the initial guesses \(\alpha =0\) and \(\beta =0\), which is convergence with 85 iterations under \(\varepsilon _{0}=10^{-10}\) and the maximum error is \(1.72\times 10^{-3}\). It can be seen that both the convergence speed of the BSFM is faster than that of the shooting method and the accuracy of the BSFM with \(\mathrm{ME}=6.24\times 10^{-10}\) is much better than that of the shooting method with about seven orders as shown in Fig. 5(b).

Non-separated three-point BVP

In this section we extend Theorem 1 to the non-separated three-point boundary conditions. The following example is used to demonstrate the new idea.

Example 5

We first consider the following non-separated three-point BVP [28] as a demonstrative case to introduce the concept of boundary shape function for the non-separated three-point boundary conditions:

$$\begin{aligned}& y'''(x)+xy''(x)=3x-6x^{2}-6, \quad 0 < x < 1, \end{aligned}$$
(42)
$$\begin{aligned}& y(0)=0, \qquad y'(0)=0,\qquad y'(1/2)-y'(1)=\frac{3}{4}, \end{aligned}$$
(43)

whose exact solution is

$$ y(x)=\frac{3}{2}x^{2}-x^{3}. $$
(44)

We can apply the algorithm BSFM in Sect. 4 to solve this problem, where we can find

$$ \begin{aligned} &s_{1}(x)=1+x^{2}-\frac{4}{9}x^{3}, \qquad s_{2}(x)=x, \\ & s_{3}(x)=x^{2}- \frac{8}{9} x^{3}. \end{aligned}$$
(45)

Now, letting

$$ E_{j}(x)=\phi _{j}(x)-s_{1}(x) \phi _{j}(0)-s_{2}(x)\phi _{j}'(0) +s_{3}(x) \biggl[\frac{3}{4}-\phi _{j}'(1/2)+ \phi _{j}'(1) \biggr], $$
(46)

we can prove the following result.

Lemma 1

For any free function \(\phi _{j}(x)\in {\mathcal{C}}^{1}[0,1]\), if \(s_{k}(x)\), \(k=1,2,3\), satisfy

$$\begin{aligned}& s_{1}(0)=1,\qquad s_{1}'(0)=0, \qquad s_{1}'(1/2)-s_{1}'(1)=0, \\& s_{2}(0)=0,\qquad s_{2}'(0)=1,\qquad s_{2}'(1/2)-s_{2}'(1)=0, \\& s_{3}(0)=0,\qquad s_{3}'(0)=0,\qquad s_{3}'(1/2)-s_{3}'(1)=1, \end{aligned}$$
(47)

then the function \(E_{j}(x)\), given by Eq. (46), satisfies

$$ E_{j}(0)=0,\qquad E_{j}'(0)=0, \qquad E_{j}'(1/2)-E_{j}'(1)= \frac{3}{4}. $$
(48)

Proof

The lower-order solutions of \(s_{k}(x)\), \(k=1,2,3\), for Eq. (47) are given in Eq. (45). Inserting \(x=0\) into Eq. (46), we have

$$ E_{j}(0)=\phi _{j}(0)-s_{1}(0)\phi _{j}(0)-s_{2}(0)\phi _{j}'(0) +s_{3}(0) \biggl[\frac{3}{4}-\phi _{j}'(1/2)+ \phi _{j}'(1) \biggr], $$

which, due to Eq. (47), reduces to

$$ E_{j}(0)=\phi _{j}(0)-\phi _{j}(0)=0. $$

Taking the differential of Eq. (46) and inserting \(x=0\), we have

$$ E_{j}'(0)=\phi _{j}'(0)-s_{1}'(0) \phi _{j}(0)-s_{2}'(0)\phi _{j}'(0) +s_{3}'(0) \biggl[\frac{3}{4}-\phi _{j}'(1/2)+\phi _{j}'(1) \biggr], $$

which, due to Eq. (47), reduces to

$$ E_{j}'(0)=\phi _{j}'(0)- \phi _{j}'(0)=0. $$

Taking the differential of Eq. (46) and inserting \(x=1/2\) and \(x=1\), we have

$$\begin{aligned}& E_{j}'(1/2)=\phi _{j}'(1/2)-s_{1}'(1/2) \phi _{j}(0)-s_{2}'(1/2) \phi _{j}'(0) +s_{3}'(1/2) \biggl[\frac{3}{4}-\phi _{j}'(1/2)+\phi _{j}'(1) \biggr], \\& E_{j}'(1)=\phi _{j}'(1)-s_{1}'(1) \phi _{j}(0)-s_{2}'(1)\phi _{j}'(0) +s_{3}'(1) \biggl[\frac{3}{4}-\phi _{j}'(1/2)+\phi _{j}'(1) \biggr]. \end{aligned}$$

Subtracting the first equation by the second equation leads to

$$\begin{aligned} E_{j}'(1/2)-E_{j}'(1) =& \phi _{j}'(1/2)-\phi _{j}'(1)- \bigl[s_{1}'(1/2)-s_{1}'(1) \bigr] \phi _{j}(0) -\bigl[s_{2}'(1/2)-s_{2}'(1) \bigr]\phi _{j}'(0) \\ &{}+\bigl[s_{3}'(1/2)-s_{3}'(1) \bigr] \biggl[\frac{3}{4}-\phi _{j}'(1/2)+ \phi _{j}'(1) \biggr], \end{aligned}$$

which, due to Eq. (47), reduces to

$$ E_{j}'(1/2)-E_{j}'(1)= \phi _{j}'(1/2)-\phi _{j}'(1)+ \frac{3}{4}-\phi _{j}'(1/2)+ \phi _{j}'(1)=\frac{3}{4}. $$

Thus, we end the proof of Eq. (48). □

Now we apply the BSFM in Sect. 4 to solve Example 5 with the following trial functions:

$$ \phi _{j}(x)=x^{j}, \quad j=1,\ldots ,m, $$
(49)

and the solution is expressed by

$$ y(x)=\sum_{j=1}^{m} a_{j} E_{j}(x), $$
(50)

where \(E_{j}(x)\) were given by Eq. (46). The above \(y(x)\) automatically satisfies the boundary conditions in Eq. (43), due to Eq. (48) and \(\sum_{j=1}^{m} a_{j}=1\).

Under the following parameters \(m=4\), \(n_{c}=100\), and \(\epsilon =10^{-10}\), the algorithm converges after eight steps as shown in Fig. 7(a). From Fig. 7(b) we can find that the numerical solution \(y(x)\) is very close to the exact one with ME being \(1.67\times 10^{-11}\). The accuracy is much better than that computed in [28] with about four orders. In Table 4, we list the numerical solutions and the absolute errors at different positions.

Figure 7
figure 7

For Example 5 of a non-separated three-point BVP solved by the BSFM, (a) showing convergence behavior and (b) comparing numerical and exact solutions and showing numerical error

Table 4 For Example 5, showing the numerical solutions and the absolute errors obtained by the BSFM at different points

Inspired by Lemma 1, we can prove the following result for Eq. (1), which is subjected to the non-separated three-point boundary conditions (5)–(7).

Theorem 3

For any free function \(f(x)\in {\mathcal{C}}^{2}[0,\ell ]\), if \(s_{k}(x)\), \(k=1,2,3\), satisfy

$$\begin{aligned}& \textstyle\begin{cases} {\mathcal{L}}_{1}[s_{1}(0),s_{1}'(0),s_{1}''(0),s_{1}(a),s_{1}'(a),s_{1}''(a),s_{1}( \ell ),s_{1}'(\ell ),s_{1}''(\ell )]=1, \\ {\mathcal{L}}_{2}[s_{1}(0),s_{1}'(0),s_{1}''(0),s_{1}(a),s_{1}'(a),s_{1}''(a),s_{1}( \ell ),s_{1}'(\ell ),s_{1}''(\ell )]=0, \\ {\mathcal{L}}_{3}[s_{1}(0),s_{1}'(0),s_{1}''(0),s_{1}(a),s_{1}'(a),s_{1}''(a),s_{1}( \ell ),s_{1}'(\ell ),s_{1}''(\ell )]=0, \end{cases}\displaystyle \end{aligned}$$
(51)
$$\begin{aligned}& \textstyle\begin{cases} {\mathcal{L}}_{1}[s_{2}(0),s_{2}'(0),s_{2}''(0),s_{2}(a),s_{2}'(a),s_{2}''(a),s_{2}( \ell ),s_{2}'(\ell ),s_{2}''(\ell )]=0, \\ {\mathcal{L}}_{2}[s_{2}(0),s_{2}'(0),s_{2}''(0),s_{2}(a),s_{2}'(a),s_{2}''(a),s_{2}( \ell ),s_{2}'(\ell ),s_{2}''(\ell )]=1, \\ {\mathcal{L}}_{3}[s_{2}(0),s_{2}'(0),s_{2}''(0),s_{2}(a),s_{2}'(a),s_{2}''(a),s_{2}( \ell ),s_{2}'(\ell ),s_{2}''(\ell )]=0, \end{cases}\displaystyle \end{aligned}$$
(52)
$$\begin{aligned}& \textstyle\begin{cases} {\mathcal{L}}_{1}[s_{3}(0),s_{3}'(0),s_{3}''(0),s_{3}(a),s_{3}'(a),s_{3}''(a),s_{3}( \ell ),s_{3}'(\ell ),s_{3}''(\ell )]=0, \\ {\mathcal{L}}_{2}[s_{3}(0),s_{3}'(0),s_{3}''(0),s_{3}(a),s_{3}'(a),s_{3}''(a),s_{3}( \ell ),s_{3}'(\ell ),s_{3}''(\ell )]=0, \\ {\mathcal{L}}_{3}[s_{3}(0),s_{3}'(0),s_{3}''(0),s_{3}(a),s_{3}'(a),s_{3}''(a),s_{3}( \ell ),s_{3}'(\ell ),s_{3}''(\ell )]=1, \end{cases}\displaystyle \end{aligned}$$
(53)

then the boundary shape function \(B(x)\), given by

$$\begin{aligned} B(x) =&f(x)+s_{1}(x)\bigl\{ b_{1}-{ \mathcal{L}}_{1}\bigl[f(0),f'(0),f''(0), f(a),f'(a),f''(a),f( \ell ),f'(\ell ),f''(\ell )\bigr]\bigr\} \\ &{} +s_{2}(x)\bigl\{ b_{2}-{\mathcal{L}}_{2} \bigl[f(0),f'(0),f''(0), f(a),f'(a),f''(a),f( \ell ),f'(\ell ),f''(\ell )\bigr]\bigr\} \\ &{}+s_{3}(x)\bigl\{ b_{3}-{\mathcal{L}}_{3} \bigl[f(0),f'(0),f''(0), f(a),f'(a),f''(a),f( \ell ),f'(\ell ),f''(\ell )\bigr]\bigr\} , \end{aligned}$$
(54)

satisfies the non-separated three-point boundary conditions:

$$\begin{aligned}& {\mathcal{L}}_{1}\bigl[B(0),B'(0),B''(0),B(a),B'(a),B''(a),B( \ell ),B'(\ell ),B''( \ell ) \bigr]=b_{1}, \end{aligned}$$
(55)
$$\begin{aligned}& {\mathcal{L}}_{2}\bigl[B(0),B'(0),B''(0),B(a),B'(a),B''(a),B( \ell ),B'(\ell ),B''( \ell ) \bigr]=b_{2}, \end{aligned}$$
(56)
$$\begin{aligned}& {\mathcal{L}}_{3}\bigl[B(0),B'(0),B''(0),B(a),B'(a),B''(a),B( \ell ),B'(\ell ),B''( \ell ) \bigr]=b_{3}. \end{aligned}$$
(57)

Proof

Applying the linear operator \({\mathcal{L}}_{1}\) to Eq. (54) and using the linear property, we have

$$\begin{aligned}& {\mathcal{L}}_{1}\bigl[B(0),B'(0),B''(0),B(a),B'(a),B''(a),B( \ell ),B'(\ell ),B''( \ell )\bigr] \\& \quad ={\mathcal{L}}_{1}\bigl[f(0),f'(0),f''(0),f(a),f'(a),f''(a),f( \ell ),f'(\ell ),f''( \ell )\bigr] \\& \qquad {} +{\mathcal{L}}_{1}\bigl[s_{1}(0),s_{1}'(0),s_{1}''(0),s_{1}(a),s_{1}'(a),s_{1}''(a),s_{1}( \ell ),s_{1}'(\ell ),s_{1}''( \ell )\bigr] \\& \qquad {}\times \bigl\{ b_{1}-{\mathcal{L}}_{1} \bigl[f(0),f'(0),f''(0), f(a),f'(a),f''(a),f(\ell ),f'( \ell ),f''(\ell )\bigr]\bigr\} \\& \qquad {}+{\mathcal{L}}_{1}\bigl[s_{2}(0),s_{2}'(0),s_{2}''(0),s_{2}(a),s_{2}'(a),s_{2}''(a),s_{2}( \ell ),s_{2}'(\ell ),s_{2}''( \ell )\bigr] \\& \qquad {}\times \bigl\{ b_{2}-{\mathcal{L}}_{2} \bigl[f(0),f'(0),f''(0), f(a),f'(a),f''(a),f(\ell ),f'( \ell ),f''(\ell )\bigr]\bigr\} \\& \qquad +{\mathcal{L}}_{1}\bigl[s_{3}(0),s_{3}'(0),s_{3}''(0),s_{3}(a),s_{3}'(a),s_{3}''(a),s_{3}( \ell ),s_{3}'(\ell ),s_{3}''( \ell )\bigr] \\& \qquad {}\times \bigl\{ b_{3}-{\mathcal{L}}_{3} \bigl[f(0),f'(0),f''(0), f(a),f'(a),f''(a),f(\ell ),f'( \ell ),f''(\ell )\bigr]\bigr\} , \end{aligned}$$

which with the help from Eqs. (51)–(53) becomes

$$\begin{aligned}& {\mathcal{L}}_{1}\bigl[B(0),B'(0),B''(0),B(a),B'(a),B''(a),B( \ell ),B'(\ell ),B''( \ell )\bigr] \\& \quad ={\mathcal{L}}_{1}\bigl[f(0),f'(0),f''(0),f(a),f'(a),f''(a),f( \ell ),f'(\ell ),f''( \ell )\bigr] \\& \qquad {} +b_{1}-{\mathcal{L}}_{1} \bigl[f(0),f'(0),f''(0), f(a),f'(a),f''(a),f(\ell ),f'( \ell ),f''(\ell ) \bigr] \\& \quad =b_{1}. \end{aligned}$$

This ends the proof of Eq. (55). The proofs of Eqs. (56) and (57) can be done similarly. □

The above theorem is crucial for treating very complex non-separated three-point boundary conditions of third-order nonlinear BVP and for guaranteeing that the boundary conditions are satisfied exactly. Now we apply the iterative algorithm BSFM in Sect. 6 to the following problem, which has transformed the BVP to the corresponding IVP.

Example 6

We consider the following quadratic nonlinear non-separated three-point BVP:

$$\begin{aligned}& \begin{aligned} &y'''(x)+y''(x)+y^{2}(x)=h(x), \quad 0 < x < 1, \\ &y(1/2)-y(0)=e^{1/2}, \qquad y'(1/2)-y''(1/2)+y(0)= \pi ^{2} e^{1/2}, \qquad y'(0)+y(1)= \pi , \end{aligned} \end{aligned}$$
(58)

whose exact solution is given by \(y(x)=e^{x}\sin (\pi x)\) such that \(h(x)\) can be computed by inserting \(y(x)=e^{x}\sin (\pi x)\) into Eq. (58).

We apply the iterative algorithm BSFM in Sect. 6 to solve this problem with \(s_{1}(x)=-4+8x/3-4x^{2}/3\), \(s_{2}(x)=x/3-x^{2}/2\), and \(s_{3}(x)=1-x/3+2x^{2}/3\). For this problem, there are four unknown parameters \({\mathbf{z}}=[u(1/2),u'(1/2),u''(1/2),u(1)]^{\text{T}}\).

Under the following parameters \(u_{1}(0)=u_{2}(0)=u_{3}(0)=0\), \({\mathbf{z}}_{0}=(0,0,0,0)^{\text{T}}\), \(N=100\), and \(\epsilon =10^{-10}\) the algorithm converges after 56 iterations as shown in Fig. 8(a). From Fig. 8(b) we can find that the numerical solution \(y(x)\) is very close to the exact one with ME being \(1.4\times 10^{-8}\). Although the non-separated three-point nonlinear BVP is difficult to be treated by the numerical method, the accuracy of the problem we considered is very good. In Table 5, we list the numerical solutions and the absolute errors at different positions.

Figure 8
figure 8

For Example 6 of a non-separated three-point quadratic nonlinear BVP solved by the iterative algorithm BSFM, (a) showing convergence behavior and (b) comparing numerical and exact solutions and showing numerical error

Table 5 For Example 6, showing the numerical solutions and the absolute errors obtained by the BSFM at different points

Example 7

We consider the following cubic nonlinear non-separated three-point BVP:

$$\begin{aligned}& y'''(x)-xy(x)+y'(x)^{2}+y^{3}(x)=h(x), \quad 0 < x < 1, \\& y(0)+y''(0)+y'(1/2)+y(1)= \frac{e^{1/2}}{4}, \\& y(0)-y''(0)+y(1/2)= \frac{e^{1/2}}{4},\qquad y'(0)+y'(1)=1-e, \end{aligned}$$
(59)

whose exact solution is given by \(y(x)=e^{x}(x-x^{2})\) such that \(h(x)\) can be computed by inserting \(y(x)=e^{x}(x-x^{2})\) into Eq. (59).

We apply the BSFM to solve this problem with \(s_{1}(x)=9/34-4x/17+4x^{2}/17\), \(s_{2}(x)=4/17+4x/17-4x^{2}/17\), and \(s_{3}(x)=-11/34+23x/34-3x^{2}/17\). For this problem there are four unknown parameters \({\mathbf{z}}=[u(1/2),u'(1/2),u(1),u'(1)]^{\text{T}}\).

Under the following parameters \(u_{1}(0)=u_{2}(0)=u_{3}(0)=0\), \({\mathbf{z}}_{0}=(0,0,0,0)^{\text{T}}\), \(N=100\), and \(\epsilon =10^{-10}\), the algorithm converges after 21 iterations as shown in Fig. 9(a). From Fig. 9(b) we can find that the numerical solution \(y(x)\) is very close to the exact one with ME being \(8.91\times 10^{-9}\). Although the non-separated three-point nonlinear BVP is difficult to be treated by the numerical method, the accuracy of the problem we considered is very good. In Table 6, we list the numerical solutions and the absolute errors at different positions.

Figure 9
figure 9

For Example 7 of a non-separated three-point cubic nonlinear BVP solved by the iterative algorithm BSFM, (a) showing convergence behavior and (b) comparing numerical and exact solutions and showing numerical error

Table 6 For Example 7, showing the numerical solutions and the absolute errors obtained by the BSFM at different points

For Examples 6 and 7, we find that although the shooting method in Sect. 5 is modified, it cannot be applied to solve them, because there exist three unknown initial values \(y(0)\), \(y'(0)\), and \(y''(0)\) to be determined. In contrast, the presented BSFM can provide very accurate solutions of Examples 6 and 7. Although in the BSFM we also transformed the BVP to the corresponding IVP, the major difference is that the initial values are given with known values, say \(u(0)=u'(0)=u''(0)=0\), and we adjust the unknown terminal values at \(x=a\) and \(x=\ell \) through the integrations of the new ODEs. The process in the BSFM is much more stable than that in the shooting method with unknown initial values \(y(0)\), \(y'(0)\), and \(y''(0)\).

Conclusions

The paper is witnessed to derive the boundary shape functions to exactly satisfy the given separated three-point boundary conditions and general non-separated three-point boundary conditions of the third-order nonlinear BVP. According to the new idea of boundary shape functions, we have developed two novel numerical algorithms used in the solutions of the third-order three-point nonlinear BVPs. The main contributions are the introduction of a new concept of boundary shape functions and then deriving the new bases and a new variable transformation, which automatically satisfy all the boundary conditions specified. In the first algorithm, since the bases have already satisfied the three-point boundary conditions, we only need to collocate points inside the domain to satisfy the governing equation, which is easily performed by solving the resulting algebraic equations system to determine the expansion coefficients. On the other hand, in the second algorithm we have transformed the nonlinear third-order three-point BVP to the initial value problem of a new nonlinear ODE, which is convergent very fast, to find solution. Numerical examples confirmed and showed that the two novel algorithms based on the boundary shape functions are highly accurate and stable.

Availability of data and materials

Data sharing not applicable to this article as no data sets were generated or analyzed during the current study.

References

  1. Agarwal, R.P.: Boundary Value Problems for High Order Differential Equations. World Scientific, Singapore (1986)

    Book  Google Scholar 

  2. Tirmizi, S.I.A.: On numerical solution of third order boundary value problems. Appl. Numer. Math. 7, 309–313 (1991)

    MathSciNet  Article  Google Scholar 

  3. Calgar, N., Calgar, S.H., Twizell, E.H.: The numerical solution of third order boundary-value problems with fourth-degree B-spline function. Int. J. Comput. Math. 71, 373–381 (1999)

    MathSciNet  Article  Google Scholar 

  4. Gupta, C.P., Lakshmikantham, V.: Existence and uniqueness theorems for a third-order three point boundary value problem. Nonlinear Anal., Theory Methods Appl. 16, 945–957 (1991)

    MathSciNet  Article  Google Scholar 

  5. Murty, K.N., Rao, Y.S.: A theory for existence and uniqueness of solutions to three-point boundary value problems. J. Math. Anal. Appl. 167, 43–48 (1992)

    MathSciNet  Article  Google Scholar 

  6. Henderson, J., Prasad, K.R.: Existence and uniqueness of solutions of three-point boundary value problems on time scales. Nonlinear Stud. 8, 1–12 (2001)

    MathSciNet  MATH  Google Scholar 

  7. Al-Said, E.A.: Numerical solutions for system of third-order boundary value problems. Int. J. Comput. Math. 78, 111–121 (2001)

    MathSciNet  Article  Google Scholar 

  8. Pandey, P.K.: A numerical method for the solution of general third order boundary value problem in ordinary differential equations. Bull. Int. Math. Virtual Inst. 7, 129–138 (2017)

    MathSciNet  MATH  Google Scholar 

  9. Khan, A., Aziz, T.: The numerical solution of third-order boundary-value problems using quintic splines. Appl. Math. Comput. 137, 253–260 (2003)

    MathSciNet  MATH  Google Scholar 

  10. Pandey, P.K.: Solving third-order boundary value problems with quartic splines. Panday SpringerPlus 5, 1–10 (2016)

    Article  Google Scholar 

  11. Islam, S., Khan, M.A., Tirmizi, I.A., Twizell, E.H.: Non-polynomial splines approach to the solution of a system of third-order boundary-value problems. Appl. Math. Comput. 168, 152–163 (2005)

    MathSciNet  MATH  Google Scholar 

  12. Gao, F., Chi, C.M.: Solving third-order obstacle problems with quartic B-splines. Appl. Math. Comput. 180, 270–274 (2006)

    MathSciNet  MATH  Google Scholar 

  13. Haq, F., Hussain, I., Ali, A.: A Haar wavelets based numerical method for third-order boundary and initial value problems. World Appl. Sci. J. 13, 2244–2251 (2011)

    Google Scholar 

  14. Wang, C.-S.: Solving third-order singularly perturbed problems: exponentially and polynomially fitted trial functions. J. Math. Res. 8(2), 16–24 (2016)

    Google Scholar 

  15. Wang, F.J., Wang, C., Chen, Z.T.: Local knot method for 2D and 3D convection–diffusion–reaction equations in arbitrary domains. Appl. Math. Lett. 105, 106308 (2020)

    MathSciNet  Article  Google Scholar 

  16. Wang, F.J., Fan, C.M., Zhang, C.Z., Lin, J.: A localized space-time method of fundamental solutions for diffusion and convection–diffusion problems. Adv. Appl. Math. Mech. 12(4), 940–958 (2020)

    MathSciNet  Article  Google Scholar 

  17. Lin, J., Zhang, Y.H., Sergiy, R., Feng, W.J.: A novel meshless space-time backward substitution method and its application to nonhomogeneous advection–diffusion problems. Appl. Math. Comput. 398(1), 125964 (2021)

    MathSciNet  Google Scholar 

  18. Islam, S., Aziz, I., Sarler, B.: The numerical solution of second-order boundary-value problems by collocation method with the Haar wavelets. Math. Comput. Model. 52, 1577–1590 (2010)

    MathSciNet  Article  Google Scholar 

  19. Islam, S., Tirmizi, I.A., Haq, F., Taseerb, S.K.: Family of numerical methods based on non-polynomial splines for solution of contact problems. Commun. Nonlinear Sci. Numer. Simul. 13, 1448–1460 (2008)

    MathSciNet  Article  Google Scholar 

  20. Islam, S., Saler, B., Aziz, I., Haq, F.: Haar wavelet collocation method for the numerical solution of boundary layer fluid flow problems. Int. J. Therm. Sci. 50, 686–697 (2011)

    Article  Google Scholar 

  21. Islam, S., Tirmizi, I.A., Kahn, M.A.: Quartic non-polynomial spline approach to the solution of a system of third-order boundary-value problems. J. Math. Anal. Appl. 335, 1095–1104 (2007)

    MathSciNet  Article  Google Scholar 

  22. Liu, C.-S., Chang, C.W.: Boundary shape function method for nonlinear BVP, automatically satisfying prescribed multipoint boundary conditions. Bound. Value Probl. 2020, 139 (2020)

    MathSciNet  Article  Google Scholar 

  23. Liu, C.-S., Chang, J.R.: Boundary shape functions methods for solving the nonlinear singularly perturbed problems with Robin boundary conditions. Int. J. Nonlinear Sci. Numer. Simul. 21, 797–806 (2020)

    MathSciNet  Article  Google Scholar 

  24. Ascher, U.M., Mattheij, R.M.M., Russell, R.D.: Numerical Solution of Boundary Value Problems for Ordinary Differential Equations. SIAM, Philadelphia (1995)

    Book  Google Scholar 

  25. Liu, C.-S., Atluri, S.N.: A novel time integration method for solving a large system of non-linear algebraic equations. Comput. Model. Eng. Sci. 31, 71–83 (2008)

    MathSciNet  MATH  Google Scholar 

  26. Krajcinovic, D.: Sandwich beam analysis. ASME J. Appl. Mech. 39, 773–778 (1972)

    Article  Google Scholar 

  27. Loghmani, G.B., Ahmadinia, M.: Numerical solution of third-order boundary value problems. Iran. J. Sci. Technol. Trans. A 30, 291–295 (2006)

    MathSciNet  MATH  Google Scholar 

  28. Akram, G., Tehseen, M., Siddiqi, S.S., ur Rehman, H.: Solution of a linear third order multi-point boundary value problem using RKM. Br. J. Math. Comput. Sci. 3, 180–194 (2013)

    Article  Google Scholar 

  29. Li, X., Wu, B.: Reproducing kernel method for singular multi-point boundary value problems. Math. Sci. 6, 16 (2012). https://doi.org/10.1186/2251-7456-6-16

    MathSciNet  Article  MATH  Google Scholar 

  30. Wu, B., Li, X.: Application of reproducing kernel method to third order three-point boundary value problems. Appl. Math. Comput. 217, 3425–3428 (2010)

    MathSciNet  MATH  Google Scholar 

Download references

Acknowledgements

The authors would like to thank the referees and the editor for their valuable comments which led to an improvement of this work.

Funding

This work is supported by the Fundamental Research Funds for the Central Universities (No. B200202126), the Natural Science Foundation of Jiangsu Province (No. BK20190073), the State Key Laboratory of Acoustics, Chinese Academy of Sciences (No. SKLA202001), and the China Postdoctoral Science Foundation (Nos. 2017M611669, 2018T110430).

Author information

Authors and Affiliations

Authors

Contributions

All authors contributed equally to the manuscript. All authors read and approved the final manuscript.

Corresponding authors

Correspondence to Yuhui Zhang or Chein-Shan Liu.

Ethics declarations

Competing interests

The authors declare that they have no competing interests.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Lin, J., Zhang, Y. & Liu, CS. Solving nonlinear third-order three-point boundary value problems by boundary shape functions methods. Adv Differ Equ 2021, 146 (2021). https://doi.org/10.1186/s13662-021-03288-x

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s13662-021-03288-x

Keywords

  • Third-order nonlinear boundary value problems
  • Three-point boundary conditions
  • Boundary shape functions methods