1 Introduction

Let \(n\geq 2\) and let \(\boldsymbol{w}= ( w_{1},\ldots ,w_{n} ) \) be a real n-tuple such that

$$ 0\leq W_{k}=\sum_{i=1}^{k}w_{i} \leq W_{n},\quad k=1,\ldots ,n, W_{n}>0. $$
(1)

In [5] the following Čebyšev’s inequality of the Mercer type:

$$ \Biggl( a+b-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i} \Biggr) \Biggl( c+d- \frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}y_{i} \Biggr) \leq ac+bd- \frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}x_{i}y_{i}, $$
(2)

was proved for any real n-tuples \(\boldsymbol{x}= ( x_{1}, \ldots ,x_{n} ) \) and \(\boldsymbol{y}= ( y_{1},\ldots ,y_{n} ) \) monotone in the same direction and real numbers a, b, c, d such that

$$ a\leq \min_{1\leq i\leq n}x_{i},\qquad b\geq \max _{1\leq i\leq n}x_{i},\qquad c\leq \min_{1\leq i\leq n}y_{i},\qquad d\geq \max_{1\leq i \leq n}y_{i}. $$
(3)

If x and y are monotonic in the opposite directions, inequality (2) is reversed.

Here, to be more precise, we cite that result with the slightly different notation.

In the same paper, the authors considered Čebyšev’s functional (or Čebyšev’s difference) of the Mercer type defined as the difference of the right- and left-hand sides of inequality (2). They established bounds in terms of the discrete Ostrowski inequality. Here we give more accurate bounds, which also provide refinements of inequality (2). In addition, using these results, we establish Ostrowski-like bounds for the Jensen–Mercer functional and, consequentially, a refinement of the Jensen–Mercer inequality.

2 Bounds for the Čebyšev’s functional of the Mercer type

Let \(m\geq 2\) and let \(\boldsymbol{p}= ( p_{1},\ldots ,p_{m} ) \) be a real m-tuple such that

$$ 0\leq P_{k}=\sum_{i=1}^{k}p_{i} \leq P_{m},\quad k=1,\ldots ,m, P_{m}>0. $$
(4)

Then \(\overline{P}_{k}=\sum_{i=k}^{m}p_{i}\geq 0\), \(k=1, \ldots ,m \). Furthermore, from the summation by parts (sometimes called the Abel transformation) it follows that the identity

$$\begin{aligned}& \sum_{i=1}^{m}p_{i}\sum _{i=1}^{m}p_{i}\xi _{i}\zeta _{i}-\sum_{i=1}^{m}p_{i} \xi _{i}\sum_{i=1}^{m}p_{i} \zeta _{i} \\& \quad = \sum_{i=1}^{m-1} \Biggl( \sum _{j=1}^{i-1}\overline{P}_{i+1}P_{j} \Delta \xi _{i}\Delta \zeta _{j}+\sum _{j=i}^{m-1}P_{i}\overline{P}_{j+1} \Delta \xi _{i}\Delta \zeta _{j} \Biggr) \end{aligned}$$
(5)

holds for any two real m-tuples \(\boldsymbol{\xi }= ( \xi _{1},\ldots ,\xi _{m} ) \) and \(\boldsymbol{\zeta }= ( \zeta _{1},\ldots ,\zeta _{m} ) \), where \(\Delta \xi _{i}=\xi _{i+1}-\xi _{i}\), \(\Delta \zeta _{i}=\zeta _{i+1}-\zeta _{i}\), \(i=1,\ldots ,m-1\) (see [7, 8]).

Here, and in the rest of the paper, we assume \(\sum_{j=k}^{l}x_{j}=0\) when \(k>l\).

Lemma 1

Let \(n\geq 2\) and let w be a real n-tuple such that (1) is fulfilled. Then for any real n-tuples x, y and real numbers a, b, c, d satisfying (3), the identity

