1 Background

In the last few decades there has been a growing interest in the study of delay differential equations due to their occurrence in a wide variety of application fields such as biosciences, control theory, economics, material science, medicine, robotics etc. Any system involving a feedback control will almost always involve time delays. These arise because a finite time is required to sense the information and then to react to it. The delays or lags can represent gestation times, incubation periods, transport delays etc. Delay models are also prominent in describing several aspects of infectious disease dynamics such as primary infection, drug therapy, immune response etc. Delays have also appeared in the study of chemostat models, circadian rhythms, epidemiology, the respiratory system, tumor growth and neural networks. Statistical analysis of ecological data has shown that there is evidence of delay effects in the population dynamics of many species.

The details of the theory and applications of differential difference equations can be found in the collection of books, to name a few, Bellman and Cooke [1], Driver [2], El’sgol’ts and Norkin [3], Erneux [4], Gopalsamy [5], Györi and Ladas [6], Halanay [7], Kuang [8] and Smith [9]. In recent years there has been a growing interest in the numerical study of differential difference equations. However, the first discrete solution to delay differential equations was given by Feldstein [10], which became a landmark work to most of the researchers working in numerical analysis of delay differential equations. Bellen and Zennaro [11] gave the theoretical aspects of numerical methods for ordinary and delay differential equations, and suitable techniques for solving numerically such type of equations.

A singularly perturbed delay differential equation is a differential equation in which the highest derivative is multiplied by a small parameter and which involves at least one shift term. Such problems arise frequently in the mathematical modeling of various physical and biological phenomena like optically bistable devices [12, 13], description of the human pupil reflex [14], a variety of models for physiological processes or diseases [15], variational problems in control theory [16, 17] and the first-exit time problem in the modeling of the activation of neuronal variability [18].

Singularly perturbed delay differential equations have up to now not been satisfactorily discussed in numerical analysis literature; however, in recent years there has been a growing interest in the numerical study of such problems. Most of the previous works have been centered on the existence and uniqueness of solutions for initial value problems in differential difference equations and very little attention has been paid to construction of approximate solutions. The computation of the solution of delay differential equations has been a great challenge and great importance due to the appearance of such equations in mathematical modeling of biological problems. Stein [18] approximated the solution of his model of the activation of neuronal variability, which was studied by Tuckwell [1921] and by Wilbur and Rinzel [22]. Lange and Miura [2328] gave a series of papers on singularly perturbed differential difference equations by extending the matched asymptotic expansion approach developed for ordinary differential equations to obtain the approximate solution of these differential difference equations. An extensive numerical work has been initiated by Kadalbajoo and Sharma in their papers [2938], Kadalbajoo and Kumar [39], Kadalbajoo and Ramesh [40]. Gulsu and Sezer [41] proposed a Taylor polynomial approach for solving mth order linear differential difference equations with mixed conditions. This method is based on first taking the truncated Taylor’s expansions of the functions in the differential difference equations and then substituting their matrix forms into the equation. Hence the resultant matrix equation can be solved and the unknown Taylor coefficients can be found approximately.

It is well known that standard discretization methods for solving singular perturbation problems are unstable and fail to give accurate results when the perturbation parameter ε is small. Therefore it is important to develop suitable numerical methods to deal with these problems whose accuracy does not depend on the parameter value ε. So the method should be uniformly convergent with respect to the perturbation parameter, and various approaches for the numerical methods to solve singularly perturbed differential equations are given in [4245]. The use of cubic splines for the solution of linear two point boundary value problems was suggested by Bickley [46]. Aziz and Khan [47] proposed a method based on cubic spline in compression for the linear second order singularly perturbed problems which have second and fourth order convergence depending on the choice of the parameters \(\lambda_{1}\) and \(\lambda_{2}\) involved in the method.

The analytical and numerical solution of singularly perturbed delay differential equations with large delays can be found in Amiraliyev and Erdogan [48], Amiraliyev and Cimen [49], Amiraliyeva et al. [50], Erdogan and Amiraliyev [51]. Subburayan and Ramanujam [52] gave an initial value technique to solve the singularly perturbed boundary value problem for the second order ordinary differential equations of convection-diffusion type with delay. Ghomanjani et al. [53] presented the Bezier curves to solve the optimal control problem with pantograph delays. A direct algorithm for solving this problem was given. Ghomanjani et al. [54] applied, for the first time, Bernstein’s approximation on delay differential equations and delay systems with inverse delay that models these problems. A direct algorithm is given for solving this problem. The delay function and inverse time function are expanded by the Bezier curves. The Bezier curves are chosen as piecewise polynomials of degree n, and the Bezier curves are determined on any subinterval by \(n + 1\) control points. The approximated solution of delay systems containing inverse time is derived.

