## SpringerPlus

Impact Factor 0.982

Open Access

# Twelfth degree spline with application to quadrature

SpringerPlus20165:2096

DOI: 10.1186/s40064-016-3711-2

Accepted: 21 November 2016

Published: 16 December 2016

## Abstract

In this paper existence and uniqueness of twelfth degree spline is proved with application to quadrature. This formula is in the class of splines of degree 12 and continuity order $$C^{12}$$ that matches the derivatives up to order 6 at the knots of a uniform partition. Some mistakes in the literature are pointed out and corrected. Numerical examples are given to illustrate the applicability and efficiency of the new method.

### Mathematics Subject Classification

65D05 65D07 41A15

## Background

In the last two decades, Clarleft et al. (1967) have constructed a direct cubic spline that fits the first derivatives at the knots together with the value of the function and its second derivative at the beginning of the interval. They used it for the solution quadrature formula.

El Tarazi and Karaballi (1990) have constructed five types of even degree splines ($$j=2k,\,\,k=1,2,3,4,5$$) that match the derivatives up to the order k at the knots of a uniform partition for each $$k=1,\,2,\,3,\,4$$, and 5. These splines are also applied to quadrature.

Recently, Rathod et al. (2010) presented a formulation and study of an interpolatory cubic spline (named Subbotin cubic spline) to compute the integration over curved domains in the Cartesian two space and the integral approximations (quadrature).

In this work, we construct a twelfth degree spline which interpolates the derivatives up to the order 6 of a given function at the knots and its value at the beginning of the interval. We obtain a direct simple formula for the proposed spline. Error bounds for the function is derived in the sense of the Hermite interpolation. Also, a mistakes in the literature was corrected. Finally, numerical examples and comparison with other available methods are presented to illustrate the usefullness of proposed method.

## Description of the spline (existence and uniqueness)

We construct here a class of interpolating splines of degree 12. Error estimates for this spline is also represented.

Let $$0=x_{0}<x_{1}<\cdots<x_{n-1}<x_{n}=1$$ be a uniform partition of [0, 1]. We denote by $$S^{(6)}_{n,12}$$ the linear space of twelfth degree spline s(x) such that
1. 1

$$s(x)\in C^{(6)}[0,1]$$;

2. 2

s(x) is a polynomial of degree 12 in each subinterval $$[x_i,x_{i+1}]$$.

Set the stepsize $$h=x_{i+1}-x_{i}\,(i=0(1)n)$$. Note that if g is a real-valued function in [0, 1], then $$g_{i}$$ stands for $$g(x_{i})\,(i=0(1)n)$$.

### Theorem 1