$$\begin{aligned}& ac+bd-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}y_{i}- \Biggl( a+b- \frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i} \Biggr) \Biggl( c+d-\frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}y_{i} \Biggr) \\& \quad = ( x_{1}-a ) ( d-y_{n} ) + ( b-x_{n} ) ( y_{1}-c ) \\& \qquad {} +\frac{1}{W_{n}} \Biggl[ \sum_{i=1}^{n-1}W_{i} ( x_{1}-a ) \Delta y_{i}+\sum _{i=1}^{n-1}\overline{W}_{i+1} ( b-x_{n} ) \Delta y_{i} \\& \qquad {} +\sum_{i=1}^{n-1}W_{i} \Delta x_{i} ( y_{1}-c ) + \sum _{i=1}^{n-1}\overline{W}_{i+1}\Delta x_{i} ( d-y_{n} ) \Biggr] \\& \qquad {} +\frac{1}{W_{n}^{2}}\sum_{i=1}^{n-1} \Biggl( \sum_{j=1}^{i-1}W_{i} \overline{W}_{j+1}\Delta x_{i}\Delta y_{j}+\sum_{j=i}^{n-1} \overline{W}_{i+1}W_{j}\Delta x_{i}\Delta y_{j} \Biggr) \end{aligned}$$
(6)

holds, where \(\Delta x_{i}=x_{i+1}-x_{i}\), \(\Delta y_{i}=y_{i+1}-y_{i}\), \(i=1,\ldots ,n-1\).

Proof

For \(m=n+2\), we define m-tuples p, ξ, and ζ as

$$ \begin{aligned} &p_{1}=1, \qquad p_{2}=-\frac{w_{1}}{W_{n}}, \qquad p_{3}=-\frac{w_{2}}{W_{n}}, \qquad \ldots ,\qquad p_{m-1}=- \frac{w_{n}}{W_{n}},\qquad p_{m}=1, \\ &\xi _{1}=a, \qquad \xi _{2}=x_{1}, \qquad \xi _{3}=x_{2}, \qquad \ldots,\qquad \xi _{m-1}=x_{n},\qquad \xi _{m}=b, \\ &\zeta _{1}=c ,\qquad \zeta _{2}=y_{1}, \qquad \zeta _{3}=y_{2},\qquad \ldots,\qquad \zeta _{m-1}=y_{n},\qquad \zeta _{m}=d.\end{aligned} $$
(7)

Since w satisfies (1) it follows that

$$ 0\leq P_{k}=\sum_{i=1}^{k}p_{i} \leq P_{m},\quad k=1,2,\ldots ,m, P_{m}=1>0. $$

Hence, we can apply identity (5). Its left-hand side is

$$\begin{aligned}& \sum_{i=1}^{m}p_{i}\sum _{i=1}^{m}p_{i}\xi _{i}\zeta _{i}-\sum_{i=1}^{m}p_{i} \xi _{i}\sum_{i=1}^{m}p_{i} \zeta _{i} \\& \quad = ac+bd-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}y_{i}- \Biggl( a+b- \frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i} \Biggr) \Biggl( c+d-\frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}y_{i} \Biggr) . \end{aligned}$$

It can be easily seen that

$$\begin{aligned}& P_{1} = 1,\qquad P_{m}=1,\qquad P_{m-1}=0,\qquad P_{i}= \frac{\overline{W}_{i}}{W_{n}},\quad \text{for }i=2,\ldots ,m-2, \\& \overline{P}_{1} = 1,\qquad \overline{P}_{m}=1,\qquad \overline{P}_{2}=0,\qquad \overline{P}_{i}= \frac{W_{i-2}}{W_{n}},\quad \text{for }i=3,\ldots ,m-1, \end{aligned}$$

hence, on the right-hand side of (5) we have

$$\begin{aligned}& \sum_{i=1}^{m-1} \Biggl( \sum _{j=1}^{i-1}\overline{P}_{i+1}P_{j} \Delta \xi _{i}\Delta \zeta _{j}+\sum _{j=i}^{m-1}P_{i}\overline{P}_{j+1} \Delta \xi _{i}\Delta \zeta _{j} \Biggr) \\& \quad = \sum_{i=1}^{m-1} \Biggl( \overline{P}_{i+1}P_{1}\Delta \xi _{i} \Delta \zeta _{1}+\sum_{j=2}^{i-1} \overline{P}_{i+1}P_{j}\Delta \xi _{i} \Delta \zeta _{j} \\& \qquad {} +\sum_{j=i}^{m-2}P_{i} \overline{P}_{j+1}\Delta \xi _{i} \Delta \zeta _{j}+P_{i}\overline{P}_{m}\Delta \xi _{i}\Delta \zeta _{m-1} \Biggr) \\& \quad = \sum_{i=1}^{m-1} \Biggl( \overline{P}_{i+1}\Delta \xi _{i} ( y_{1}-c ) +\frac{1}{W_{n}}\sum_{j=2}^{i-1} \overline{P}_{i+1} \overline{W}_{j}\Delta \xi _{i}\Delta y_{j-1} \\& \qquad {} +\frac{1}{W_{n}}\sum_{j=i}^{m-2}P_{i}W_{j-1} \Delta \xi _{i} \Delta y_{j-1}+P_{i}\Delta \xi _{i} ( d-y_{n} ) \Biggr) . \end{aligned}$$