In this paper, we propose a scheme based on cubic spline in compression which comprises an exponentially fitted difference scheme on a uniform mesh. In Section 2, we state some important properties of the exact solution. In Section 3, we describe a difference scheme based on cubic spline in compression for a second order singularly perturbed delay differential equation. In Section 4, we give the numerical algorithm to solve a singularly perturbed delay differential equation. Some numerical results are presented in Section 5, and conclusions are given in Section 6.

2 Statement of the problem

We consider the following boundary value problem (BVP) for the delay differential equation (DDE):

$$ \varepsilon y''(x) + a(x)y'(x) + b(x)y(x - 1) = f(x),\quad 0 < x < 2, $$
(1)

subject to the interval and boundary conditions

$$ \begin{aligned} &y(x) = \phi (x), \quad x \in[ - 1,0]; \\ &y(2) = \beta, \end{aligned} $$
(2)

where \(0 < \varepsilon \ll 1\) and \(a(x) \ge\alpha> 0\), \(a(x)\), \(b(x)\), \(f(x)\) are given sufficiently smooth functions on \([0,2]\), \(\phi (x)\) is a smooth function on \([- 1,0]\) and β is a given constant which is independent of ε, the boundary value problem (1) along with (2) exhibits a strong boundary layer at \(x = 0\) (cf. [49], p.2351).

If \(a(x) < 0\), \(a(x)\), \(b(x)\), \(f(x)\) are given sufficiently smooth functions on \([0,2]\), \(\phi (x)\) is a smooth function on \([- 1,0]\) and β is a given constant which is independent of ε, then the boundary value problem (1) along with (2) exhibits a strong boundary layer at \(x = 2\) (cf. [52], p.236).

2.1 Stability result

Here we show some properties of the solution of (1) and (2). We use the following convention:

$$\begin{aligned}& \Vert g \Vert _{\infty} = \max_{0 \le x \le2}\bigl\vert g(x) \bigr\vert ,\qquad \Vert g \Vert _{1} = \int_{0}^{2} \bigl\vert g(x) \bigr\vert \, dx,\qquad \Vert g \Vert _{\infty,1} = \int_{0}^{1} \bigl\vert g(x) \bigr\vert \, dx, \\& \Vert g \Vert _{\infty,2} = \int_{1}^{2} \bigl\vert g(x) \bigr\vert \, dx\quad \mbox{and}\quad \Vert g \Vert _{0} = \int_{ - 1}^{0} \bigl\vert g(x) \bigr\vert \, dx. \end{aligned}$$

Lemma

If \(a(x),b(x),f(x) \in C[0,2]\) and \(\phi (x) \in C[ - 1,0]\) and \(\rho= \alpha^{ - 1}\Vert b \Vert _{\infty,2} < 1\), then the solution \(y(x)\) of problem (1) and (2) follows the estimates

$$\begin{aligned}& \Vert y \Vert _{\infty} \le C_{0}, \end{aligned}$$
(3)
$$\begin{aligned}& \bigl\vert y'(x) \bigr\vert \le C_{2} \biggl( 1 + \frac{1}{\varepsilon} e^{ - \frac{ax}{\varepsilon}} \biggr),\quad 0 \le x \le2, \end{aligned}$$
(4)

where

$$\begin{aligned}& C_{0} = \bigl( \bigl\vert \phi (0) \bigr\vert + \vert \beta \vert + \alpha^{ - 1}\Vert f \Vert _{1} + \alpha^{ - 1}\Vert b \Vert _{\infty,1}\Vert \phi \Vert _{0} \bigr) ( 1 - \rho )^{ - 1}, \\& C_{2} = \frac{(\vert \beta \vert + \vert \phi (0) \vert + C_{1})}{c_{0}}, \\& C_{1} = \alpha^{ - 1}\Vert f \Vert _{1} + \alpha^{ - 1}\Vert b \Vert _{\infty,1}\Vert \phi \Vert _{0} + \alpha^{ - 1}\Vert b \Vert _{\infty,2}C_{0}, \\& c_{0} = \frac{1}{a^{*}}\bigl(1 - e^{\frac{ - 2a^{*}}{\varepsilon}} \bigr), \end{aligned}$$

and \(a^{*} = \Vert a \Vert _{\infty}\).

Proof

From (1) we have

$$ y'(x) = y'(0)e^{\frac{ - 1}{\varepsilon} \int_{0}^{x} a(\eta) \, d\eta} - \frac{1}{\varepsilon} \int _{0}^{x} F(\xi) e^{\frac{ - 1}{\varepsilon} \int_{\xi}^{x} a(\eta)\, d\eta} \, d \xi $$
(5)

with \(F(x) = - f(x) + b(x)y(x - 1)\).

Integrating (5) over \((0,x)\) we get

$$y(x) - y(0) = y'(0)\int_{0}^{x} e^{\frac{ - 1}{\varepsilon} \int _{0}^{\tau} a(\eta)\, d\eta} \, d\tau- \frac{1}{\varepsilon} \int_{0}^{x} d\tau \int_{0}^{\tau} F(\xi)e^{\frac{ - 1}{\varepsilon} \int_{\xi}^{\tau} a(\eta ) \, d\eta} \, d\xi. $$

