Consider the singularly perturbed self-adjoint boundary value problem of the form:

$$ -\varepsilon {\left(a(x){y}^{\prime }(x)\right)}^{\prime }+b(x)y(x)=g(x),\kern0.96em x\in \varOmega := \left(0,1\right) $$

(1)

subject to the boundary conditions:

and

where *ε* is a perturbation parameter that satisfies 0 < *ε* < < 1, *α*, *β* are given constants and the functions *a*(*x*) ≠ 0, *b*(*x*) ≠ 0 and *g*(*x*) are assumed to be sufficiently continuous differentiable functions. By product rule differentiation, Eq. (1) can be re-written as:

$$ -\varepsilon {y}^{{\prime\prime} }(x)+p(x){y}^{\prime }(x)+q(x)y(x)=f(x) $$

(3)

where

$$ p(x)=\frac{-\varepsilon {a}^{\prime }(x)}{a(x)},\kern1.2em q(x)=\frac{b(x)}{a(x)} $$

and

$$ f(x)=\frac{g(x)}{a(x)}. $$

In order to develop the finite difference method, the interval [0, 1] is divided into *N* equal sub-intervals with set of grid points *x*_{i} = *x*_{0} + *ih*, for *i* = 0, 1, 2, ..., *N*, where \( h=\frac{1}{N} \). For convenience, let \( p\left({x}_i\right)={p}_i,q\left({x}_i\right)={q}_i,y\left({x}_i\right)={y}_i,{y}^{\prime}\left({x}_i\right)={y}_i^{\prime },...,{y}^{(n)}\left({x}_i\right)={y}_i^{(n)}. \)

Assume that *y*(*x*) has continuous higher order derivatives on [0, 1], and to develop the fourth-order stable central difference scheme, we use Taylor’s series expansion in order to get central difference formula for *y*_{i}^{′′} and*y*_{i}^{′}.

$$ {y}_{i+1}={y}_i+h{y_i}^{\prime }+\frac{h^2}{2!}{y_i}^{\prime \prime }+\frac{h^3}{3!}{y_i}^{\prime \prime \prime }+\frac{h^4}{4!}{y}_i^{(4)}+\frac{h^5}{5!}{y}_i^{(5)}+\frac{h^6}{6!}{y}_i^{(6)}+... $$

(4)

$$ {y}_{i-1}={y}_i-h{y_i}^{\prime }+\frac{h^2}{2!}{y_i}^{\prime \prime }-\frac{h^3}{3!}{y_i}^{\prime \prime \prime }+\frac{h^4}{4!}{y}_i^{(4)}-\frac{h^5}{5!}{y}_i^{(5)}+\frac{h^6}{6!}{y}_i^{(6)}+... $$

(5)

From Eqs. (4) and (5), we have:

$$ {y_i}^{\prime }=\frac{y_{i+1}-{y}_{i-1}}{2h}-\frac{h^2}{6}{y}_i^{{\prime\prime\prime} }-\frac{h^4}{120}{y}_i^{(5)}+{\tau}_1\kern0.48em \mathrm{and}\kern0.36em {y_i}^{\prime \prime }=\frac{y_{i+1}-2{y}_i+{y}_{i-1}}{h^2}-\frac{h^2}{12}{y}_i^{(4)}+{\tau}_2 $$

(6)

where \( {\tau}_1=\frac{-{h}^6}{7!}{y_i}^{(7)} \) and \( {\tau}_2=\frac{-{h}^4}{360}{y_i}^{(6)} \)

Substituting Eq. (6) into the discrete form of Eq. (3) gives:

$$ {q}_i{y}_i+\frac{p_i}{2h}\left({y}_{i+1}-{y}_{i-1}\right)-\frac{\varepsilon }{h^2}\left({y}_{i+1}-2{y}_i+{y}_{i-1}\right)-\frac{p_i{h}^2}{6}{y}_i^{{\prime\prime\prime} }+\frac{\varepsilon {h}^2}{12}{y}_i^{(4)}-\frac{p_i{h}^4}{120}{y}_i^{(5)}+{\tau}_0={f}_i $$

(7)

where

$$ {\tau}_0={p}_i{\tau}_1-\varepsilon {\tau}_2 $$

Differentiating Eq. (3) successively and considering at the nodal points yields:

$$ {y_i}^{\prime \prime \prime }=\frac{1}{\varepsilon}\left({p}_i{y_i}^{\prime \prime }+\left({p_i}^{\prime }+{q}_i\right){y_i}^{\prime }+{q_i}^{\prime }{y}_i-{f_i}^{\prime}\right) $$

(8)