Calculating separately summands for \(i=1\) and \(i=m-1\), we obtain

$$\begin{aligned}& \sum_{i=1}^{m-1} \Biggl( \overline{P}_{i+1}\Delta \xi _{i} ( y_{1}-c ) +\frac{1}{W_{n}}\sum_{j=2}^{i-1} \overline{P}_{i+1} \overline{W}_{j}\Delta \xi _{i}\Delta y_{j-1} \\& \qquad {} +\frac{1}{W_{n}}\sum_{j=i}^{m-2}P_{i}W_{j-1} \Delta \xi _{i} \Delta y_{j-1}+P_{i}\Delta \xi _{i} ( d-y_{n} ) \Biggr) \\& \quad = \frac{1}{W_{n}}\sum_{j=2}^{m-2}W_{j-1} ( x_{1}-a ) \Delta y_{j-1}+ ( x_{1}-a ) ( d-y_{n} ) \\& \qquad {} +\frac{1}{W_{n}}\sum_{i=2}^{m-2}W_{i-1} \Delta x_{i-1} ( y_{1}-c ) +\frac{1}{W_{n}^{2}}\sum _{i=2}^{m-2}\sum _{j=2}^{i-1}W_{i-1} \overline{W}_{j} \Delta x_{i-1}\Delta y_{j-1} \\& \qquad {} +\frac{1}{W_{n}^{2}}\sum_{i=2}^{m-2} \sum_{j=i}^{m-2} \overline{W}_{i}W_{j-1} \Delta x_{i-1}\Delta y_{j-1}+\frac{1}{W_{n}}\sum _{i=2}^{m-2}\overline{W}_{i}\Delta x_{i-1} ( d-y_{n} ) \\& \qquad {} + ( b-x_{n} ) ( y_{1}-c ) +\frac{1}{W_{n}}\sum_{j=2}^{m-2}\overline{W}_{j} ( b-x_{n} ) \Delta y_{j-1}. \end{aligned}$$

Therefore,

$$\begin{aligned}& \sum_{i=1}^{m-1} \Biggl( \sum _{j=1}^{i-1}\overline{P}_{i+1}P_{j} \Delta \xi _{i}\Delta \zeta _{j}+\sum _{j=i}^{m-1}P_{i}\overline{P}_{j+1} \Delta \xi _{i}\Delta \zeta _{j} \Biggr) \\& \quad = ( x_{1}-a ) ( d-y_{n} ) + ( b-x_{n} ) ( y_{1}-c ) \\& \qquad {} +\frac{1}{W_{n}} \Biggl[ \sum_{j=2}^{n}W_{j-1} ( x_{1}-a ) \Delta y_{j-1}+\sum _{j=2}^{n}\overline{W}_{j} ( b-x_{n} ) \Delta y_{j-1} \\& \qquad {} +\sum_{i=2}^{n}W_{i-1} \Delta x_{i-1} ( y_{1}-c ) +\sum _{i=2}^{n}\overline{W}_{i}\Delta x_{i-1} ( d-y_{n} ) \Biggr] \\& \qquad {} +\frac{1}{W_{n}^{2}}\sum_{i=2}^{n} \Biggl( \sum_{j=2}^{i-1}W_{i-1} \overline{W}_{j}\Delta x_{i-1}\Delta y_{j-1}+\sum_{j=i}^{n} \overline{W}_{i}W_{j-1}\Delta x_{i-1} \Delta y_{j-1} \Biggr) , \end{aligned}$$

which is equal to the right-hand side of (6). □

Using identity (6) and imposing stricter conditions than (3), we obtain refinements of inequality (2) which are more accurate than those previously established in [5].

Theorem 1