Since \(y(0) = \phi (0)\), we have

$$ y(x) = \phi (0) + y'(0)\int_{0}^{x} e^{\frac{ - 1}{\varepsilon} \int_{0}^{\tau} a(\eta) \, d\eta} \, d\tau- \frac{1}{\varepsilon} \int_{0}^{x} F(\xi) \biggl( \int_{\xi}^{x} e^{\frac{ - 1}{\varepsilon} \int_{\xi }^{\tau} a(\eta)\, d\eta} \, d \tau \biggr) \, d\xi. $$
(6)

Using the condition \(y(2) = \beta\), we have

$$ y'(0) = \frac{\beta- \phi (0) + \frac{1}{\varepsilon} \int_{0}^{2} F(\xi)\, d\xi\int_{\xi}^{2} e^{\frac{ - 1}{\varepsilon} \int_{\xi}^{\tau} a(\eta) \, d\eta} \, d\tau}{\int_{0}^{2} e^{ - \frac{1}{\varepsilon} \int_{0}^{\tau} a(\eta) \, d\eta}\, d\tau}. $$
(7)

Substituting (7) in (6), we get

$$\begin{aligned} y(x) =& \phi (0) + \biggl[ \beta- \phi (0) + \frac{1}{\varepsilon} \int _{0}^{2} F(\xi)\, d\xi\int_{\xi}^{2} e^{\frac{ - 1}{\varepsilon} \int_{\xi}^{\tau} a(\eta) \, d\eta} \, d\tau \biggr] \\ &{}\times\frac{\int_{0}^{x} e^{\frac{ - 1}{\varepsilon} \int_{0}^{\tau} a(\eta)\, d\eta} \, d\tau}{ \int_{0}^{2} e^{\frac{ - 1}{\varepsilon} \int_{0}^{\tau} a(\eta) \, d\eta} \, d\tau} - \frac{1}{\varepsilon} \int_{0}^{x} \biggl( F(\xi)\int _{\xi}^{x} e^{\frac{ - 1}{\varepsilon} \int_{\xi}^{\tau} a(\eta)\, d\eta} \, d\tau \biggr) \, d \xi. \end{aligned}$$
(8)

Using Green’s function,

$$ G(x,\xi) = \frac{1}{\varepsilon} \int_{\xi}^{2} e^{\frac{ - 1}{\varepsilon} \int_{\xi}^{\tau} a(\eta) \, d\eta} \, d\tau\cdot\frac{\int_{0}^{x} e^{\frac{ - 1}{\varepsilon} \int_{0}^{s} a(\eta)\, d\eta} \, ds}{\int_{0}^{2} e^{\frac{ - 1}{\varepsilon} \int_{0}^{\tau} a(\eta)\, d\eta} \, d\tau} - \frac{1}{\varepsilon} T_{0}(x - \xi)\int_{\xi}^{x} e^{\frac{ - 1}{\varepsilon} \int_{\xi}^{\tau} a(\eta)\, d\eta} \, d\tau, $$
(9)

equation (8) can be rewritten as

$$ y(x) = \biggl( 1 - \frac{\int_{0}^{x} e^{\frac{ - 1}{\varepsilon} \int_{0}^{s} a(\eta)\, d\eta} \, ds}{\int_{0}^{2} e^{\frac{ - 1}{\varepsilon} \int_{0}^{\tau} a(\eta) \, d\eta}\, d\tau} \biggr)\phi (0) + \frac{\int_{0}^{x} e^{\frac{ - 1}{\varepsilon} \int_{0}^{s} a(\eta) \, d\eta} \, ds}{\int_{0}^{2} e^{\frac{ - 1}{\varepsilon} \int_{0}^{\tau} a(\eta) \, d\eta}\, d\tau} \beta+ \int_{0}^{2} G(x,\xi) F(\xi)\, d\xi, $$
(10)

where \(T_{0}(\lambda) = 1\), \(\lambda\ge0\): \(T_{0}(\lambda) = 0\), \(\lambda< 0\).

Alternatively the Green’s function of the operator

$$Ly = - \varepsilon y''(x) - a(x)y'(x), \quad 0 < x < 2,\qquad y(0) = 0 \quad \mbox{and}\quad y(2) = 0 $$

can be expressed as