$$ {y_i}^{(4)}=\frac{1}{\varepsilon}\left({p}_i{y_i}^{\prime \prime \prime }+\left(2{p_i}^{\prime }+{q}_i\right){y_i}^{\prime \prime }+\left({p_i}^{\prime \prime }+2{q_i}^{\prime}\right){y}_i^{\prime }+{q_i}^{\prime \prime }{y}_i-{f_i}^{\prime \prime}\right) $$

(9)

$$ {y_i}^{(5)}=\frac{1}{\varepsilon}\left({p}_i{y_i}^{(4)}+\left(3{p}_i^{\prime }+{q}_i\right){y}_i^{{\prime\prime\prime} }+\left(3{p_i}^{\prime \prime }+3{q_i}^{\prime}\right){y_i}^{\prime \prime }+\left({p}_i^{{\prime\prime\prime} }+3{q}^{{\prime\prime}}\right){y}_i^{\prime }+q{i}^{{\prime\prime\prime} }{y}_i-{f}_i^{{\prime\prime\prime}}\right) $$

(10)

Using Eq. (10), the term which contains *y*_{i}^{(5)} from Eq. (7) becomes:

$$ {\displaystyle \begin{array}{l}\frac{-{p}_i{h}^4}{120}{y_i}^{(5)}=-\frac{{p_i}^2{h}^4}{120\varepsilon }{y_i}^{(4)}-\frac{p_i{h}^{(4)}}{120\varepsilon}\left(3{p_i}^{\prime }+{q}_i\right){y_i}^{\prime \prime \prime }-\frac{p_i{h}^{(4)}}{120\varepsilon}\left(3{p}_i^{{\prime\prime} }+3{q}_i^{\prime}\right){y}_i^{{\prime\prime}}\\ {}\kern3.719998em \frac{-{p}_i{h}^4}{120\varepsilon}\left({p}_i^{{\prime\prime\prime} }+3{q}_i^{{\prime\prime}}\right){y}_i^{\prime }-\frac{p_i{q_i}^{\prime \prime \prime }{h}^4}{120\varepsilon }{y}_i+\frac{p_i{h}^4}{120\varepsilon }{f}_i^{{\prime\prime\prime}}\end{array}} $$

(11)

Also, from Eqs. (4) and (5), we have the central finite difference approximation:

$$ {y_i}^{\prime }=\frac{y_{i+1}-{y}_{i-1}}{2h}+{\tau}_3 $$

and

$$ {y_i}^{\prime \prime }=\frac{y_{i+1}-2{y}_i+{y}_{i-1}}{h^2}+{\tau}_4 $$

(12)

where

$$ {\tau}_3=\frac{-{h}^2}{6}{y}_i^{{\prime\prime\prime} } $$

and

$$ {\tau}_4=-\frac{h^2}{12}{y}_i^{(4)} $$