Let \(n\geq 2\) and let w be a real n-tuple such that (1) is fulfilled. Let x, y be real n-tuples monotonic in the same direction. Suppose that real numbers a, b, c, d and nonnegative real numbers r, s satisfy

$$\begin{aligned}& \min_{1\leq i\leq n}x_{i}-a \geq r,\qquad b-\max _{1\leq i\leq n}x_{i} \geq r,\qquad \vert \Delta x_{i} \vert \geq r, \quad i=1, \ldots ,n-1, \end{aligned}$$
(8)
$$\begin{aligned}& \min_{1\leq i\leq n}y_{i}-c \geq s, \qquad d-\max _{1\leq i\leq n}y_{i} \geq s, \qquad \vert \Delta y_{i} \vert \geq s,\quad i=1, \ldots ,n-1. \end{aligned}$$
(9)

Then

$$\begin{aligned}& ac+bd-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}y_{i}- \Biggl( a+b- \frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i} \Biggr) \Biggl( c+d-\frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}y_{i} \Biggr) \\& \quad \geq rs \Biggl( 2n+\frac{1}{W_{n}^{2}}\sum_{i=1}^{n-1} \Biggl( \sum_{j=1}^{i-1}W_{i} \overline{W}_{j+1}+\sum_{j=i}^{n-1} \overline{W}_{i+1}W_{j} \Biggr) \Biggr) \geq 0. \end{aligned}$$
(10)

If x and y are monotonic in the opposite directions, then the inequalities in (10) are reversed and the term rs appears with the negative sign.

Proof

Under the given assumptions, using identity (6), we obtain

$$\begin{aligned}& ac+bd-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}y_{i}- \Biggl( a+b- \frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i} \Biggr) \Biggl( c+d-\frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}y_{i} \Biggr) \\& \quad \geq 2rs+\frac{2rs}{W_{n}} \Biggl( \sum_{i=1}^{n-1}W_{i}+ \sum_{i=1}^{n-1}\overline{W}_{i+1} \Biggr) +\frac{rs}{W_{n}^{2}}\sum _{i=1}^{n-1} \Biggl( \sum _{j=1}^{i-1}W_{i}\overline{W}_{j+1}+ \sum_{j=i}^{n-1} \overline{W}_{i+1}W_{j} \Biggr) . \end{aligned}$$

Since

$$ \sum_{i=1}^{n-1}W_{i}+\sum _{i=1}^{n-1}\overline{W}_{i+1}=\sum_{i=1}^{n-1}W_{n}= ( n-1 ) W_{n}, $$

we obtain the first inequality in (10). Since r, s are nonnegative real numbers and obviously

$$ 2n+\frac{1}{W_{n}^{2}}\sum_{i=1}^{n-1} \Biggl( \sum_{j=1}^{i-1}W_{i} \overline{W}_{j+1}+\sum_{j=i}^{n-1} \overline{W}_{i+1}W_{j} \Biggr) \geq 0, $$

the second inequality in (10) immediately follows. □

Using identity (6) and the triangle inequality, we can establish bounds for the Čebyšev’s functional (or Čebyšev’s difference) of the Mercer type in terms of the discrete Ostrowski inequality.

Throughout the rest of the paper, let \([ a,b ] \) and \([ c,d ] \) be intervals in \(\mathbb{R}\), where \(a< b\), \(c< d\).

Theorem 2

Let \(n\geq 2\) and let w be a real n-tuple such that conditions (1) are fulfilled. Then for any real n-tuples \(\boldsymbol{x}\in [ a,b ] ^{n}\), \(\boldsymbol{y}\in [ c,d ] ^{n}\) the following inequalities hold:

