1 Introduction

In this paper, a TFBTDM whose coefficients depend on the frequency and stepsize is constructed for periodic IVPs of the form

$$\begin{aligned} y'' = f( x,y), y(x_{0}) = y_{0}, ~y'(x_{0}) = y'_{0}. \end{aligned}$$
(1)

The motivation governing the development of the TFBTDM is inherent in the fact that if the frequency or a reasonable estimate of it is known in advance, the method will be more advantageous than the polynomial based methods (see [24]). Several techniques based on exponential fitting which take advantage of the special properties of the solution of (1) that may be known in advance have been proposed (see [4, 5, 13, 13, 14, 21, 2426, 30, 33]).

It is also shown that the TFBTDM can be used to solve the general second-order IVPs of the form

$$\begin{aligned} y'' = f( x,y,y'), y(x_{0}) = y_{0}, ~y'(x_{0}) = y'_{0}, \end{aligned}$$
(2)

since these type of equations arise frequently in engineering, science, and social sciences with (1) as a special case. Conventionally, (2) is first transformed into a system of first-order IVPs and solved by the various methods available for solving systems of first order IVPs (see [2, 11, 19, 22]).

It has been shown that solving (1) directly is preferable, since about half of the storage space can be saved, especially, if the dimension of (1) is large (see [4, 6, 11, 1113, 20, 25, 2729]). Nevertheless, fewer methods have been proposed for solving the general form (2) directly (see [1, 3, 12, 34]). These methods are generally implemented in a step-by-step fashion in which on the partition \(\Pi _{N}\), an approximation is obtained at \(x_{n}\) only after an approximation at \(x_{n-1}\) has been computed, where for some stepsize \(h\) and integer \(N>0\),

$$\begin{aligned} \Pi _{N}:=\{x_{0}<x_{1}<\cdots <x_{N}\}, ~~x_{n}=x_{n-1}+h,\quad n = 1, \ldots , N. \end{aligned}$$

The TFBTDM involves a different approach which discretizes the problem by simultaneously solving the resulting system in a block-by-block manner (see [14]). Some techniques based on combining different methods and using them to simultaneously solve scalar and systems of first order IVPs are also discussed in [2, 7, 15].

The paper is organized as follows. In Sect. 2, the TFBTDM is recovered from a continuous approximation and analyzed. Section 3 is devoted to the computational aspect and numerical examples are given in Sect. 4. Finally, the conclusion of the paper is discussed in Sect. 5.

2 Development of method

In this section, we develop a two-step TFBTDM for the direct numerical solution of (2) on the interval from \(x_{n}\) to \(x_{n+2} = x_{n} + 2h\). We initially assume that the solution on the interval \([x_{n}, x_{n+2}]\) is locally approximated by the function

$$\begin{aligned} U(x)=\sum _{j=0}^{5} \ell _jx^{j}+ \ell _6 \sin (w x) + \ell _7 \cos (w x), \end{aligned}$$
(3)

where \(\ell _j\) are coefficients to be uniquely determined and \(w\) is the frequency. Since this function must pass through the points \((x_{n}, y_{n}),(x_{n+1}, y_{n+1}),(x_{n+2}, y_{n+2})\), we demand that the following eight equations must be satisfied.

$$\begin{aligned} U(x_{n+j})=y_{n+j},\quad j=0,1, \end{aligned}$$
(4)
$$\begin{aligned} U''(x_{n+j})=f_{n+j},\quad U'''(x_{n+j})=g_{n+j},\quad j=0,1,2, \end{aligned}$$
(5)

where \(g_{n+j}=\frac{df(x,~ y(x),~ y'(x))}{dx}|^{x_{n+j}}_{y_{n+j}}\).

We note that Eqs. (4) and (5) lead to a system of eight equations and eight undetermined coefficients which is solved with the aid of Mathematica 9.0 to obtain the coefficients \(\ell _j\) (see [14]). The uniquely determined coefficients are then substituted into (3) and after simplification we obtain the continuous representation of the TFBTDM and its first derivative as

$$\begin{aligned} U(x)=\alpha _{0}(x;w)y_{n}+\alpha _{1}(x;w)y_{n+1}+h^{2}\sum _{j=0}^{2}\beta _j(x;w)f_{n+j}+h^{3}\sum _{j=0}^{2}\gamma _j(x;w)g_{n+j}, \end{aligned}$$
(6)
$$\begin{aligned} U'(x)=\frac{d}{dx}(U(x)), \end{aligned}$$
(7)

where \(w\) is the frequency, \(\alpha _0(x;w)\), \(\alpha _1(x;w)\), \(\beta _{j}(x;w)\), and \(\gamma _j(x;w)\), \(j=0, 1, 2\) are continuous coefficients. We assume that \(y_{n+j} =U(x_{n} +jh)\) is the numerical approximation to the analytical solution \(y(x_{n+j})\), \(y'_{n+j} =U'(x_{n} +jh)\) is an approximation to \(y'(x_{n+j})\), \(f_{n+j}=U''(x_{n} +jh)\) is an approximation to \(y''(x_{n+j})\), and \(g_{n+j}=U'''(x_{n} +jh)\) is an approximation to \(y'''(x_{n+j})\), where for \(j=0, 1,2\),

$$\begin{aligned} g_{n+j}= & {} \frac{df(x, y(x), y'(x))}{dx}\bigg |^{x_{n+j}}_{y_{n+j}},~~f_{n+j}=f\left( x_{n+j}, y_{n+j}, y'_{n+j}\right) ,\\ g_{n+j}= & {} g\left( x_{n+j}, y_{n+j}, y'_{n+j}\right) . \end{aligned}$$

2.1 TFBTDM

In order to construct the four members that constitute the TFBTDM given in expressions (8)–(11), we specify the coefficients in (6) and (7). In particular, we let \(u = w h\) and evaluate (6) at \(x=x_{n+2}\) and (7) at \(\{x=x_{n}, x_{n+1}, x_{n+2}\}\). Thus, methods (6) and (7) and expressions (8)–(11) are linked as follows:

Expression (8): Evaluate (6) at \(x=x_{n+2}\)

\(\beta _0(x=x_{n+2};u)=\beta _{2,0}\), \(\beta _1(x=x_{n+2};u)=\beta _{2,1}\), \(\beta _2(x=x_{n+2};u)=\beta _{2,2}\),

\(\gamma _0(x=x_{n+2};u)=\gamma _{2,0}\), \(\gamma _1(x=x_{n+2};u)=\gamma _{2,1}\), \(\gamma _2(x=x_{n+2};u)=\gamma _{2,2}\).

Expression (9): Evaluate (7) at \(x=x_{n}\)

\(\beta _0(x=x_{n};u)=\beta _{1,0}\), \(\beta _1(x=x_{n};u)=\beta _{1,1}\), \(\beta _2(x=x_{n};u)=\beta _{1,2}\),

\(\gamma _0(x=x_{n};u)=\gamma _{1,0}\), \(\gamma _1(x=x_{n};u)=\gamma _{1,1}\), \(\gamma _2(x=x_{n};u)=\gamma _{1,2}\).

Expression (10): Evaluate (7) at \(x=x_{n+1}\)

\(\beta _0(x=x_{n+1};u)=\beta _{3,0}\), \(\beta _1(x=x_{n+1};u)=\beta _{3,1}\), \(\beta _2(x=x_{n+1};u)=\beta _{3,2}\),

\(\gamma _0(x=x_{n+1};u)=\gamma _{3,0}\), \(\gamma _1(x=x_{n+1};u)=\gamma _{3,1}\), \(\gamma _2(x=x_{n+1};u)=\gamma _{3,2}\).

Expression (11): Evaluate (7) at \(x=x_{n+2}\)

\(\beta _0(x=x_{n+2};u)=\beta _{4,0}\), \(\beta _1(x=x_{n+2};u)=\beta _{4,1}\), \(\beta _2(x=x_{n+2};u)=\beta _{4,2}\),

\(\gamma _0(x=x_{n+2};u)=\gamma _{4,0}\), \(\gamma _1(x=x_{n+2};u)=\gamma _{4,1}\), \(\gamma _2(x=x_{n+2};u)=\gamma _{4,2}\).

In what follows we give the members of the block, their coefficients and their equivalent Taylor series expansions.

(8)
(9)
(10)
(11)

Remark 2.1

We note that for small values of \(u\) the trigonometric coefficients are vulnerable and subject to heavy cancelation, hence the Taylor series coefficients must be used (see [25]).

2.2 Order and local truncation error

The algebraic order of each method is given by the integer \(p=6\) satisfying

$$\begin{aligned} \left\{ \begin{array}{l l} y(x_{n+2})-y_{n+2} = \bigcirc (h^{p+2}), \\ y(x_{n+1})-y_{n+1} = \bigcirc (h^{p+2}),\\ h y'(x_{n+1})-h y'_{n+1} = \bigcirc (h^{p+2}), \\ h y'(x_{n+2})-h y'_{n+2} = \bigcirc (h^{p+2}). \end{array} \right. \end{aligned}$$

where \(y_{n+2}, y_{n+1}, y'_{n+1}\), and \(y'_{n+2}\) are numerical solutions given by the methods by imposing that \(y(x_{n})= y_{n}\) and \(y'(x_{n})= y'_{n}\).

The Local Truncation Errors (LTEs) for methods (7), (8) and (9), and (10); denoted LTE (8), LTE (9), LTE (10), and LTE (11) are given by

$$\begin{aligned} \left\{ \begin{array}{l l} \text {LTE}(8) = \frac{29h^8}{302400}(w^2y^{(6)}(x_n) + y^{(8)}(x_n)), \\ \text {LTE}(9) = -\frac{h^8}{17280}(w^2y^{(6)}(x_n) +y^{(8)}(x_n))\\ \text {LTE}(10) = \frac{29h^8}{604800}(w^2y^{(6)}(x_n) + y^{(8)}(x_n)), \\ \text {LTE}(11) = \frac{31h^8}{201600}(w^2y^{(6)}(x_n) +y^{(8)}(x_n)). \end{array} \right. \end{aligned}$$

Remark 2.2

The method (8) reduces to the sixth-order conventional third derivative method as \(u \rightarrow 0\).

Remark 2.3

The method, in its current form is designed only for second order initial value problems. However, the derivation approach given in Sect. 2 can be extended to differential equations of any order. For instance, the approach was used to derived polynomial based methods for solving third and fourth order differential equations in [16, 17].

2.3 Linear-stability of the TFBTDM

The methods (7), (8) and (9), and (10) are combined to give the TFBTDM, which is expressed as

$$\begin{aligned} A^{(0)}Y_{\mu }= A^{(1)} Y_{\mu -1} + h^{2}\left( B^{(1)}F_{\mu -1}+B^{(0)}F_{\mu }\right) , \end{aligned}$$
(12)

where \(Y_{\mu }\), \(F_{\mu }\), \(Y_{\mu -1}\), \(F_{\mu -1}\), \(\mu =0, 1, \ldots , N/k\), \(n=0, 2, 4, \ldots , N-2 \) are given as \(Y_{\mu }=(y_{n+1}, y_{n+2}, hy'_{n+1}, hy'_{n+2})^{T}\), \(F_{\mu }=(f_{n+1}, f_{n+2}, hg_{n+1}, hg_{n+2})^{T}\), \(Y_{\mu -1}=(y_{n-1}, y_{n}, hy'_{n-1}, hy'_{n})^{T}\), \(F_{\mu -1}=(f_{n-1}, f_{n}, hg_{n-1}, hg_{n})^{T}\), \(A^{(i)}\), \(B^{(i)}\), \(i=0, 1\) are \(4 \times 4\) matrices whose entries are given by the coefficients of the methods (7), (8) and (9), and (10).

The linear-stability of the TFBTDM is discussed by applying the method to the test equation \(y''=\lambda y\), where \(\lambda \) is expected to run through the (negative) eigenvalues of the Jacobian matrix \(\frac{\partial f}{\partial y}\) (see [27]). Letting \(q=\lambda h^{2}\), it is easily shown that the application of (12) to the test equation yields

$$\begin{aligned} Y_{\mu }= M(q,u) Y_{\mu -1}~,M(q, u):=(A^{(0)}(u)-q B^{(0)}(u))^{-1} (A^{(1)(u)}+q B^{(1)}(u)), \end{aligned}$$
(13)

where the matrix \(M(q,u)\) is the amplification matrix which determines the stability of the method.

Definition 2.4

The region \(\Upsilon ={(q, u)}\) is the stability region if in this region the spectral radius \(\rho (M(q,u)) \le 1\).

Definition 2.5

As \(u \rightarrow 0\), the interval \([-q_{0}, 0]\) is the stability interval, if in this interval \(\rho (M(q,0)) \le 1\) and \(q_{0}\) is the stability boundary (see [27]).

Remark 2.6

We note that the general presentation of stability of the method gives the stability region \(\Upsilon ={(q, u)}\). However, as \(u \rightarrow 0\), the interval \([-q_{0}, 0]\) is the stability interval, if in this interval \(\rho (M(q,0)) \le 1\), in this case, \(q_{0}\) is called the stability boundary. This is stated to simply emphasize that as \(u \rightarrow 0\) the behavior of the TFBTDM is consistent with the behavior of standard methods in the literature. Since the stability matrix depends on two variables \(q\) and \(u\), we plot the stability region in the (q, u)-plane (see Fig. 1). As \(u \rightarrow 0\), we found that \(\rho (M(q,0))\le 1\) if \(q~\epsilon ~[-65.36, 0]\), hence \(q_{0}=65.36\).

Fig. 1
figure 1

The stability region for the TFBTDM plotted in the (q, u)-plane

3 Computational aspects

The TFBTDM (12) is applied to (2) on the partition \(\Pi _{N}\) as follows:

Step 1 Choose \(N\), \(h=(b-a)/N\), and the number of blocks \(\Gamma =N/2\); using (12), \(n=0\), \(\mu =1\), the values of \((y_{1}, y_{2})^{T}\) and \((y'_{1}, y'_{2})^{T}\) are simultaneously obtained over the sub-interval \([x_{0}, x_{2}]\), as \(y_{0}\) and \(y'_{0}\) are known from the IVP (2).

Step 2 For \(n=2\), \(\mu =2\), the values of \((y_{3}, y_{4})^{T}\) and \((y'_{3}, y'_{4})^{T}\) are simultaneously obtained over the sub-interval \([x_{2}, x_{4}]\), as \(y_{2}\) and \(y'_{2}\) are known from the previous block.

Step 3 The process is continued for \(n=4,\ldots ,N-2\) and \(\mu =3, \ldots , \Gamma \) to obtain the numerical solution to (1) on sub-intervals \( [x_{4}, x_{6} ], \ldots , [x_{N-2}, x_{N}]\).

Linear problems were solved using a code written in Mathematica 9.0 enhanced by the feature \(NSolve[~~]\), while nonlinear problems were solved by the Newton’s method enhanced by the feature \(FindRoot [~~]\) (see [18]). It is vital to note that Mathematica can symbolically compute derivatives, hence the entries of the Jacobian matrix which involve the partial derivatives of both \(f\) and \(g\) are automatically generated.

4 Numerical examples

In this section, we present some numerical results obtained using the TFBTDM and compare the results with those given by existing methods in the literature. We have included a test problem which is traditionally used in the literature to discuss stability to validate the fact that the TFBTDM has a moderately large stability boundary \(\Upsilon _{0}=65.36\). We have calculated the absolute error of the approximate solution on the partition \(\Pi _{h}\) as \(|y-y(x)|\). We note that the number of function evaluations (FNCs) per step involved in implementing the TFBTDM is two.

We note that the method can be implemented for all values of N, however, the comparison was done with different choices of N, because we wanted to use the N values that were used in the existing papers that we were using for comparison. All computations were carried out using a code written in Mathematica 9.0.

Example 4.1

We consider the Bessel’s equation (see [34]) given by

$$\begin{aligned} x^{2}y''+ xy'+(x^{2}-0.25)y = 0,~~{y(1) = \sqrt{\frac{2}{\pi }}\sin 1\simeq 0.67,} \end{aligned}$$

\( {y'(1) = (2\cos 1-\sin 1)/\sqrt{2\pi }\simeq 0.10},\)

$$\begin{aligned} \text{ Exact }:y(x)=J_{1/2}(x)=\sqrt{\frac{2}{\pi x}}\sin x. \end{aligned}$$

This problem was chosen to demonstrate the performance of the TFBTDM on the general second order IVP which includes \(y'\) on the right-hand side. The absolute errors (\(Err(y(x))=|y(x)-y|\) and (\(Err(y'(x))=|y'(x)-y|\)) in the solution and its derivative were obtained at \(x=8\) using the TFBTDM. Similar results, which are reproduced in Table 1 were obtained for the same problem by Vigo-Aguiar and Ramos (VAR8 [34] using the variable-step Falker method of order eight (\(p=8\)) in the predictor-corrector mode. It is seen that although we used fixed step-sizes, the TFBTDM generally performs better than the method in [34].

Table 1 Absolute errors at \(x=8\) for Example 4.1

Example 4.2

We consider given example which was also solved by [26] on the range \([0,10 \pi ]\).

$$\begin{aligned} y'' +W^{2} y = 0, ~y(0)=1, y'(0)=0, \end{aligned}$$

where \(W^{2}=100\) and the exact solution \(y(x)=\cos (W x)\).

This problem has been extensively solved in the literature to demonstrate the performance of numerical techniques (see [26]). Hence, the problem was solved by the TFBTDM and the results were compared with those given in [26]. Details of the results are given in Table 2 and it is seen that although the TFBTDM is of a lower order \(p=6\), it is more accurate than the method in [34] which is of a higher order \(p=10\).

Table 2 Results for Example 4.6 with \(h=\pi /12\)

Example 4.3

Consider the nonlinear Duffing equation which was also solved by [26] on the range \([0,10 \pi ]\).

$$\begin{aligned} y'' + y + y^{3} = B \cos { \Omega x}, ~y(0)=C_{0}, y'(0)=0, \end{aligned}$$
$$\begin{aligned} y(x)= C_{1}\cos (\Omega x) + C_{2}\cos (3 \Omega x) + C_{3}\cos (5\Omega x)+C_{4}\cos (7\Omega x), \end{aligned}$$

where \(\Omega =1.01\), \(\mathrm{B}=0.002\), \(C_{0}=0.200426728069\), \(C_{1}=0.200179477536\), \(C_{2}=0.246946143\times 10^{-3}\), \(C_{3}=0.304016\times 10^{-6}\), \(C_{4}=0.374\times 10^{-9}\).

This problem was chosen to demonstrate the performance of the TFBTDM on a nonlinear IVPs. The results produced by the TFBTDM were compared with those given in [26]. Details of the results are given in Table 3 and it is seen that although the TFBTDM is of order \(p=6\), it is more accurate than the method in [34] which is of order \(p=10\).

Table 3 Results for Example 4.6 with \(h=\pi /5\)

Example 4.4

We consider the nonlinear perturbed system on the range \([0, 10]\), with \(\varepsilon =10^{-3}\) (see [8]).

$$\begin{aligned}&y_{1}''+25y_{1} +\varepsilon (y_{1}^{2}+y_{2}^{2})=\varepsilon \varphi _{1}(x) , ~~~y_{1}(0) = 1,~~ y'_{1}(0) =0,\\&y_{2}''+25y_{2} +\varepsilon (y_{1}^{2}+y_{2}^{2})=\varepsilon \varphi _{2}(x),~~~y_{2}(0) = \varepsilon , ~~y'_{2}(0) = 5, \end{aligned}$$

where

$$\begin{aligned}&\varphi _{1}(x)=1+\varepsilon ^{2}+2\varepsilon \sin (5 x +x^{2})+2 \cos (x^{2})+(25-4 x^{2}) \sin (x^{2}),\\&\varphi _{2}(x)=1+\varepsilon ^{2}+2\varepsilon \sin (5 x +x^{2})-2 \sin (x^{2})+(25-4 x^{2}) \cos (x^{2}), \end{aligned}$$

and the exact solution is given by \(y_{1}(x)=\cos (5 x)+\varepsilon \sin (x^{2}),~~y_{2}(x)=\sin (5 x) +\varepsilon \cos (x^{2})\), represents a periodic motion of constant frequency with small perturbation of variable frequency.

This problem was chosen to demonstrate the performance of the TFBTDM on a nonlinear perturbed system. The problem was also solved by [8] using a variable step-size fifth-order trigonometrically fitted Runge–Kutta–Nyström method TFARKN5(3) and a fifth-order Runge–Kutta–Nyström method (ARKN5(3)) which was constructed by [10]. In Table 4, the maximum global error (\(Err=Max|y(x)-y|\)) for the three methods are compared. We remark that the TFARKN5(3) and ARKN5(3) are expected to perform better because they are exact when the solution involves a linear combination of trigonometric functions as well as implemented as a variable-step method. Nevertheless, the TFBTDM which is implemented using a fixed step-size is highly competitive to them, especially as the step-size is decreased.

Table 4 A comparison of methods for Example 4.4

Example 4.5

We consider the nonlinear system of second order IVP (see [21])

$$\begin{aligned}&y_{1}'' =(y_{1}-y_{2})^{3}+6368y_{1} -6384y_{2} +42 \cos (10x), ~~~y_{1}(0) = 0.5, y'_{1}(0) = 0,\\&y_{1}'' =-(y_{1}\!-\!y_{2})^{3}\!+\!12768y_{1} \!-\!12784y_{2} \!+\!42 \cos (10x),~~y_{2}(0) \!=\!0.5, y'_{2}(0) \!=\! 0 , x\epsilon [0, 10], \end{aligned}$$

with exact solution \(y_{1}(x)=y_{2}(x)=\cos (4x)-\cos (4x)/2\).

This problem was chosen to demonstrate the performance of the TFBTDM on a nonlinear system. The accuracy and efficiency of the TFBTDM are measured by the end-point global errors for the \(y\)-component and the corresponding FNCs used. The results obtained using the TFBTDM are displayed in Table 5 and compare with those given in [21]. It is seen from Table 5 that TFBTDM performs generally better than those in [21] in terms of accuracy and efficiency.

Example 4.6

We consider the stiff IVP which was also solved in [6].

$$\begin{aligned} y_{1}'' =(\varepsilon -2)y_{1}+(2\varepsilon -2)y_{2} , ~~y_{2}'' =(1-\varepsilon )y_{1}+(1-2\varepsilon )y_{2}, \end{aligned}$$
$$\begin{aligned} y_{1}(0) = 2, y'_{1}(0) = 0, ~~ y_{2}(0) = -1,~ y'_{2}(0) = 0 ~,\varepsilon =2500, ~x \epsilon ~ [0, 10\pi ]. \end{aligned}$$
$$\begin{aligned} \text{ Exact }: y_{1}(x)=2\cos x,~~y_{2}(x)=-\cos x, \end{aligned}$$

where \(\varepsilon \) is an arbitrary parameter. This problem was chosen to justify that the stability of the TFBTDM. The eigenvalues of the matrix of coefficients of the equations for \(y_{1}''\) and \(y_{2}''\) are \(-1\) and \(-\varepsilon \), thus, the analytical solution of the system exhibit two frequencies \(1\) and \(\sqrt{\varepsilon }\), however the initial conditions eliminate the high frequency component \(\sqrt{\varepsilon }\) (see [6]). As \(u\rightarrow 0\), the method is stable when \(q\in [-65.3613, 0]\). In Table 6, we give the absolute errors at selected values of \(x\), which indicate that choosing \(N=355\), the method is stable since for this value of \(N\), \(q\in [-65.3613, 0]\). However, for \(N=353\), \(q\ni [-65.3613, 0]\), hence the method becomes unstable. In particular, the method is stable when \(h~ \epsilon ~ (0, \sqrt{q_{0}/\varepsilon })\). We observe from Table 6, that TFBTDM (4) is stable for \(h~ \epsilon ~ (0, 0.1617)\) and unstable otherwise.

Table 5 The correct decimal digit at the endpoint for Example 4.4
Table 6 Results for Example 4.6

4.1 Estimating the frequency

A classical procedure for estimating the frequency is not available, however, some techniques for estimating the frequency are given in [13, 31, 32]. A preliminary testing indicates that a good estimate of the frequency can be obtained by demanding that \(LTE(8) = 0\), and solving for the frequency. That is, solve for \(\omega \) given that

$$\begin{aligned} \frac{29h^8}{302400}(w^2y^{(6)}(x_n) + y^{(8)}(x_n)) = 0, \end{aligned}$$

where \(y^{(j)}=\frac{d^{j}y}{dx^{j}}, j = 6, 8\) are \(j^{th}\) derivative, \(D=\frac{d}{dx}\) is a differential operator, and \(w\) is assumed to be a constant. We rewrite this equation as

$$\begin{aligned} \frac{29h^8}{302400}D^{6}(w^{2} + D^{2})y=0, \end{aligned}$$

we estimate the frequency by imposing that

$$\begin{aligned} (w^{2} + D^{2})y=0, \end{aligned}$$
(14)

and solving for \(w\) at \(x=x_{n}\). We implemented this procedure on example 4.2 and obtained \(w = 10\) which is in agreement with the known frequency. Hence, this procedure is interesting and will be the subject of our future research.

4.2 Rate of convergence of the TFBTDM

In this subsection, we use example 4.1 to validate the fact that the TFBTDM is of order 6. Hence, we give the rate of convergence (ROC) of TFBTDM which is calculated using the formula \(ROC= \mathrm{Log}_{2}(Err_{h}/Err_{h/2})\), \(Err^{h}\) is the maximum absolute error obtained using the step size \(h\). It is observed in Table 7 that as the stepsize is reduced by halve, the method behaves as an order 6 method. For instance, \(Err_{1/122}/Err_{1/224}=(2.63\times 10^{-10})/(4.16\times 10^{-12})= 63.22\approx 2^{6}=64\). Thus, the ROC of the TFBTDM is consistent with the theoretical order (\(p=6\)) of the method.

Table 7 ROC for Example 4.1

5 Conclusions

We have proposed a TFBTDM whose coefficients depend on the frequency and stepsize for accurately and efficiently solving periodic IVPs. It has been shown that the TFBTDM takes advantage of any problem whose frequency or a reasonable estimate of it is known in advance to perform better than the purely polynomial based methods. Specifically, the TFBTDM is recovered from a continuous approximation which is constructed by imposing that the chosen interpolating trigonometric polynomial satisfies the appropriate interpolating conditions. The TFBTDM is shown to be of order 6 and this is validated by the ROC of the TFBTDM which is consistent with the theoretical order (\(p=6\)) of the method (see Table 7). Moreover, the TFBTDM is shown to have a large stability region (see Fig. 1). In addition, the TFBTDM is applied in a block-by-block fashion and hence, it is self-starting and implemented without the use of predictors. Details of the numerical results are displayed in Tables 1, 2, 3, 4, 5. Our future research will be focused on developing variable step methods equipped with a strategy for estimating unknown frequencies.