Putting Eq. ((12), into Eq. (11) gives:

$$ {\displaystyle \begin{array}{l}\frac{-{p}_i{h}^4}{120}{y_i}^{(5)}=-\frac{{p_i}^2{h}^4}{120\varepsilon }{y_i}^{(4)}-\frac{p_i{h}^{(4)}}{120\varepsilon}\left(3{p_i}^{\prime }+{q}_i\right){y_i}^{\prime \prime \prime}\\ {}\kern3.479999em -\left(\frac{p_i{h}^2}{120\varepsilon}\left(3{p}_i^{{\prime\prime} }+3{q}_i^{\prime}\right)\right)\left({y}_{i+1}-2{y}_i+{y}_{i-1}\right)\\ {}\kern3.359999em -\left(\frac{p_i{h}^3}{120\varepsilon}\left({p}_i^{{\prime\prime\prime} }+3{q}_i^{{\prime\prime}}\right)\right)\left({y}_{i+1}-{y}_{i-1}\right)-\frac{p_i{q_i}^{\prime \prime \prime }{h}^4}{120\varepsilon }{y}_i+\frac{p_i{h}^4}{120\varepsilon }{f}_i^{{\prime\prime\prime} }+{\tau}_5\end{array}} $$

(13)

where

$$ {\tau}_5=-\frac{p_i{h}^4}{120\varepsilon}\left({p}_i^{{\prime\prime\prime} }+3{q}_i^{{\prime\prime}}\right){\tau}_3-\frac{p_i{h}^4}{120\varepsilon}\left(3{p}_i^{{\prime\prime} }+3{q}^{\prime}\right){\tau}_4. $$

Substituting Eq. (13) into Eq. (7) and rearranging, we get:

$$ {\displaystyle \begin{array}{l}\left({q}_i-\frac{p_i{q}_i^{{\prime\prime\prime} }{h}^4}{120\varepsilon}\right){y}_i+\left(\frac{p_i}{2h}-\frac{p_i{h}^3}{240\varepsilon}\left({p}_i^{{\prime\prime\prime} }+3{q}_i^{{\prime\prime}}\right)\right)\left({y}_{i+1}-{y}_{i-1}\right)\\ {}-\left(\frac{\varepsilon }{h^2}+\frac{p_i^2}{120\varepsilon}\left(3{p}_i^{{\prime\prime} }+3{q}_i^{\prime}\right)\right)\left({y}_{i+1}-2{y}_i+{y}_{i-1}\right)-\left(\frac{pi{h}^2}{6}+\frac{pi{h}^4}{120\varepsilon}\left(3{p}_i^{\prime }+ qi\right)\right){y}^{{\prime\prime\prime}}\\ {}+\left(\frac{\varepsilon {h}^2}{12}-\frac{p_i^2{h}^2}{120\varepsilon}\right){y}_i^4+{\tau}_6={f}_i-\frac{p_i{h}^4}{120\varepsilon }{f}_i^{{\prime\prime\prime}}\end{array}} $$

(14)

where

$$ {\tau}_6={\tau}_0+{\tau}_5 $$

Again, using Eq. (9), the term which contains \( {y}_i^{(4)} \) from Eq. (14) becomes:

$$ {\displaystyle \begin{array}{l}\left(\frac{\varepsilon {h}^2}{12}-\frac{p_i^2{h}^4}{120\varepsilon}\right){y_i}^4=\left(\frac{p_i{h}^2}{12}-\frac{p_i^3{h}^4}{120{\varepsilon}^2}\right){y}_i^{{\prime\prime\prime} }+\left(\frac{q_i^{{\prime\prime} }{h}^2}{12}-\frac{p_i^2{q}_i^{{\prime\prime} }{h}^4}{120{\varepsilon}^2}\right){y}_i+{\tau}_7\\ {}\kern4.919997em +\left(\left(\frac{1}{12}-\frac{p_i^2{h}^2}{120{\varepsilon}^2}\right)\left(2{p}_i^{\prime }+ qi\right)\right)\left({y}_{i+1}-2{y}_i+{y}_{i-1}\right)\\ {}\kern4.199998em +\left(\left(\frac{h}{24}-\frac{p_i^2{h}^3}{240{\varepsilon}^2}\right)\left({p}_i^{{\prime\prime} }+2{q}_i^{\prime}\right)\right)\left({y}_{i+1}-{y}_{i-1}\right)-\left(\frac{h^2}{12}-\frac{p_i^2{h}^4}{120{\varepsilon}^2}\right){f}_i^{{\prime\prime}}\end{array}} $$

(15)

where \( {\tau}_7=\left(\frac{h^2}{12}-\frac{{p_i}^2{h}^4}{120{\varepsilon}^2}\right)\left(2{p}_i^{\prime }+{q}_i\right){\tau}_4+\left(\frac{h^2}{12}-\frac{{p_i}^2{h}^4}{120{\varepsilon}^2}\right)\left({p}_i^{{\prime\prime} }+2{q}_i^{\prime}\right){\tau}_3 \)

Substituting Eq. (15) into Eq. (14) yields:

$$ {\displaystyle \begin{array}{l}\left({q}_i-\frac{p_i{q}_i^{{\prime\prime\prime}}\;{h}^4}{120\varepsilon }+\frac{q_i^{{\prime\prime\prime}}\;{h}^2}{12}-\frac{p_i^2{q}_i^{{\prime\prime\prime}}\;{h}^4}{120{\varepsilon}^2}\right){y}_i\\ {}+\left(\frac{p_i}{2h}-\frac{p_i{h}^3}{240\varepsilon}\left({p}_i^{{\prime\prime\prime} }+3{q}_i^{{\prime\prime}}\right)+\left(\frac{h}{24}-\frac{p_i^2{h}^3}{240{\varepsilon}^2}\right)\right)\left({p}_i^{{\prime\prime} }+2{q}_i^{\prime}\right)\left({y}_{i+1}-{y}_{i-1}\right)\\ {}-\left(\frac{\varepsilon }{h^2}+\frac{p_i{h}^2}{120\varepsilon}\left(3{p}_i^{{\prime\prime} }+3{q}_i^{\prime}\right)-\left(\frac{1}{12}-\frac{p_i^2{h}^2}{120{\varepsilon}^2}\right)\right)\left(2{p}_i^{\prime }+{q}_i\right)\left({y}_{i+1}-2{y}_i+{y}_{i-1}\right)\\ {}+\left(\frac{p_i{h}^2}{12}+\frac{p_i{h}^4}{120\varepsilon}\left(3{p}_i^{\prime }+ qi\right)-\frac{p_i{h}^2}{6}+\frac{{p_i}^3{h}^4}{120{\varepsilon}^2}\;\right){y}^{{\prime\prime\prime} }+{\tau}_8\\ {}\kern7.799994em ={f}_i+\left(\frac{h^2}{12}+\frac{{p_i}^2{h}^4}{120{\varepsilon}^2}\;\right){f}_i^{{\prime\prime} }-\frac{p_i{h}^4}{120\varepsilon }{f}_i^{{\prime\prime\prime}}\end{array}} $$

(16)

where

$$ {\tau}_8={\tau}_6+{\tau}_7. $$

For simplicity, let

\( {A}_i={q}_i-\frac{p_i{q}_i^{{\prime\prime\prime} }{h}^4}{120\varepsilon }+\frac{q_i^{{\prime\prime\prime} }{h}^2}{12}-\frac{p_i^2{q}_i^{{\prime\prime\prime} }{h}^4}{120{\varepsilon}^2}, \)
\( {B}_i=\frac{p_i}{2h}-\frac{p_i{h}^3}{240\varepsilon}\left({p}_i^{{\prime\prime\prime} }+3{q}_i^{{\prime\prime}}\right)+\left(\frac{h}{24}-\frac{p_i^2{h}^3}{240{\varepsilon}^2}\right)\left({p}_i^{{\prime\prime} }+2{q}_i^{\prime}\right) \)

$$ {C}_i=\frac{\varepsilon }{h^2}+\frac{p_i{h}^2}{120\varepsilon}\left(3{p}_i^{{\prime\prime} }+3{q}_i^{\prime}\right)-\left(\frac{1}{12}-\frac{p_i^2{h}^2}{120{\varepsilon}^2}\right)\left(2{p}_i^{\prime }+{q}_i\right) $$

\( {D}_i=\frac{p_i{h}^2}{12}-\frac{p_i{h}^4}{120\varepsilon}\left(3{p}_i^{\prime }+{q}_i\right)-\frac{p_i{h}^2}{6}-\frac{{p_i}^3{h}^4}{120{\varepsilon}^2}, \)
\( Hh(i)={f}_i+\left(\frac{h^2}{12}+\frac{{p_i}^2{h}^4}{120{\varepsilon}^2}\;\right){f}_i^{{\prime\prime} }-\frac{p_i{h}^4}{120\varepsilon }{f}^{{\prime\prime\prime} } \)

Then, Eq. (16) re-written as:

$$ {A}_i{y}_i+{B}_i\left({y}_{i+1}-{y}_{i-1}\right)-{C}_i\left({y}_{i+1}-2{y}_i+{y}_{i-1}\right)+{D}_i{y}_i^{{\prime\prime\prime} }+{\tau}_8= Hh(i) $$

(17)

Lastly, using Eq. (8), the term that contains \( {y}_i^{{\prime\prime\prime} } \) from Eq. (17) becomes:

$$ {D}_i{y_i}^{\prime \prime \prime }=\frac{p_i{D}_i}{\varepsilon}\left({y}_{i+1}-2{y}_i+{y}_{i-1}\right)+\frac{D_i}{2 h\varepsilon}\left({p_i}^{\prime }+{q}_i\right)\left({y}_{i+1}-{y}_{i-1}\right)+\frac{D_i{q_i}^{\prime }}{\varepsilon }{y}_i-\frac{D_i}{\varepsilon }{f_i}^{\prime }+{\tau}_9 $$

(18)

where

$$ {\tau}_9=\frac{p_i{D}_i}{\varepsilon }{\tau}_4+\frac{D_i}{\varepsilon }{\tau}_3 $$

Putting Eq. (18) into Eq. (17), and write in three-term recurrence relation:

$$ -{E}_i{y}_{i-1}+{F}_i{y}_i-{G}_i{y}_{i+1}+{\tau}_{10}={H}_i $$

(19)

where\( {E}_i={C}_i-\frac{p_i{D}_i}{\varepsilon {h}^2}+{B}_i+\frac{D_i}{2 h\varepsilon}\left({p_i}^{\prime }+{q}_i\right), \) \( {F}_i={A}_i+\frac{D_i{q}_i^{\prime }}{\varepsilon }+2\left({C}_i-\frac{P_i{D}_i}{\varepsilon {h}^2}\right) \)\( {G}_i={C}_i-\frac{P_i{D}_i}{\varepsilon {h}^2}-{B}_i-\frac{D_i}{2 h\varepsilon}\left({p_i}^{\prime }+{q}_i\right) \) and \( {H}_i= Hh(i)+\frac{D_i}{\varepsilon }{f}_i^{\prime } \)with truncation error: *τ*_{10} = *τ*_{8} + *τ*_{9}.