$$\begin{aligned}& \Biggl\vert ac+bd-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}y_{i}- \Biggl( a+b-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i} \Biggr) \Biggl( c+d- \frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}y_{i} \Biggr) \Biggr\vert \\& \quad \leq ( d-c ) \Biggl[ \frac{1}{W_{n}} \Biggl( \sum _{i=1}^{n}W_{i} \vert x_{1}-a \vert +\sum_{i=1}^{n} \overline{W}_{i} \vert b-x_{n} \vert \Biggr) +\sum_{i=1}^{n-1} \vert \Delta x_{i} \vert \\& \qquad {} +\frac{1}{W_{n}^{2}}\sum_{i=1}^{n-1} \Biggl( \sum_{j=1}^{i-1}W_{i}\overline{W}_{j+1}+\sum_{j=i}^{n-1} \overline{W}_{i+1}W_{j} \Biggr) \vert \Delta x_{i} \vert \Biggr] \\& \quad \leq ( b-a ) ( d-c ) \Biggl[ 2n+ \frac{1}{W_{n}^{2}}\sum _{i=1}^{n-1} \Biggl( \sum _{j=1}^{i-1}W_{i}\overline{W}_{j+1}+\sum_{j=i}^{n-1}\overline{W}_{i+1}W_{j} \Biggr) \Biggr] . \end{aligned}$$
(11)

Proof

Using identity (6) and the triangle inequality, we have

$$\begin{aligned}& \Biggl\vert ac+bd-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}y_{i}- \Biggl( a+b-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i} \Biggr) \Biggl( c+d- \frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}y_{i} \Biggr) \Biggr\vert \\& \quad \leq \vert x_{1}-a \vert \vert d-y_{n} \vert + \vert b-x_{n} \vert \vert y_{1}-c \vert \\& \qquad {} +\frac{1}{W_{n}} \Biggl[ \sum_{i=1}^{n-1}W_{i} \vert x_{1}-a \vert \vert \Delta y_{i} \vert + \sum_{i=1}^{n-1} \overline{W}_{i+1} \vert b-x_{n} \vert \vert \Delta y_{i} \vert \\& \qquad {} +\sum_{i=1}^{n-1}W_{i} \vert \Delta x_{i} \vert \vert y_{1}-c \vert + \sum_{i=1}^{n-1}\overline{W}_{i+1} \vert \Delta x_{i} \vert \vert d-y_{n} \vert \Biggr] \\& \qquad {} +\frac{1}{W_{n}^{2}}\sum_{i=1}^{n-1} \Biggl( \sum_{j=1}^{i-1}W_{i} \overline{W}_{j+1} \vert \Delta x_{i} \vert \vert \Delta y_{j} \vert +\sum_{j=i}^{n-1} \overline{W}_{i+1}W_{j} \vert \Delta x_{i} \vert \vert \Delta y_{j} \vert \Biggr) , \end{aligned}$$

because \(W_{i}\) and \(\overline{W}_{i}\) are nonnegative for all \(i=1,\ldots ,n \). Since \(\vert y_{1}-c \vert \), \(\vert d-y_{n} \vert \), \(\vert \Delta y_{i} \vert \) for all \(i=1,\ldots ,n\), are less or equal to \(d-c\), and \(\vert x_{1}-a \vert \), \(\vert b-x_{n} \vert \), \(\vert \Delta x_{i} \vert \) for all \(i=1,\ldots ,n\), are less or equal to \(b-a\), we obtain inequalities (11). □

Remark 1

If in Theorem 2 we add assumption that R, S are nonnegative real numbers such that

$$\begin{aligned}& \vert x_{1}-a \vert \leq R, \qquad \vert b-x_{n} \vert \leq R,\qquad \vert \Delta x_{i} \vert \leq R,\quad i=1,\ldots ,n-1, \end{aligned}$$
(12)
$$\begin{aligned}& \vert y_{1}-c \vert \leq S,\qquad \vert d-y_{n} \vert \leq S,\qquad \vert \Delta y_{i} \vert \leq S,\quad i=1,\ldots ,n-1, \end{aligned}$$
(13)

then we obtain refinements of the two inequalities proved in [5] under the same assumption. Namely, we have inequalities

$$\begin{aligned}& \Biggl\vert ac+bd-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}y_{i}- \Biggl( a+b-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i} \Biggr) \Biggl( c+d- \frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}y_{i} \Biggr) \Biggr\vert \\& \quad \leq S \Biggl[ \frac{1}{W_{n}} \Biggl( \sum _{i=1}^{n}W_{i} \vert x_{1}-a \vert +\sum_{i=1}^{n} \overline{W}_{i} \vert b-x_{n} \vert \Biggr) +\sum _{i=1}^{n-1} \vert \Delta x_{i} \vert \\& \qquad {} +\frac{1}{W_{n}^{2}}\sum_{i=1}^{n-1} \Biggl( \sum_{j=1}^{i-1}W_{i}\overline{W}_{j+1}+\sum_{j=i}^{n-1} \overline{W}_{i+1}W_{j} \Biggr) \vert \Delta x_{i} \vert \Biggr] \\& \quad \leq RS \Biggl[ 2n+\frac{1}{W_{n}^{2}}\sum_{i=1}^{n-1} \Biggl( \sum_{j=1}^{i-1}W_{i} \overline{W}_{j+1}+\sum_{j=i}^{n-1} \overline{W}_{i+1}W_{j} \Biggr) \Biggr] \end{aligned}$$
(14)