Let s(x) be the spline defined in section “Description of the spline (existence and uniqueness)”. Given the real numbers $$f_{0}$$ and $$s^{(k)}_{i}=f^{(k)}_{i}$$ for $$\,\,i=0(1)n,\,\,k=1(1)6$$. Then, there exist a unique $$s(x)\in S^{(6)}_{n,12}$$ such that
\begin{aligned} {\left\{ \begin{array}{ll} s^{(k)}_{i}&{}=f^{(k)}_{i} \quad i=0(1)n,\,\,k=1(1)6;\\ s_{0}&{}=f_{0} \end{array}\right. } \end{aligned}
(1)
The twelfth degree spline s(x) which satisfies (1) in $$[x_{i},x_{i+1}]$$ is of the form:
\begin{aligned} s(x)=\sum _{j=0}^{11} h^{j}\left[ s^{(j)}_{i}A_{j}(t)+s^{(j)}_{i+1}A_{j}(t)\right] +h^{12}f^{(12)}_{i}A_{12}(t) \end{aligned}
(2)
where
\begin{aligned} A_{0}(t)&=(t-1)^6\left( 462t^6+252t^5+126t^4+56t^3+21t^2+6t+1\right) ,\\ A_{1}(t)&=-t^7\left( 462t^5-2520t^4+5544t^3-6160t^2+3465t-792\right) ,\\ A_{2}(t)&=t(t-1)^6\left( 252t^5+126t^4+56t^3+21t^2+6t+1\right) ,\\ A_{3}(t)&=t^7(t-1)\left( 210t^4-924t^3+1540t^2-1115t+330\right) ,\\ A_{4}(t)&=\frac{1}{2}t^2(t-1)^6\left( 126t^4+56t^3+21t^2+6t+1\right) ,\\ A_{5}(t)&=-\frac{1}{2}t^7(t-1)^2\left( 84t^3-280t^2+315t-120\right) ,\\ A_{6}(t)&=\frac{1}{6}t^3(t-1)^6\left( 56t^3+21t^2+6t+1\right) ,\\ A_{7}(t)&=\frac{1}{6}t^7(t-1)^3\left( 28t^2-63t+36\right) ,\quad A_{8}(t)=\frac{1}{24}t^4(t-1)^6\left( 21t^2+6t+1\right) ,\\ A_{9}(t)&=\frac{-1}{24}t^7(t-1)^4(7t-8), \qquad \quad \quad A_{10}(t)=\frac{1}{120}t^5(t-1)^6(6t+1), \\ A_{11}(t)&=\frac{1}{120}t^7(t-1)^5, \qquad \qquad \qquad \quad A_{12}(t)=\frac{1}{720}t^6(t-1)^6, \end{aligned}
and $$x=x_{i}+th$$, $$t\in [0,1]$$, with a similar expression for s(x) in $$[x_{i-1},x_{i}]$$.
The coefficient $$s_{i}$$ in (2) are given by the recurrence formula:
\begin{aligned} {\left\{ \begin{array}{ll} s_{i}&{}=s_{i-1}+\frac{1}{2}h\left[ f'_{i-1}+f'_{i}\right] +\frac{5}{44}h^{2}\left[ f''_{i-1}-f''_{i}\right] +\frac{1}{66}h^{3}\left[ f^{(3)}_{i-1}+f^{(3)}_{i}\right] \\ &{}+\frac{1}{792}h^{4}\left[ f^{(4)}_{i-1}-f^{(4)}_{i}\right] +\frac{1}{15840}h^{5}\left[ f^{(5)}_{i-1}+f^{(5)}_{i}\right] +\frac{1}{665280}h^{6}\left[ f^{(6)}_{i-1}-f^{(6)}_{i}\right] \\ s_{0}&{}=f_{0}. \end{array}\right. } \end{aligned}
(3)

### Proof

We can express any polynomial p(t) in [0, 1] of degree 12 in terms of its values and its derivatives upto order 5 at 0 and 1, and its sixth derivative at 0,
\begin{aligned} p(t)=\sum _{j=0}^{5}\left[ p^{(j)}_{0}A_{j}(t)+p^{(j)}_{1}A_{j+1}(t)\right] +p^{(6)}_{0}A_{12}(t) \end{aligned}
and to determine the coefficients $$A_{j},\,j=0,1,\ldots ,12$$, we write the above equality for $$p(t)=1,\,t,\,t^{2},\ldots ,t^{12}$$, we obtain the following system:
\begin{aligned} \begin{array}{cccccccc} A_{0} &{} +A_{1} &{} &{} &{} &{} &{} &{} =1 \\ A_{1} &{} +A_{2} &{} +A_{3} &{} &{} &{} &{} &{} =t \\ A_{1} &{} +2A_{3} &{} +2A_{4} &{} +2A_{5} &{} &{} &{} &{} =t^2 \\ A_{1} &{} +3A_{3} &{} +6A_{5} &{} +6A_{6} &{} +6A_{7} &{} &{} &{} =t^3 \\ A_{1} &{} +4A_{3} &{} +12A_{5} &{} +24A_{7} &{} +24A_{8} &{} +24A_{9} &{} &{} =t^4 \\ A_{1} &{} +5A_{3} &{} +20A_{5} &{} +60A_{7} &{} +120A_{9} &{} +120A_{10} &{} +120A_{11} &{} =t^5 \\ A_{1} &{} +6A_{3} &{} +30A_{5} &{} +120A_{7} &{} +360A_{9} &{} +720A_{11} &{} +720A_{12} &{} =t^6 \\ A_{1} &{} +7A_{3} &{} +42A_{5} &{} +210A_{7} &{} +840A_{9} &{} +2520A_{11} &{} &{} =t^7 \\ A_{1} &{} +8A_{3} &{} +56A_{5} &{} +336A_{7} &{} +1680A_{9} &{} +6720A_{11} &{} &{} =t^8 \\ A_{1} &{} +9A_{3} &{} +72A_{5} &{} +504A_{7} &{} +3024A_{9} &{} +15120A_{11} &{} &{} =t^9 \\ A_{1} &{} +10A_{3} &{} +90A_{5} &{} +720A_{7} &{} +5040A_{9} &{} +30240A_{11} &{} &{} =t^{10} \\ A_{1} &{} +11A_{3} &{} +110A_{5} &{} +990A_{7} &{} +7920A_{9} &{} +55440A_{11} &{} &{} =t^{11} \\ A_{1} &{} +12A_{3} &{} +132A_{5} &{} +1320A_{7} &{} +11880A_{9} &{} +95040A_{11} &{} &{} =t^{12} \end{array} \end{aligned}
Solving this system, to obtain $$A_{j},\,\,j=0(1)12$$, above.
Now for a fixed $$i\in \{0,\,1,\ldots ,n\}$$, set $$x=x_i+th,\,\,0<t<1$$. In $$[x_i,x_{i+1}]$$ the spline s(x) of degree 12 satisfying (1) is
\begin{aligned} s(x)&=\sum _{j=0}^{11} h^{j}\left[ s^{(j)}_{i}A_{j}(t)+s^{(j)}_{i+1}A_{j}(t)\right] +h^{12}f^{(12)}_{i}A_{12}(t) \end{aligned}
We have a similar expression for s(x) in $$[x_{i-1},x_i]$$. Since $$s(x)\in C^{(6)}[0,1]$$, we have
\begin{aligned} s^{(6)}(x_{i}^{-})&=s^{(6)}(x_{i}^{+}),\quad \hbox {for}\ i=0(1)n,\\ s^{(6)}(x_{n+1}^{-})&=f^{(6)}_{n+1}. \end{aligned}
This gives the above recurrence formula (3). Thus, the proof is completed. $$\square$$

## Error bounds

In this section, error estimates for the above interpolatory twelfth spline is considered. Note that $$\Vert \cdot \Vert$$ represents the $$L_{\infty }$$ norm.

### Theorem 2

(Birkhoff and Priver 1967; Clarleft et al. 1967; Varma and Howell 1983) Let $$g\in C^{2m}[0,h]$$ be given. Let $$p_{2m-1}$$ be the unique Hermite interpolation polynomial of degree $$2m-1$$ that matches g and its first $$m-1$$ derivatives $$g^{(r)}$$ at 0 and h. Then
\begin{aligned} \left| e^{(r)}(x)\right| \le \frac{h^{r}[x(h-x)]^{m-r}\,G}{r!(2m-2r)!},\quad r=0(1)m; \quad 0\le x\le h, \end{aligned}
(4)
where
\begin{aligned} \left| e^{(r)}(x)\right| =\left| g^{(r)}(x)-p^{(r)}_{2m-1}(x) \right| \ \quad \text {and} \quad G=\max _{0\le x\le h}\left| g^{(2m)}(x)\right| . \end{aligned}
(5)
The bounds in (2) are best possible for $$r=0$$ only.

### Theorem 3

Suppose that s(x) be the twelfth degree spline defined in sectionDescription of the spline (existence and uniqueness)and $$f\in C^{13}[0,1]$$ , then for any $$x\in [0,1]$$ we have
\begin{aligned} \left| s(x)-f(x)\right| \le \frac{h^{12}}{12!}\left\| f^{(13)}\right\| . \end{aligned}
(6)

### Proof

Since $$s'(x)$$ is the Hermite interpolation polynomial of degree 11 matching $$f^{(j)},\,\,(j=1,2,\ldots ,6)$$ at $$x=x_{i}$$ and $$x_{i+1}$$. So, by using (2) for $$x\in [x_{i},x_{i+1}]$$ (with $$\; m=6,\,g=f',\;\text {and}\; p_{1}=s'$$), we have (see Clarleft et al. 1967)
\begin{aligned} \left| s^{(r+1)}(x)-f^{(r+1)}(x)\right| \le \frac{h^{r}[(x-x_i)(x_{i+1}-x)]^{6-r}}{r!(12-2r)!}\left\| f^{(12)}\right\| , \quad r=0(1)6. \end{aligned}
Because $$x_i\le x\le x_{i+1}$$ so that $$(x-x_i)(x_{i+1}-x)\le h^2$$ and hence
\begin{aligned} \left| s^{(r+1)}(x)-f^{(r+1)}(x)\right| \le \frac{h^{12-r}}{r!(12-2r)!}\left\| f^{(12)}\right\| , \quad r=0(1)6. \end{aligned}
Then for any $$x\in [0,1]$$ and $$r=0$$ this becomes
\begin{aligned} \left| s'(x)-f'(x)\right| \le \frac{h^{12}}{(4^{6})(12!)}\left\| f^{(12)}\right\| . \end{aligned}
Integrating over [0, x] and using $$s(0)=f(0)$$, the last equation becomes
\begin{aligned} \left| s(x)-f(x)\right| \le \frac{h^{12}}{12!}\left\| f^{(13)}\right\| . \end{aligned}
Thus we have proved the theorem. $$\square$$

### Remark 1

The inequality (6) provides a correction of inequalities (5), (10), (15.4), (20), and (25) in El Tarazi and Karaballi (1990).

## Algorithms

We have to use following steps for solving a problem:
Step 1
Note that the above formulation and analysis was done in [0, 1]. However, this does not constitute a serious restriction since the same techniques can be carried out for the general interval [ab]. This is achieved from [ab] to [0, 1] using the linear transformation
\begin{aligned} x&=\frac{1}{b-a}t-\frac{a}{b-a} \end{aligned}
(7)
Step 2

Use (3) to compute $$s_{i}$$, $$(i=0(1)n)$$.

Step 3

Use (2) to compute s(x) at n equally spaced points in $$[x_{i},x_{i+1}],\;(i=1(1)n)$$.

## Illustrations

In this section, we illustrate the numerical technique discussed in the previous section by the following problems, in order to illustrate the comparative performance of the proposed spline method over other existing spline methods. All computations are performed using MATLAB 12b.

### Example 1

Consider the following Logarithmic Function (El Tarazi and Karaballi 1990; Rathod et al. 2010):
\begin{aligned} f(x)=\int _{1}^{x}\frac{dt}{1+t},\quad x\in [1,5]. \end{aligned}
(8)
The numerical solutions using twelfth degree spline are represented in Table 1, in case of $$h=0.1$$. In Table 2, maximum errors are reported corresponding to the present spline method and the spline method in El Tarazi and Karaballi (1990) for various values of h. Tables 3 and 4 show the comparison of the proposed spline method with the standard cubic splines (natural, clamped and a not a knot) and Subbotin cubic spline method developed in Rathod et al. (2010). Also, the exact and the numerical solutions are plotted in Fig. 1 for the step size $$h=1/20$$. It has been observed that our method is more efficient.

### Example 2

Consider the following function (Phythian and Williams 1986):
\begin{aligned} g(u)=u^4+1,\quad u\in [1,2]. \end{aligned}
(9)
The numerical solutions using twelfth degree spline are represented in Table 5, for $$h=0.1$$. The maximum absolute errors are tabulated in Table 6 for various values of h and compared with Anwar and El-Tarazi (1989). Figure 2 illustrates the comparison of numerical solution and analytical solution values at $$h=1/40$$. The proposed numerical solution gives almost overlapping behavior with the corresponding exact solution values.

### Example 3

Consider the Indefinite integral of Runge Function (Rathod et al. 2010):
\begin{aligned} f(x)=\int _{-1}^{x}\frac{dt}{1+25t^2},\quad x\in [-1,1]. \end{aligned}
(10)
Table 7 demonstrates the comparison of the proposed spline method with the Subbotin cubic spline method developed in Rathod et al. (2010).

### Example 4

Finally, we consider the Normal Distribution (Rathod et al. 2010):
\begin{aligned} f(x)=\int _{0}^{x}\frac{e^{-\frac{t^2}{2}}}{\sqrt{2\pi }}dt,\quad x\in [0,4]. \end{aligned}
(11)
The numerical results are tabulated in Table 8. Also comparison is made with the existing method in Rathod et al. (2010).
It is clear from the Tables 1, 2, 3, 4, 5, 6, 7 and 8 that our methods are better than the other existing methods. The results of our methods are better than those has lower order (Anwar and El-Tarazi 1989; El Tarazi and Karaballi 1990; Rathod et al. 2010).

## Conclusion

In this paper, the existence and uniqueness of a twelfth degree spline are derived and in which we have obtained a direct simple formula. This formula is agree with those obtained in Clarleft et al. (1967), El Tarazi and Karaballi (1990), Phythian and Williams (1986), where a different approach was used. Moreover, the performance of the proposed twelfth degree spline with the even degree splines (El Tarazi and Karaballi 1990), direct cubic spline (Anwar and El-Tarazi 1989), standard cubic splines (natural, clamped and a not a knot) and Subbotin cubic spline (Rathod et al. 2010; Rathod et al. 2010). For which, error estimates and numerical examples are presented. On the basis of the examples, the proposed method yields much better results than the other methods. Also, a mistake is corrected in the literature that occurred in error bounds.

## Declarations

### Authors’ contributions

POM is one of the authors of the original idea, mathematical background and all numerical simulations. He proved the Existence and Uniqueness of the proposed method and presented the first two examples. FKH made substantial contributions to the design and execution of this study and made critical revisions to the manuscript. He also presented and solved the last two examples. POM and FKH both provided the guidance and reviewed the manuscript. Both authors read and approved the final manuscript.

### Acknowledgements

The work was supported by the University Of Human Development (UHD). The authors would like to thank the referees for their useful and constructive comments.

### Competing interests

The authors declare that they have no competing interests.

## Authors’ Affiliations

(1)
Department of Mathematics, College of Education, University of Sulaimani

## References

1. Anwar M, El-Tarazi M (1989) Direct cubic spline with application to quadrature. Commun Appl Numer Methods 5:237–246
2. Birkhoff G, Priver A (1967) Hermite interpolation errors for derivatives. J Math Phys 46:440–447
3. Clarleft P, Schultz M, Varga R (1967) Numerical methods of high-order accuracy. Numer Math 9:394–430
4. El Tarazi M, Karaballi A (1990) On even-degree splines with application to quadrature. J Approx Theory 60:157–167
5. Phythian J, Williams R (1986) Direct cubic spline approximation to integrals. Int J Numer Methods Eng 23:305–315
6. Rathod HT, Shrivalli HY, Nagarajac KV (2010) On a new cubic spline interpolation with application to quadrature. Int J Math Anal 4:1387–1415
7. Varma A, Howell G (1983) Best error bounds for derivatives in two point Birkhoff interpolation problems. J Approx Theory 38:258–268