$$ G(x,\xi) = \frac{1}{\varepsilon w(\xi)} \left \{ \textstyle\begin{array}{l@{\quad}l} \varphi _{1}(\xi)\varphi _{2}(x),&0 \le\xi\le x \le2, \\ \varphi _{1}(x)\varphi _{2}(\xi),&0 \le x \le\xi\le2, \end{array}\displaystyle \right . $$
(11)

where the functions \(\varphi _{1}(x)\) and \(\varphi _{2}(x)\) are solutions of the problems

$$\begin{aligned}& L\varphi _{1} = 0,\qquad \varphi _{1}(0) = 0,\qquad \varphi _{1}(2) = 1, \\& L\varphi _{2} = 0,\qquad \varphi _{2}(0) = 1,\qquad \varphi _{2}(2) = 0 \end{aligned}$$

and \(w(\xi) = \frac{\varphi (\xi)}{Q(2)}\),

$$Q(x) = \int_{0}^{x} \varphi (s)\, ds,\qquad \varphi ( \xi) = \exp\biggl[\frac{ - 1}{\varepsilon} \int_{0}^{\xi} a(\tau)\, d\tau\biggr]. $$

Formula (11) means that \(G(x,\xi) \ge0\), and it follows from (9) that

$$\begin{aligned} \max_{x,\xi\in[0,2]}G(x,\xi) =& \max_{x,\xi\in[0,2]} \biggl( \frac{1}{\varepsilon} \int_{\xi}^{2} e^{\frac{ - 1}{\varepsilon} \int_{\xi}^{\tau} a(\eta) \,d\eta} \,d \tau\frac{\int_{0}^{x} e^{\frac{ - 1}{\varepsilon} \int_{0}^{s} a(\eta) \,d\eta} \,ds}{\int_{0}^{2} e^{\frac{ - 1}{\varepsilon} \int_{0}^{\tau} a(\eta) \,d\eta} \,d\tau} \\ &{}- \frac{1}{\varepsilon} T_{0}(x - \xi)\int _{\xi}^{x} e^{\frac{ - 1}{\varepsilon} \int_{\xi}^{\tau} a(\eta) \,d\eta} \,d\tau \biggr) \\ \le&\max_{x,\xi\in[0,2]} \biggl( \frac{1}{\varepsilon} \int _{\xi}^{2} e^{\frac{ - 1}{\varepsilon} \int_{\xi}^{\tau} a(\eta) \,d\eta} \,d\tau\cdot \frac{\int_{0}^{x} e^{\frac{ - 1}{\varepsilon} \int_{0}^{s} a(\eta) \,d\eta} \,ds}{\int_{0}^{2} e^{\frac{ - 1}{\varepsilon} \int_{0}^{\tau} a(\eta ) \,d\eta} \,d\tau} \biggr) \\ \le&\max_{x,\xi\in[0,2]} \biggl( \frac{1}{\varepsilon} \bigl\{ - \alpha ^{ - 1}\varepsilon \bigl[ e^{ - \frac{\alpha}{\varepsilon} (2 - \xi)} - 1 \bigr] \bigr\} \biggr) \\ \le&\max_{x,\xi\in[0,2]} \biggl( \frac{1}{\varepsilon} \bigl\{ \alpha^{ - 1}\varepsilon \bigl[ 1 - e^{ - \frac{\alpha}{\varepsilon} (2 - \xi)} \bigr] \bigr\} \biggr) \\ \le&\alpha^{ - 1}. \end{aligned}$$

Hence \(G(x,\xi) \le\alpha^{ - 1}\). Using this inequality in (10), we obtain

$$\begin{aligned} \bigl\Vert y(x) \bigr\Vert _{\infty} \le&\bigl\vert \phi (0) \bigr\vert + \vert \beta \vert + \int_{0}^{2} \bigl\vert G(x,\xi) \bigr\vert \bigl\vert F(\xi) \bigr\vert \, d\xi \\ \le&\bigl\vert \phi (0) \bigr\vert + \vert \beta \vert + \max _{x,\xi\in [0,2]}\bigl\vert G(x,\xi) \bigr\vert \int _{0}^{2} \bigl\vert F(\xi) \bigr\vert \, d\xi \\ \le&\bigl\vert \phi (0) \bigr\vert + \vert \beta \vert + \alpha^{ - 1}\int_{0}^{2} \bigl\vert F( \xi) \bigr\vert \, d\xi \\ \le&\bigl\vert \phi (0) \bigr\vert + \vert \beta \vert + \alpha^{ - 1}\Vert f \Vert _{1} + \alpha^{ - 1}\int _{0}^{2} \bigl\vert b(\xi )y(\xi- 1) \bigr\vert \, d\xi. \end{aligned}$$

Replacing \(\xi= 1 + s\), we find that

$$\begin{aligned}& \le\bigl\vert \phi (0) \bigr\vert + \vert \beta \vert + \alpha^{ - 1}\Vert f \Vert _{1} + \alpha^{ - 1}\int _{ - 1}^{1} \bigl\vert b(1 + s)y(s) \bigr\vert \,ds \\& \le\bigl\vert \phi (0) \bigr\vert + \vert \beta \vert + \alpha^{ - 1}\Vert f \Vert _{1} + \alpha^{ - 1}\int _{ - 1}^{0} \bigl\vert b(1 + s)\phi (s) \bigr\vert \,ds + \alpha^{ - 1}\int_{0}^{1} \bigl\vert b(1 + s)y(s) \bigr\vert \,ds \\& \le\bigl\vert \phi (0) \bigr\vert + \vert \beta \vert + \alpha^{ - 1}\Vert f \Vert _{1} + \alpha^{ - 1}\int _{ - 1}^{0} \bigl\vert b(1 + s)\phi (s) \bigr\vert \,ds + \alpha^{ - 1}\Vert y \Vert _{\infty} \int _{1}^{2} \bigl\vert b(s) \bigr\vert \,ds \\& \le\bigl\vert \phi (0) \bigr\vert + \vert \beta \vert + \alpha^{ - 1}\Vert f \Vert _{1} + \alpha^{ - 1} \Vert b \Vert _{\infty,1}\Vert \phi \Vert _{0} + \alpha^{ - 1}\Vert b \Vert _{\infty,2}\Vert y \Vert _{\infty}. \end{aligned}$$

Therefore

$$\bigl( 1 - \alpha^{ - 1}\Vert b \Vert _{\infty,2} \bigr)\Vert y \Vert _{\infty} \le\bigl\vert \phi (0) \bigr\vert + \vert \beta \vert + \alpha^{ - 1}\Vert f \Vert _{1} + \alpha^{ - 1}\Vert b \Vert _{\infty,1}\Vert \phi \Vert _{0}, $$

which implies

$$\bigl\Vert y(x) \bigr\Vert _{\infty} \le \bigl( \bigl\vert \phi (0) \bigr\vert + \vert \beta \vert + \alpha^{ - 1}\Vert f \Vert _{1} + \alpha^{ - 1}\Vert b \Vert _{\infty,1}\Vert \phi \Vert _{0} \bigr) ( 1 - \rho )^{ - 1} $$

since \(\rho= \alpha^{ - 1}\Vert b \Vert _{\infty,2} < 1\).

Hence we have \(\Vert y(x) \Vert _{\infty} \le C_{0}\), where \(C_{0} = ( \vert \phi (0) \vert + \vert \beta \vert + \alpha^{ - 1}\Vert f \Vert _{1} + \alpha^{ - 1}\Vert b \Vert _{\infty,1}\Vert \phi \Vert _{0} ) ( 1 - \rho )^{ - 1}\).

Now we prove estimate (4).

Since

$$\begin{aligned} \int_{0}^{2} e^{\frac{ - 1}{\varepsilon} \int_{0}^{\tau} a(\eta) \, d\eta} \, d\tau \ge&\int _{0}^{2} e^{\frac{ - a^{*}\tau}{\varepsilon}} \, d\tau= \frac{\varepsilon}{a^{*}}\bigl(1 - e^{\frac{ - 2a^{*}}{\varepsilon}} \bigr) \\ \ge&\frac{\varepsilon}{a^{*}}\bigl(1 - e^{\frac{ - 2a^{*}}{\varepsilon}} \bigr) \\ \equiv& c_{0}\varepsilon, \end{aligned}$$

where \(c_{0} = \frac{1}{a^{*}}(1 - e^{\frac{ - 2a^{*}}{\varepsilon}} ) < 1\), \(a^{*} = \Vert a \Vert _{\infty}\).

Consider from (7) that we have

$$\begin{aligned}& \frac{1}{\varepsilon} \int_{0}^{2} F(\xi)\, d\xi\int _{\xi}^{2} e^{\frac{ - 1}{\varepsilon} \int_{\xi}^{\tau} a(\eta) \, d\eta}\, d\tau \\& \quad \le\frac{1}{\varepsilon} \int_{0}^{2} \bigl\vert F(\xi) \bigr\vert \, d\xi \int_{\xi}^{2} e^{\frac{ - \alpha(\tau- \xi)}{\varepsilon}} \, d\tau \\& \quad \le\frac{1}{\varepsilon} \int_{0}^{2} \bigl\vert F(\xi) \bigr\vert \, d\xi \bigl\{ \alpha^{ - 1}\varepsilon \bigl[ 1 - e^{ - \frac{\alpha}{\varepsilon} (2 - \xi)} \bigr] \bigr\} \\& \quad \le\alpha^{ - 1}\int_{0}^{2} \bigl\vert F(\xi) \bigr\vert \, d\xi \\& \quad \le\alpha^{ - 1}\Vert f \Vert _{1} + \alpha^{ - 1}\Vert b \Vert _{\infty,1}\Vert \phi \Vert _{0} + \alpha^{ - 1}\Vert b \Vert _{\infty,2}C_{0} \\& \quad \equiv C_{1}. \end{aligned}$$

Substituting this in (7), we get

$$\begin{aligned} \bigl\vert y'(0) \bigr\vert \le&\frac{\vert \beta \vert + \vert \phi (0) \vert + \frac{1}{\varepsilon} \int_{0}^{2} \vert F(\xi) \vert \, d\xi \int_{\xi}^{2} e^{\frac{ - 1}{\varepsilon} \int_{\xi}^{\tau} a(\eta) \, d\eta} \, d\tau}{\int_{0}^{2} e^{ - \frac{1}{\varepsilon} \int_{0}^{\tau} a(\eta)\, d\eta}\, d\tau} \\ \le&\frac{(\vert \beta \vert + \vert \phi (0) \vert + C_{1})}{c_{0}\varepsilon} \equiv\frac{C_{2}}{\varepsilon},\quad \mbox{where } C_{2} = \frac{(\vert \beta \vert + \vert \phi (0) \vert + C_{1})}{c_{0}}. \end{aligned}$$

Using the procedure in (5), we get

$$\begin{aligned} \bigl\vert y'(x) \bigr\vert \le&\frac{C_{2}}{\varepsilon} e^{\frac{ - 1}{\varepsilon} \int_{0}^{x} \alpha\, d\eta} + \frac{1}{\varepsilon} \int_{0}^{x} \bigl\vert F(\xi) \bigr\vert e^{\frac{ - 1}{\varepsilon} \int_{\xi}^{x} \alpha \, d\eta} \, d\xi \\ \le&\frac{{C}_{2}}{\varepsilon} e^{ - \frac{\alpha x}{\varepsilon}} + C_{1} \\ \le&\frac{{C}_{2}}{\varepsilon} e^{ - \frac{\alpha x}{\varepsilon}} + C_{2}c_{0} - \vert \beta \vert - \bigl\vert \phi (0) \bigr\vert \\ \le&\frac{{C}_{2}}{\varepsilon} e^{ - \frac{\alpha x}{\varepsilon}} + C_{2},\quad \mbox{since } c_{0} < 1. \end{aligned}$$

Therefore we have

$$\bigl\vert y'(x) \bigr\vert \le C_{2} \biggl( 1 + \frac{1}{\varepsilon} e^{ - \alpha \frac{x}{\varepsilon}} \biggr),\quad 0 \le x \le2. $$

 □

3 Derivation of the method

Let \(x_{0} = 0\), \(x_{N} = 2\), \(x_{i} = ih\), \(h = 2/N\).

A function \(s(x,\tau) = s(x)\) satisfying in \([x_{i},x_{i + 1}]\) the differential equations is

$$ s''(x) + \tau s(x) = \bigl[s''(x_{i}) + \tau s(x_{i})\bigr]\frac{(x_{i + 1} - x)}{h} + \bigl[s''(x_{i + 1}) + \tau s(x_{i + 1})\bigr]\frac{(x - x_{i})}{h}, $$
(12)

where \(s(x_{i}) = y_{i}\) and \(\tau> 0\) is termed cubic spline in compression.

Solving (12) as a linear second order differential equation, we get

$$s(x_{i}) = A\cos\frac{\lambda}{h}x_{i} + B\sin \frac{\lambda}{ h}x_{i} + \biggl(\frac{M_{i} + \tau y_{i}}{\tau}\biggr)\biggl(\frac{x_{i+1}-x}{h}\biggr)\biggl(\frac{M_{i+1}+\tau y_{i+1}}{\tau}\biggr)\biggl(\frac{x-x_{i}}{h}\biggr). $$

We can find the arbitrary constants A and B by using interpolatory conditions

$$s(x_{i + 1}) = y_{i + 1},\qquad s(x_{i}) = y_{i}. $$

Writing \(\lambda= h\tau^{1/2}\) and \(M_{i} = s''(x_{i})\), we get

$$\begin{aligned} s(x) =& \frac{ - h^{2}}{\lambda^{2}\sin\lambda} \biggl[ M_{i + 1}\sin\frac{\lambda(x - x_{i})}{h} + M_{i}\sin\frac{\lambda(x_{i + 1} - x)}{h} \biggr] \\ &{}+ \frac{h^{2}}{\lambda^{2}} \biggl[ \frac{(x - x_{i})}{h}\biggl(M_{i + 1} + \frac{\lambda^{2}}{h^{2}}y_{i + 1}\biggr) + \frac{(x_{i + 1} - x)}{h} \biggl(M_{i} + \frac{\lambda^{2}}{h^{2}}y_{i}\biggr) \biggr]. \end{aligned}$$
(13)

Differentiating equation (13) and equating the left- and right-hand derivatives at \(x_{i}\), we have

$$\begin{aligned}& \frac{y_{i} - y_{i - 1}}{h} + \frac{h}{\lambda^{2}} \biggl[ (1 - \lambda \cot \lambda)M_{i} - \biggl(1 - \frac{\lambda}{\sin\lambda} \biggr)M_{i - 1} \biggr] \\& \quad = \frac{y_{i + 1} - y_{i}}{h} + \frac{h}{\lambda^{2}} \biggl[ \biggl(1 - \frac{\lambda}{\sin\lambda} \biggr)M_{i + 1} - (1 - \lambda\cot\lambda)M_{i} \biggr]. \end{aligned}$$
(14)

This leads to a tridiagonal system

$$ h^{2}(\lambda_{1}M_{i - 1} + 2\lambda_{2}M_{i} + \lambda_{1}M_{i + 1}) = y_{i + 1} - 2y_{i} + y_{i - 1},\quad i = 1,2,\ldots,2N - 1, $$
(15)

where

$$\lambda_{1} = \frac{1}{\lambda^{2}}\biggl(\frac{\lambda}{\sin\lambda} - 1\biggr), \qquad \lambda_{2} = \frac{1}{\lambda^{2}}(1 - \lambda\cot\lambda). $$

The condition of continuity given by (15) ensures the continuity of first order derivatives of the spline \(s(x,\tau)\) at interior points.

Substituting, \(\varepsilon M_{i} = - a(x_{i})y_{i}' - b(x_{i})y(x_{i} - 1) + f(x_{i})\) in equation (15) and using the following approximations for first order derivative of y:

$$\begin{aligned}& y_{i}' \cong\frac{(y_{i + 1} - y_{i - 1})}{2h}, \\& y_{i + 1}' \cong\frac{(3y_{i + 1} - 4y_{i} + y_{i - 1})}{2h}, \\& y_{i - 1}' \cong\frac{( - y_{i + 1} + 4y_{i} - 3y_{i - 1})}{2h}, \end{aligned}$$

we get the following tridiagonal linear system:

$$\begin{aligned}& \biggl( - \varepsilon+ \frac{3}{2}\lambda{}_{1}ha_{i - 1} + \lambda_{2}ha_{i} - \frac{\lambda_{1}}{2}ha_{i + 1} \biggr)y_{i - 1} + (2\varepsilon- 2\lambda_{1}ha_{i - 1} + 2\lambda_{1}ha_{i + 1})y_{i} \\& \qquad {}+ \biggl( - \varepsilon+ \frac{\lambda_{1}}{2}ha_{i - 1} - \lambda_{2}ha_{i} - \frac{3}{2}\lambda_{1}ha_{i + 1} \biggr)y_{i + 1} \\& \quad = - h^{2}\bigl[ \lambda_{1}(f_{i - 1} - b_{i - 1}y_{i - 1 - N}) + 2\lambda_{2}(f_{i} - b_{i}y_{i - N}) \\& \qquad {}+\lambda_{1}(f_{i + 1} - b_{i + 1}y_{i + 1 - N}) \bigr],\quad i = 1,2,\ldots,2N - 1. \end{aligned}$$
(16)

4 Numerical algorithm

Step 1. We obtain the reduced problem by setting \(\varepsilon= 0\) in equation (1) with an appropriate interval condition. Let \(y_{0}(x)\) be the solution of the reduced problem of (1) and (2), i.e.,

$$ a(x)y'_{0}(x) + b(x)y_{0}(x - 1) = f(x) $$
(17)

with

$$ y_{0}(x) = \phi (x), \quad - 1 \le x \le0. $$
(18)

We solve (17) and (18) by using the classical Runge-Kutta method of order four in \(0 \le x \le1\).

We consider \(y_{0}(1) = \gamma\).

Step 2. To obtain the solution in \(0 < x < 1\), we consider the numerical scheme from (16) with a fitting factor

$$\sigma(\rho) = \frac{a_{i}\rho}{2}\operatorname{Coth} \biggl( \frac {a_{i}\rho}{ 2} \biggr),\quad \mbox{where }\rho= \frac{h}{\varepsilon}\ (\textit{cf. } \mbox{[42]}). $$

Scheme (16) with a fitting factor can be written as

$$E_{i}y_{i - 1} - F_{i}y_{i} + G_{i}y_{i + 1} = H_{i},\quad 1 < i < N - 1, $$

where

$$\begin{aligned}& E_{i} = - \varepsilon\sigma+ \frac{3}{2}\lambda{}_{1}ha_{i - 1} + \lambda_{2}ha_{i} - \frac{\lambda_{1}}{2}ha_{i + 1}, \qquad F_{i} = - (2\varepsilon\sigma- 2\lambda_{1}ha_{i - 1} + 2\lambda_{1}ha_{i + 1}), \\& G_{i} = - \varepsilon\sigma+ \frac{\lambda_{1}}{2}ha_{i - 1} - \lambda_{2}ha_{i} - \frac{3}{2}\lambda_{1}ha_{i + 1} \quad \mbox{and} \\& H_{i}= - h^{2}\bigl(\lambda_{1}(f_{i - 1} - b_{i - 1}\phi _{i - 1 - N}) + 2\lambda_{2}(f_{i} - b_{i}\phi _{i - N}) + \lambda_{1}(f_{i + 1} - b_{i + 1}\phi _{i + 1 - N})\bigr). \end{aligned}$$

We solve this system by Thomas algorithm with the boundary conditions

$$y_{0} = \phi (0)\quad \mbox{and}\quad y_{N} = \gamma. $$

Similarly, to obtain the solution in \(1 < x < 2\), we rewrite the numerical scheme with the fitting factor as:

$$E_{i}y_{i - 1} - F_{i}y_{i} + G_{i}y_{i + 1} = H_{i},\quad N + 1 < i < 2N - 1, $$

where

$$\begin{aligned}& E_{i} = - \varepsilon\sigma+ \frac{3}{2}\lambda{}_{1}ha_{i - 1} + \lambda_{2}ha_{i} - \frac{\lambda_{1}}{2}ha_{i + 1}, \qquad F_{i} = - (2\varepsilon\sigma- 2\lambda_{1}ha_{i - 1} + 2\lambda_{1}ha_{i + 1}), \\& G_{i} = - \varepsilon\sigma+ \frac{\lambda_{1}}{2}ha_{i - 1} - \lambda_{2}ha_{i} - \frac{3}{2}\lambda_{1}ha_{i + 1} \quad \mbox{and} \\& H_{i} = - h^{2}\bigl(\lambda_{1}(f_{i - 1} - b_{i - 1}y_{i - 1 - N}) + 2\lambda_{2}(f_{i} - b_{i}y_{i - N}) + \lambda_{1}(f_{i + 1} - b_{i + 1}y_{i + 1 - N})\bigr). \end{aligned}$$

We solve the system with the boundary conditions

$$y_{N} = \gamma\quad \mbox{and}\quad y_{2N} = \beta. $$

5 Numerical examples

To demonstrate the applicability of the method, we consider one boundary value problem of singularly perturbed linear differential difference equations exhibiting boundary layer at the left end of the interval \([0,2]\) and four boundary value problems with right-end boundary layer. These problems were widely discussed in the literature. The numerical results are presented for \(\lambda_{1} = \frac{1}{18}\), \(\lambda_{2} = \frac{4}{9}\).

Since the exact solutions of the problems are not known, the maximum absolute errors for the examples are calculated using the following double mesh principle:

$$E_{\varepsilon}^{{N}} = \max_{0 \le i \le N}\bigl\vert y_{i}^{N} - y_{2i}^{2N} \bigr\vert . $$

For a value of N, the ε-uniform maximum absolute error is calculated by the formula \(E^{N} = \max_{\varepsilon} E_{\varepsilon}^{{N}}\).

The numerical rate of convergence for all the examples has been calculated by the formula

$$R^{N} = \frac{\log |E_{\varepsilon}^{{N}}/E_{\varepsilon}^{2N}|}{\log2}. $$

Example 1

([24], p.2357)

\(\varepsilon y''(x) + 128y'(x) + 0.25y(x - 1) = 0.25(x - 1)\), \(0 < x < \frac{3}{2}\), \(y(x) = x\), \(- 1 \le x \le0\), \(y(\frac{3}{2}) = 2\).

The numerical results are presented in Table 1 for different vales of perturbation parameter ε.

Table 1 The maximum absolute errors for Example  1 for different values of ε

Example 2

([23], p.247)

\(\varepsilon y''(x) - 3y'(x) + y(x - 1) = 0\), \(y(x) = 1\), \(- 1 \le x \le0\), \(y(2) = 2\).

The numerical results are presented in Table 2 for different vales of perturbation parameter ε.

Table 2 The maximum absolute errors for Example  2 for different values of ε

Example 3

([23], p.247)

\(\varepsilon y''(x) - 2y'(x) + 5y(x - 1) = 0\), \(y(x) = 1\), \(- 1 \le x \le0\), \(y(2) = 2\).

The numerical results are presented in Table 3 for different vales of perturbation parameter ε.

Table 3 The maximum absolute errors for Example  3 for different values of ε

Example 4

([23], p.247)

\(\varepsilon y''(x) - 5y'(x) + \frac{1}{2}y(x - 1) = \bigl \{\scriptsize{ \begin{array}{l@{\quad}l} - 1,& 0 \le x \le1, \\ 1,& 1 \le x \le2, \end{array}} \bigr .\) \(y(x) = 1\), \(- 1 \le x \le0\), \(y(2) = 2\).

The numerical results are presented in Table 4 for different vales of perturbation parameter ε.

Table 4 The maximum absolute errors for Example  4 for different values of ε

Example 5

([23], p.247)

\(\varepsilon y''(x) - (x + 10)y'(x) + y(x - 1) = - x\), \(y(x) = x\), \(- 1 \le x \le0\), \(y(2) = 2\).

The numerical results are presented in Table 5 for different vales of perturbation parameter ε.

Table 5 The maximum absolute errors for Example  5 for different values of ε

6 Discussion and conclusions

In this paper we present an exponentially fitted finite difference scheme to solve singularly perturbed delay differential equation of second order with large delay. The method is based on cubic spline in compression. We have implemented the present method on one linear example with left-end boundary layer and four examples with right-end boundary layer by taking different values of ε. Numerical results are presented in tables. From the results, it can be observed that as the grid size h decreases, the maximum absolute errors decrease, which shows the convergence to the computed solution. On the basis of the numerical results of a variety of examples, it is concluded that the present method offers significant advantage for the linear singularly perturbed delay differential equations with large delays.