and, as a special case when \(w_{i}=1\) (\(i=1,\ldots ,n \)), we have inequalities

$$\begin{aligned}& \Biggl\vert ac+bd-\frac{1}{n}\sum_{i=1}^{n}x_{i}y_{i}- \Biggl( a+b- \frac{1}{n}\sum_{i=1}^{n}x_{i} \Biggr) \Biggl( c+d-\frac{1}{n}\sum_{i=1}^{n}y_{i} \Biggr) \Biggr\vert \\& \quad \leq S \Biggl( \frac{n+1}{2} \Biggl( \vert x_{1}-a \vert + \sum_{i=1}^{n-1} \vert \Delta x_{i} \vert + \vert b-x_{n} \vert \Biggr) - \frac{1}{2n}\sum_{i=1}^{n-1}i ( n-i ) \vert \Delta x_{i} \vert \Biggr) \\& \quad \leq RS\frac{ ( n+1 ) ( 5n+7 ) }{12}. \end{aligned}$$

3 Bounds for the Jensen–Mercer functional

Jensen–Mercer inequality

$$ f \Biggl( a+b-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i} \Biggr) \leq f ( a ) +f ( b ) -\frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}f ( x_{i} ) , $$
(15)

for a convex function \(f: ( \alpha ,\beta ) \rightarrow \mathbb{R} \), real n-tuple \(\boldsymbol{x}\in [ a,b ] ^{n}\), and positive real n-tuple w, where \(-\infty \leq \alpha < a< b<\beta \leq \infty \), was proved in [6]. In [1], it was proved that it remains valid when x is monotonic and w satisfies conditions (1).

Using our results from the previous section, we establish Ostrowski-like bounds for the Jensen–Mercer functional, i.e., the difference of the right- and left-hand sides of inequality (15).

Theorem 3

Let \(f: ( \alpha ,\beta ) \rightarrow \mathbb{R} \) be a differentiable function and suppose that γ, δ are real numbers such that \(\gamma \leq f^{\prime } ( x ) \leq \delta \), for all \(x\in ( \alpha ,\beta ) \). Let \(n\geq 2\) and suppose that n-tuple \(\boldsymbol{x}\in [ a,b ] ^{n}\), where \(-\infty \leq \alpha < a< b<\beta \leq \infty \), satisfies conditions (12). Let w be a real n-tuple such that conditions (1) are fulfilled and \(a+b-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}\in [ a,b ] \). Then

$$\begin{aligned}& \Biggl\vert f ( a ) +f ( b ) - \frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}f ( x_{i} ) -f \Biggl( a+b- \frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}x_{i} \Biggr) \Biggr\vert \\& \quad \leq ( \delta -\gamma ) \Biggl[ \frac{1}{W_{n}} \Biggl( \sum _{i=1}^{n}W_{i} \vert x_{1}-a \vert +\sum_{i=1}^{n} \overline{W}_{i} \vert b-x_{n} \vert \Biggr) +\sum_{i=1}^{n-1} \vert \Delta x_{i} \vert \\& \qquad {} +\frac{1}{W_{n}^{2}}\sum_{i=1}^{n-1} \Biggl( \sum_{j=1}^{i-1}W_{i}\overline{W}_{j+1}+\sum_{j=i}^{n-1} \overline{W}_{i+1}W_{j} \Biggr) \vert \Delta x_{i} \vert \Biggr] \\& \quad \leq R ( \delta -\gamma ) \Biggl[ 2n+ \frac{1}{W_{n}^{2}}\sum _{i=1}^{n-1} \Biggl( \sum _{j=1}^{i-1}W_{i}\overline{W}_{j+1}+\sum_{j=i}^{n-1}\overline{W}_{i+1}W_{j} \Biggr) \Biggr] . \end{aligned}$$
(16)

Proof

By the mean-value theorem, for any \(\zeta ,\eta \in ( \alpha ,\beta ) \), there exists some ξ between them such that \(f ( \zeta ) -f ( \eta ) =f^{\prime } ( \xi ) ( \zeta -\eta ) \). Hence, choosing \(\zeta =x_{i}\) and \(\eta =a+b-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}\), we obtain

$$ f ( x_{i} ) -f \Biggl( a+b-\frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}x_{i} \Biggr) =f^{\prime } ( \xi _{i} ) \Biggl( x_{i}- ( a+b ) +\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i} \Biggr) . $$
(17)

Multiplying (17) by \(-\frac{w_{i}}{W_{n}}\), and then summing over i, we have

$$\begin{aligned}& -\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}f ( x_{i} ) +f \Biggl( a+b-\frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}x_{i} \Biggr) \\& \quad = -\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}f^{\prime } ( \xi _{i} ) +\frac{1}{W_{n}} ( a+b ) \sum _{i=1}^{n}w_{i}f^{ \prime } ( \xi _{i} ) -\frac{1}{W_{n}^{2}}\sum_{i=1}^{n}w_{i}x_{i}\sum_{i=1}^{n}w_{i}f^{\prime } ( \xi _{i} ) . \end{aligned}$$

Choosing \(\zeta =a\), \(\zeta =b\), respectively, and \(\eta =a+b-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}\), we have

$$\begin{aligned}& f ( a ) -f \Biggl( a+b-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i} \Biggr) = f^{\prime } ( \xi _{a} ) \Biggl( \frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}-b \Biggr) , \\& f ( b ) -f \Biggl( a+b-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i} \Biggr) = f^{\prime } ( \xi _{b} ) \Biggl( \frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}-a \Biggr) . \end{aligned}$$

Summing the above three equalities, we obtain

$$\begin{aligned}& f ( a ) +f ( b ) -\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}f ( x_{i} ) -f \Biggl( a+b-\frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}x_{i} \Biggr) \\& \quad = -\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}f^{\prime } ( \xi _{i} ) + ( a+b ) \frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}f^{ \prime } ( \xi _{i} ) -\frac{1}{W_{n}^{2}}\sum_{i=1}^{n}w_{i}x_{i}\sum_{i=1}^{n}w_{i}f^{\prime } ( \xi _{i} ) \\& \qquad {} +f^{\prime } ( \xi _{a} ) \Biggl( \frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}-b \Biggr) +f^{\prime } ( \xi _{b} ) \Biggl( \frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i}-a \Biggr) \\& \quad = af^{\prime } ( \xi _{a} ) +bf^{\prime } ( \xi _{b} ) -\frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}x_{i}f^{\prime } ( \xi _{i} ) \\& \qquad {} - \Biggl( a+b-\frac{1}{W_{n}}\sum_{i=1}^{n}w_{i}x_{i} \Biggr) \Biggl( f^{\prime } ( \xi _{a} ) +f^{\prime } ( \xi _{b} ) -\frac{1}{W_{n}}\sum _{i=1}^{n}w_{i}f^{\prime } ( \xi _{i} ) \Biggr) . \end{aligned}$$

Since \(\gamma \leq f^{\prime } ( x ) \leq \delta \), for all \(x\in ( \alpha ,\beta ) \), it holds

$$\begin{aligned}& \bigl\vert f^{\prime } ( \xi _{1} ) -f^{\prime } ( \xi _{a} ) \bigr\vert \leq \delta -\gamma ,\qquad \bigl\vert f^{ \prime } ( \xi _{b} ) -f^{\prime } ( \xi _{n} ) \bigr\vert \leq \delta -\gamma , \\& \bigl\vert \Delta f^{\prime } ( \xi _{i} ) \bigr\vert \leq \delta -\gamma ,\quad i=1, \ldots ,n-1, \end{aligned}$$

and inequalities (16) immediately follow from Theorem 2 and Remark 1. □

Remark 2

An integral variant of identity (5) can be found in [9] and there is a way to obtain integral variants in terms of Riemann–Stieltjes integral of the Jensen–Mercer inequality from the Jensen–Steffensen inequality (see, for example, [24]). Hence, our discrete results can be extended to the continuous case.