1 Introduction

Writing the celebrated Hermite–Hadamard inequality

$$\begin{aligned} f\left( \frac{x+y}{2}\right) \le \frac{1}{y-x}\int _{x}^yf(t)\mathrm{d}t\le \frac{f(x)+f(y)}{2} \end{aligned}$$
(1)

in the form

$$\begin{aligned} f\left( \frac{x+y}{2}\right) \le \frac{F(y)-F(x)}{y-x}\le \frac{f(x)+f(y)}{2} \end{aligned}$$
(2)

we can see that (1) is, in fact, an inequality involving two very simple quadrature operators and a very simple differentiation formula. In papers [10] and [11] the quadrature operators occurring in (1) were replaced by more general ones whereas in[8] the middle term from (1) was replaced by more general formulas used in numerical differentiation. Thus inequalities involving expressions of the form

$$\begin{aligned} \frac{\sum _{i=1}^na_iF(\alpha _ix+\beta _iy)}{y-x}, \end{aligned}$$

where \(\sum _{i=1}^na_i=0,\) \(\alpha _i+\beta _i=1\) and \(F'=f\) were considered. In the current paper we deal with inequalities for expressions of the form

$$\begin{aligned} \frac{\sum _{i=1}^na_i\Phi (\alpha _ix+\beta _iy)}{(y-x)^2}, \end{aligned}$$
(3)

(where \(\Phi ''=f\)), which are used to approximate the second-order derivative of F, and surprisingly, we discover a connection between our approach and some inequality which was considered by Dragomir. First we make the following simple observation.

Remark 1

Let \(f,F,\Phi {:}\,[x,y]\rightarrow \mathbb R\) be such that \(\Phi '=F,F'=f,\) let \(n_i,m_i\in \mathbb N\cup \{0\},i=1,2,3;\) \(a_{i,j}\in \mathbb R,\alpha _{i,j},\beta _{i,j}\in [0,1], \alpha _{i,j}+\beta _{i.j}=1,i=1,2,3;j= 1,\dots ,n_i;\) \(b_{i,j}\in \mathbb R,\gamma _{i,j},\delta _{i,j}\in [0,1],\gamma _{i,j}+\delta _{i,j}=1,i=1,2,3;j=1,\dots ,m_i.\) If the inequality

$$\begin{aligned}&\sum _{i=1}^{n_1}a_{1,i}f(\alpha _{1,i}x+\beta _{1,i}y)+\frac{\sum _{i=1}^{n_2}a_{2,i}F(\alpha _{2,i}x+\beta _{2,i}y)}{y-x}\nonumber \\&\quad +\frac{\sum _{i=1}^{n_3}a_{3,i}\Phi (\alpha _{3,i}x+\beta _{3,i}y)}{(y-x)^2}\le \sum _{i=1}^{m_1}b_{1,i}f(\gamma _{1,i}x+\delta _{1,i}y)\nonumber \\&\quad +\frac{\sum _{i=1}^{m_2}b_{2,i}F(\gamma _{2,i}x+\delta _{2,i}y)}{y-x}+\frac{\sum _{i=1}^{m_3}b_{3,i}\Phi (\gamma _{3,i}x+\delta _{3,i}y)}{(y-x)^2} \end{aligned}$$
(4)

is satisfied for \(x=0,y=1\) and for all continuous and convex functions \(f{:}\,[0,1]\rightarrow \mathbb R,\) then it is satisfied for all \(x,y\in \mathbb R,x<y\) and each continuous and convex function \(f{:}\,[x,y]\rightarrow \mathbb R.\) To see this it is enough to observe that expressions from (4) remain unchanged if we replace \(f{:}\,[x,y]\rightarrow \mathbb R\) by \(\varphi {:}\,[0,1]\rightarrow \mathbb R\) given by \(\varphi (t):=f\left( x+t(y-x)\right) .\)

The simplest expression used to approximate the second-order derivative of f is of the form

$$\begin{aligned} f''\left( \frac{x+y}{2}\right) \approx \frac{f(x)-2f\left( \frac{x+y}{2}\right) +f(y)}{\left( \frac{y-x}{2}\right) ^2} \end{aligned}$$

Remark 2

From numerical analysis it is known that

$$\begin{aligned} f''\left( \frac{x+y}{2}\right) =\frac{f(x)-2f\left( \frac{x+y}{2}\right) +f(y)}{\left( \frac{y-x}{2}\right) ^2}- \frac{\left( \frac{y-x}{2}\right) ^2}{12}f^{(4)}(\xi ). \end{aligned}$$

This means that for convex g and for G such that \(G''=g\) we have

$$\begin{aligned} g\left( \frac{x+y}{2}\right) \le \frac{G(x)-2G\left( \frac{x+y}{2}\right) +G(y)}{\left( \frac{y-x}{2}\right) ^2}. \end{aligned}$$

In this paper we shall obtain some inequalities for convex functions, which do not follow from numerical differentiation results. In order to get such results we shall use Stieltjes integral. In paper [9] it was observed that the classical Hermite–Hadamard inequality (1) easily follows from the following Ohlin lemma

Lemma 1

(Ohlin [7]) Let \(X_1,X_2\) be two random variables such that \({\mathbb E}X_1={\mathbb E}X_2\) and let \(F_1,F_2\) be their distribution functions. If \(F_1,F_2\) satisfy for some \(x_0\) the following inequalities

$$\begin{aligned} F_1(x)\le F_2(x)\;\text {if}\;x<x_0\quad \text {and}\;\;F_1(x)\ge F_2(x)\quad {{ if}}\;x>x_0, \end{aligned}$$

then

$$\begin{aligned} {\mathbb E}f(X_1)\le {\mathbb E}f(X_2) \end{aligned}$$
(5)

for all continuous and convex functions \(f{:}\, \mathbb R\rightarrow \mathbb R.\)

Ohlin lemma was used also in paper [10]. However, in the present approach (similarly as in [8] and [11]) we are going to use a more general result from [5], (see also [6] Theorem 4.2.7). In this theorem we use the notations from [6].

Theorem 1

(Levin, Stechkin) Let \(F_1,F_2:[a,b]\rightarrow \mathbb R\) be two functions with bounded variation such that \(F_1(a)=F_2(a).\) Then, in order that

$$\begin{aligned} \int _a^b f(x)\mathrm{d}F_1(x)\le \int _a^b f(x)\mathrm{d}F_2(x) \end{aligned}$$

for all continuous and convex functions f: \([a,b]\rightarrow \mathbb R\) it is necessary and sufficient that \(F_1\) and \(F_2\) verify the following three conditions:

$$\begin{aligned} F_1(b)= & {} F_2(b), \end{aligned}$$
(6)
$$\begin{aligned} \int _a^x F_1(t)\mathrm{d}t\le & {} \int _a^x F_2(t)\mathrm{d}t,\;x\in (a,b), \end{aligned}$$
(7)

and

$$\begin{aligned} \int _a^b F_1(t)\mathrm{d}t=\int _a^b F_2(t)\mathrm{d}t. \end{aligned}$$
(8)

Remark 3

As it is easy to see, if measures occurring in Ohlin lemma are concentrated on the interval [xy],  then this lemma is an easy consequence of Theorem 1. However, Theorem 1 is more general for two reasons: it allows the functions \(F_1,F_2\) to have more crossing points than one and the functions \(F_1,F_2\) do not have to be cumulative distribution functions. Therefore, we shall use this theorem even if the functions \(F_1,F_2\) have exactly one crossing point.

Let now f: \([x,y]\rightarrow \mathbb R\) be any function and let \(F,\Phi \): \([x,y]\rightarrow \mathbb R\) be such that \(F'=f\) and \(\Phi '=F.\) We need to write the expression

$$\begin{aligned} \frac{\Phi (x)-2\Phi \left( \frac{x+y}{2}\right) +\Phi (y)}{\left( \frac{y-x}{2}\right) ^2} \end{aligned}$$
(9)

in the form

$$\begin{aligned} \int _x^yf\mathrm{d}F_1 \end{aligned}$$

for some \(F_1.\) In the next proposition we show that it is possible – here for the sake of simplicity we shall work on the interval [0, 1].

Proposition 1

Let \(f{:}\, [0,1]\rightarrow \mathbb R\) be any function and let \(\Phi {:}\, [0,1]\rightarrow \mathbb R\) be such that \(\Phi ''=f.\) Then we have

$$\begin{aligned} 4\left( \Phi (0)-2\Phi \left( \frac{1}{2}\right) +\Phi (1)\right) =\int _x^yf\mathrm{d}F_1, \end{aligned}$$

where \(F_1:[0,1]\rightarrow \mathbb R\) is given by

$$\begin{aligned} F_1(t):=\left\{ \begin{array}{ll} 2x^2&{}\quad x\le \frac{1}{2},\\ -2x^2+4x-1&{}\quad x>\frac{1}{2}. \end{array}\right. \end{aligned}$$
(10)

Proof

Let F: \([0,1]\rightarrow \mathbb R\) be such that \(\Phi '=F.\) Now, to prove this proposition it is enough to do the following calculations

$$\begin{aligned} \int _0^1f\mathrm{d}F_1= & {} \int _{0}^\frac{1}{2}4xf(x)\mathrm{d}x+\int _\frac{1}{2}^1(-4x+4)f(x)\mathrm{d}x =2F\left( \frac{1}{2}\right) -0\cdot F(0) \\&-\int _{0}^\frac{1}{2} 4F(x)\mathrm{d}x-0\cdot F(1) -2F\left( \frac{1}{2}\right) +\int _\frac{1}{2}^1 4F(x)\mathrm{d}x\\= & {} 4\Phi (1)-8\Phi \left( \frac{1}{2}\right) +4\Phi (1). \end{aligned}$$

Remark 4

Observe that if \(\Phi \) and f are such as in Proposition 1 then the following equality is satisfied

$$\begin{aligned} \frac{\Phi (x)-2\Phi \left( \frac{x+y}{2}\right) +\Phi (y)}{\left( \frac{y-x}{2}\right) ^2}=\frac{1}{(y-x)^2} \int _x^y\int _x^y f\left( \frac{s+t}{2}\right) \mathrm{d}s\,\mathrm{d}t. \end{aligned}$$

After this observation it turns out that inequalities involving the expression (9) were considered in the paper of Dragomir [3] where (among others) the following inequalities were obtained

$$\begin{aligned} f\left( \frac{x+y}{2}\right) \le \frac{1}{(y-x)^2}\int _x^y\int _x^yf\left( \frac{s+t}{2}\right) \mathrm{d}s\,\mathrm{d}t \le \frac{1}{y-x}\int _x^yf(t)\mathrm{d}t. \end{aligned}$$
(11)

As we already know (Remark 1) the first one of the above inequalities may be obtained using the numerical analysis results.

Now the inequalities from the Dragomir’s paper easily follow from Ohlin lemma, but there are many possibilities of generalizations and modifications of inequalities (11). These generalizations will be discussed in the following chapters.

2 The Symmetric Case

We start with the following remark.

Remark 5

Let \(F_*(t)=at^2+bt+c\) for some \(a,b,c\in \mathbb R, a\ne 0.\) It is impossible to obtain inequalities involving \(\int _x^yf\mathrm{d}F_*\) and any of the expressions: \(\frac{1}{y-x}\int _x^yf(t)\mathrm{d}t,f\left( \frac{x+y}{2}\right) ,\frac{f(x)+f(y)}{2}\) which were satisfied for all convex functions f: \([x,y]\rightarrow \mathbb R.\) Indeed, suppose for example that we have

$$\begin{aligned} \int _x^yf\mathrm{d}F_*\le \frac{1}{y-x}\int _x^yf(t)\mathrm{d}t \end{aligned}$$

for all convex f: \([x,y]\rightarrow \mathbb R.\) Without loss of generality we may assume that \(F_*(x)=0,\) then from Theorem 1 we have \(F_*(y)=1\) Also from Theorem 1 we get

$$\begin{aligned} \int _x^yF_*(t)\mathrm{d}t=\int _x^yF_0\mathrm{d}t, \end{aligned}$$

where \(F_0(t)=\frac{t-x}{y-x},t\in [x,y],\) which is impossible, since \(F_*\) is either strictly convex or concave.

This remark means that in order to get some new inequalities of the Hermite–Hadamard type we have to integrate with respect to functions constructed with use of (at least) two quadratic functions, as it was the case in Proposition 1. Now we may present the main result of this section.

Theorem 2

Let xy be some real numbers such that \(x<y\) and let \(a\in \mathbb R.\) Let \(f,F,\Phi {:}\, [x,y]\rightarrow \mathbb R\) be any functions such that \(F'=f\) and \(\Phi '=F\) and let \(T_af(x,y)\)

$$\begin{aligned} T_af(x,y)=\left( 1-\frac{a}{2}\right) \frac{F(y)-F(x)}{y-x}+2a\frac{\Phi (x)-2\Phi \left( \frac{x+y}{2}\right) +\Phi (x)}{(y-x)^2}. \end{aligned}$$

Then the following inequalities hold for all convex functions f: if \(a\ge 0,\) then

$$\begin{aligned} T_af(x,y)\le \frac{1}{y-x}\int _x^yf(t)\mathrm{d}t, \end{aligned}$$
(12)

if \(a\le 0,\) then

$$\begin{aligned} T_af(x,y)\ge \frac{1}{y-x}\int _x^yf(t)\mathrm{d}t, \end{aligned}$$
(13)

if \(a\le 2,\) then

$$\begin{aligned} f\left( \frac{x+y}{2}\right) \le T_af(x,y), \end{aligned}$$
(14)

if \(a\ge 6,\) then

$$\begin{aligned} T_af(x,y)\le f\left( \frac{x+y}{2}\right) , \end{aligned}$$
(15)

if \(a\ge -6,\) then

$$\begin{aligned} T_af(x,y)\le \frac{f(x)+f(y)}{2}. \end{aligned}$$
(16)

Furthermore,

if \(a\in (2,6),\) then the expressions \(T_af(x,y),\) \(f\left( \frac{x+y}{2}\right) \) are not comparable in the class of convex functions,

if \(a<-6,\) then the expressions \(T_af(x,y),\) \(\frac{f(x)+f(y)}{2}\) are not comparable in the class of convex functions.

Proof

In view of Remark 1 we may restrict ourselves to the case \(x=0,y=1.\) Take \(a\in \mathbb R,\) let f: \([0,1]:\rightarrow \mathbb R\) be any convex function and let \(F,\Phi \): \([0,1]\rightarrow \mathbb R\) be such that \(F'=f,\Phi '=F.\) Define \(F_1:[0,1]\rightarrow \mathbb R\) by the formula

$$\begin{aligned} F_1(t):=\left\{ \begin{array}{ll} at^2+\left( 1-\frac{a}{2}\right) t&{}\quad t<\frac{1}{2},\\ -at^2+\left( 1+\frac{3a}{2}\right) t-\frac{a}{2}&{}\quad t\ge \frac{1}{2}. \end{array}\right. \end{aligned}$$
(17)

First we shall prove that \(T_af(0,1)=\int _0^1f\mathrm{d}F_1.\) Indeed, we have

$$\begin{aligned}&\int _0^1f\mathrm{d}F_1=\int _0^\frac{1}{2}f\mathrm{d}F_1+\int _\frac{1}{2}^1f\mathrm{d}F_1=\int _0^\frac{1}{2}f(t)\left( 2at+1-\frac{a}{2}\right) \mathrm{d}t\\&\qquad +\int _\frac{1}{2}^1 f(t)\left( -2at+1+\frac{3a}{2}\right) \mathrm{d}t=F \left( \frac{1}{2}\right) \left( \frac{a}{2}+1\right) -F \left( 0\right) \left( 1-\frac{a}{2}\right) \\&\qquad -\int _0^\frac{1}{2}F(t)2a\mathrm{d}t+F(1)\left( 1-\frac{a}{2}\right) -F \left( \frac{1}{2}\right) \left( \frac{a}{2}+1\right) +\int _\frac{1}{2}^1F(t)2a\mathrm{d}t\\&\quad =\left( 1-\frac{a}{2}\right) (F(1)-F(0))+2a\biggl (\Phi (0)-2\Phi \left( \frac{1}{2}\right) +\Phi (1)\biggr ) \end{aligned}$$

Now let \(F_2(t)=t,t\in [0,1].\) Then the functions \(F_1,F_2\) have exactly one crossing point (at \(\frac{1}{2}\)) and

$$\begin{aligned} \int _0^1F_1(t)\mathrm{d}t=\frac{1}{2}=\int _0^1t\mathrm{d}t. \end{aligned}$$

Moreover, if \(a>0\) then the function \(F_1\) is convex on the interval \((0,\frac{1}{2})\) and concave on \((\frac{1}{2},1).\) Therefore, it follows from Ohlin lemma that for \(a>0\) we have

$$\begin{aligned} \int _0^1f\mathrm{d}F_1\le \int _0^1f\mathrm{d}F_2, \end{aligned}$$
(18)

which,in view of Remark 1, yields (12), and for \(a<0\) the opposite inequality is satisfied which gives (13).

Take

$$\begin{aligned} F_3(t):=\left\{ \begin{array}{ll} 0&{}\quad t\le \frac{1}{2},\\ 1&{}\quad t>\frac{1}{2}. \end{array}\right. \end{aligned}$$
(19)

It is easy to check that for \(a\le 2\) we have \(F_1(t)\ge F_3(t)\) for \(t\in \left[ 0,\frac{1}{2}\right] ,\) and \(F_1(t)\le F_3(t)\) for \(t\in \left[ \frac{1}{2},1\right] \) and this means that from Ohlin lemma we get (14).

Suppose that \(a>2.\) Then there are three crossing points of functions \(F_1\) and \(F_3\) \(:x_0,\frac{1}{2},x_1,\) where \(x_0\in (0,\frac{1}{2}), x_1\in (\frac{1}{2},1).\) The function

$$\begin{aligned} \varphi (s):=\int _0^sF_3(t)-F_1(t)\mathrm{d}t,\;s\in [0,1] \end{aligned}$$

is increasing on intervals \([0,x_0],[\frac{1}{2},x_1]\) and decreasing on \([x_0,\frac{1}{2}]\) and on \([x_1,1].\) This means that \(\varphi \) takes its absolute minimum at \(\frac{1}{2}.\) As it is easy to calculate \(\varphi \left( \frac{1}{2}\right) \ge 0\) if \(a\ge 6\) which, in view of Theorem 1, gives us (15).

To see that for \(a\in (2,6)\) expressions \(T_af(x,y)\) and \(f\left( \frac{x+y}{2}\right) \) are not comparable in the class of convex functions it is enough to observe that in this case \(\varphi (x_0)>0\) and \(\varphi \left( \frac{1}{2}\right) <0.\)

Now let

$$\begin{aligned} F_4(t):=\left\{ \begin{array}{ll} 0&{}\quad t=0,\\ \frac{1}{2}&{}\quad t\in (0,1),\\ 1&{}\quad t=1. \end{array}\right. \end{aligned}$$
(20)

Similarly as before, if \(a\ge -2\) then we have \(F_1(t)\ge F_4(t)\) for \(t\in \left[ 0,\frac{1}{2}\right] ,\) \(F_1(t)\le F_4(t)\) for \(t\in \left[ \frac{1}{2},1\right] \), i.e., there is only one crossing point of these functions and (16) is obvious. However, for \(a\in (-2,-6]\) we have

$$\begin{aligned} \int _0^\frac{1}{2} F_1(t)\mathrm{d}t\le \frac{1}{4}=\int _0^\frac{1}{2}F_4(t)\mathrm{d}t \end{aligned}$$
(21)

and therefore, in view of Theorem 1, we still have (16). In the case \(a<-6\) inequality (21) is no longer true which means that expressions \(T_af(x,y)\) and \(\frac{f(x)+f(y)}{2}\) are not comparable in the class of convex functions. \(\square \)

This theorem provides us with a full description of inequalities which may be obtained using Stieltjes integral with respect to a function of the form (17). Some of the obtained inequalities are already known. For example from (12) and (13) we obtain the inequality

$$\begin{aligned} \frac{1}{(y-x)^2}\int _x^y\int _x^yf\left( \frac{s+t}{2}\right) \mathrm{d}s\,\mathrm{d}t \le \frac{1}{y-x}\int _x^yf(t)\mathrm{d}t, \end{aligned}$$

whereas from (14) for \(a=2\) we get the inequality

$$\begin{aligned} f\left( \frac{x+y}{2}\right) \le \frac{1}{(y-x)^2}\int _x^y\int _x^yf\left( \frac{s+t}{2}\right) \mathrm{d}s\,\mathrm{d}t. \end{aligned}$$

However, inequalities obtained for “critical” values of a, i.e., \(-6,6.\) are here particularly interesting. In the following corollary we explicitly write these inequalities.

Corollary 1

For every convex function f: \([x,y]\rightarrow \mathbb R\) the following inequalities are satisfied

$$\begin{aligned} 3\frac{1}{(y-x)^2}\int _x^y\int _x^yf\left( \frac{s+t}{2}\right) \mathrm{d}s\mathrm{d}t \le \frac{2}{y-x}\int _x^yf(t)\mathrm{d}t+f\left( \frac{x+y}{2}\right) \end{aligned}$$
(22)

and

$$\begin{aligned} \frac{4}{y-x}\int _x^yf(t)\mathrm{d}t\le 3\frac{1}{(y-x)^2}\int _x^y\int _x^yf\left( \frac{s+t}{2}\right) \mathrm{d}s\mathrm{d}t+\frac{f(x)+f(y)}{2} \end{aligned}$$
(23)

Remark 6

In the paper [4] S.S. Dragomir and I. Gomm obtained the following inequality

$$\begin{aligned} 3\int _x^yf(t)\mathrm{d}t\le 2\frac{1}{(y-x)^2}\int _x^y\int _x^yf\left( \frac{s+t}{2}\right) \mathrm{d}s\mathrm{d}t+\frac{f(x)+f(y)}{2}. \end{aligned}$$
(24)

Inequality (23) from Corollary 1 is stronger than (24). Moreover, as it was observed in Theorem 2 inequalities (22) and (23) cannot be improved, i.e., the inequality

$$\begin{aligned} \frac{1}{y-x}\int _x^yf(t)\mathrm{d}t\le \lambda \frac{1}{(y-x)^2}\int _x^y\int _x^yf\left( \frac{s+t}{2}\right) \mathrm{d}s\mathrm{d}t+(1-\lambda )\frac{f(x)+f(y)}{2} \end{aligned}$$

for \(\lambda >\frac{3}{4}\) is not satisfied by every convex function f: \([x,y]\rightarrow \mathbb R\) and the inequality

$$\begin{aligned} \frac{1}{(y-x)^2}\int _x^y\int _x^yf\left( \frac{s+t}{2}\right) \mathrm{d}s\mathrm{d}t \le \gamma \frac{1}{y-x}\int _x^yf(t)\mathrm{d}t+(1-\gamma )f\left( \frac{x+y}{2}\right) \end{aligned}$$

with \(\gamma <\frac{2}{3}\) is not true for all convex functions f: \([x,y]\rightarrow \mathbb R.\)

In Corollary 1 we obtained inequalities for the triples:

$$\begin{aligned} \frac{1}{(y-x)^2}\int _x^y\int _x^yf\left( \frac{s+t}{2}\right) \mathrm{d}s\mathrm{d}t,\int _x^yf(t)\mathrm{d}t,\frac{f(x)+f(y)}{2} \end{aligned}$$

and

$$\begin{aligned} \frac{1}{(y-x)^2}\int _x^y\int _x^yf\left( \frac{s+t}{2}\right) \mathrm{d}s\mathrm{d}t,\int _x^yf(t)\mathrm{d}t,f\left( \frac{x+y}{2}\right) . \end{aligned}$$

In the next remark we present an analogous result for the expressions

$$\begin{aligned} \frac{1}{(y-x)^2}\int _x^y\int _x^yf\left( \frac{s+t}{2}\right) \mathrm{d}s\mathrm{d}t,\frac{f(x)+f(y)}{2},f\left( \frac{x+y}{2}\right) . \end{aligned}$$

Remark 7

Using the functions: \(F_1\) defined by (10) and \(F_5\) given by

$$\begin{aligned} F_5(t):=\left\{ \begin{array}{ll} 0&{}\quad t=0,\\ \frac{1}{6}&{}\quad t\in \left( 0,\frac{1}{2}\right) \\ \frac{5}{6}&{}\quad t\in \left[ \frac{1}{2},1\right) \\ 1&{}\quad t=1, \end{array}\right. \end{aligned}$$
(25)

we can see that

$$\begin{aligned} \frac{1}{6}f(x)+\frac{2}{3}f\left( \frac{x+y}{2}\right) +\frac{1}{6}f(y)\ge \frac{1}{(y-x)^2}\int _x^y\int _x^yf\left( \frac{s+t}{2}\right) \mathrm{d}s\mathrm{d}t \end{aligned}$$

for all convex functions f: \([x,y]\rightarrow \mathbb R.\)

Moreover, it is easy to see that the above inequality cannot be strengthened which means that the inequality

$$\begin{aligned} af(x)+bf\left( \frac{x+y}{2}\right) +af(y)\ge \frac{1}{(y-x)^2}\int _x^y\int _x^yf\left( \frac{s+t}{2}\right) \mathrm{d}s\mathrm{d}t \end{aligned}$$

where \(a,b\ge 0, 2a+b=1,\) is not satisfied by all convex functions f if \(a<\frac{1}{6}.\)

3 The Non-symmetric Case

In this part of the paper we shall obtain inequalities for \(f(\alpha x+(1-\alpha )y)\) and for \(\alpha f(x)+(1-\alpha ) f(y),\) when \(\alpha \) is not necessarily equal to \(\frac{1}{2}.\)

Now, in contrast to the symmetric case (Remark 5), it is possible to prove inequalities using just one quadratic function but before we do this we shall present a non-symmetric version of Hermite–Hadamard inequality involving only the primitive function of f.

Proposition 2

Let xy be some real numbers such that \(x<y\) and let \(\alpha \in [0,1].\) Let f: \([x,y]\rightarrow \mathbb R,\) be a convex function, let F: \([x,y]\rightarrow \mathbb R\) be such that \(F'=f.\) If \(S^1_\alpha f(x,y)\) is defined by

$$\begin{aligned} S^1_\alpha f(x,y):=\frac{\frac{-\alpha }{1-\alpha }F(x)+\frac{2\alpha -1}{\alpha (1-\alpha )}F(\alpha x+(1-\alpha )y)+ \frac{1-\alpha }{\alpha }F(y)}{y-x} \end{aligned}$$

then the following inequality is satisfied:

$$\begin{aligned} f(\alpha x+(1-\alpha )y)\le S^1_\alpha f(x,y)\le \alpha f(x)+(1-\alpha ) f(y). \end{aligned}$$
(26)

Proof

As usually, the proof will be done on the interval [0, 1]. Define the functions \(F_6,F_7,F_8:[0,1]\rightarrow \mathbb R\) by the following formulas:

$$\begin{aligned} F_6(t):=\left\{ \begin{array}{ll} 0&{}\quad t\le 1-\alpha ,\\ 1&{}\quad t>1-\alpha , \end{array}\right. , \end{aligned}$$
(27)
$$\begin{aligned} F_7(t):=\left\{ \begin{array}{ll} 0&{}\quad t=0,\\ \alpha &{}\quad t\in (0,1)\\ 1&{}\quad t=1, \end{array}\right. , \end{aligned}$$
(28)

and

$$\begin{aligned} F_8(t):=\left\{ \begin{array}{ll} \frac{\alpha }{1-\alpha }t&{}\quad t\in [0,1-\alpha ),\\ \frac{1-\alpha }{\alpha }t+\frac{2\alpha -1}{\alpha }&{}\quad t\in [1-\alpha ,1]. \end{array}\right. , \end{aligned}$$
(29)

We have:

$$\begin{aligned} \int _0^1F_6(t)\mathrm{d}t= & {} \int _0^1F_7(t)\mathrm{d}t=\int _0^1F_8(t)\mathrm{d}t=\alpha ,\\ \int _0^1f\mathrm{d}F_6= & {} f(1-\alpha ),\\ \int _0^1f\mathrm{d}F_7= & {} \alpha f(0)+(1-\alpha )f(1) \end{aligned}$$

and

$$\begin{aligned} \int _0^1f\mathrm{d}F_8=S^1_\alpha f(0,1). \end{aligned}$$

Moreover, both of the pairs \((F_6,F_8)\) and \((F_8,F_7)\) have only one crossing point. Thus it suffices to use Theorem 1 to obtain inequalities (26). \(\square \)

Theorem 3

Let xy be some real numbers such that \(x<y\) and let \(\alpha \in [0,1].\) Let \(f{:}\, [x,y]\rightarrow \mathbb R,\) be a convex functions, let F be such that \(F'=f\) and let \(\Phi \) satisfy \(\Phi '=F.\) If \(S^2_\alpha f(x,y)\) is defined by

$$\begin{aligned} S^2_\alpha f(x,y):=\frac{(4-6\alpha )F(y)+(2-6\alpha )F(x)}{y-x}-\frac{(6-12\alpha )(\Phi (y)-\Phi (x))}{(y-x)^2}, \end{aligned}$$

then the following conditions hold true:

$$\begin{aligned} S^2_\alpha f(x,y)\le \alpha f(x)+(1-\alpha ) f(y), \end{aligned}$$
(30)

if \(\alpha \in \left[ \frac{1}{3},\frac{2}{3}\right] \) then

$$\begin{aligned} S^2_\alpha f(x,y)\ge f(\alpha x+(1-\alpha )y), \end{aligned}$$
(31)

if \(\alpha \in [0,1]\setminus \left[ \frac{1}{3},\frac{2}{3}\right] \) then expressions \(S^2_\alpha f(x,y)\) and \(f(\alpha x+(1-\alpha )y)\) are incomparable in the class of convex functions,

if \(\alpha \in \left( 0,\frac{1}{3}\right] \cup \left[ \frac{2}{3},1\right) \) then

$$\begin{aligned} S^2_\alpha f(x,y)\le S^1_\alpha f(x,y) \end{aligned}$$
(32)

and if \(\alpha \in \left( \frac{1}{3},\frac{1}{2}\right) \cup \left( \frac{1}{2},\frac{2}{3}\right) \) then \(S^1_\alpha f(x,y)\) and \(S^2_\alpha f(x,y)\) are incomparable in the class of convex functions.

Proof

Take

$$\begin{aligned} F_9(t)=(3-6\alpha )t^2+(6\alpha -2)t,\;t\in [0,1] \end{aligned}$$

and let \(F_6,F_7,F_8\) be defined so as in Proposition 2. Then we have

$$\begin{aligned} \int _0^1f\mathrm{d}F_1= & {} \int _0^1\bigl ((6-12\alpha )t+6\alpha -2\bigr )f(t)\mathrm{d}t\nonumber \\= & {} F(1)(6-12\alpha )-\int _0^1(6-12\alpha )F(t)\mathrm{d}t+(6\alpha -2)\bigl (F(1)-F(0)\bigr )\nonumber \\= & {} (4-6\alpha )F(1)+(2-6\alpha )F(0)-(6-12\alpha )\bigl (\Phi (1)-\Phi (0)\bigr ) \end{aligned}$$
(33)

and

$$\begin{aligned} \int _0^1F_9(t)\mathrm{d}t=\int _0^1F_8(t)\mathrm{d}t=\int _0^1F_7(t)\mathrm{d}t=\int _0^1F_6(t)\mathrm{d}t. \end{aligned}$$

It is easy to see that the functions \(F_9,F_7\) have exactly one crossing point; thus, we have

$$\begin{aligned} \int _0^1f\mathrm{d}F_9\le \int _0^1f\mathrm{d}F_7, \end{aligned}$$

which gives us (30).

Now, assume that \(\alpha \in \left[ \frac{1}{3},\frac{2}{3}\right] ,\) then the function \(F_9\) is increasing and, consequently,

$$\begin{aligned} F_9(t)\ge F_6(t),t\in [0,1-\alpha ],\;\;\text {and}\;\;F_9(t)\le F_6(t),t\in (1-\alpha ,1]. \end{aligned}$$

Thus for every convex function f we have

$$\begin{aligned} \int _0^1f\mathrm{d}F_6\le \int _0^1f\mathrm{d}F_9, \end{aligned}$$

which yields (31).

Let now \(\alpha <\frac{1}{3}.\)Then the function \(F_9\) is decreasing on some interval [0, d] and increasing on [d, 1]. Observe that from the equality,

$$\begin{aligned} \int _0^1F_9(t)\mathrm{d}t=\int _0^1F_6(t)\mathrm{d}t \end{aligned}$$

we know that the functions \(F_9,F_6\) must have a crossing point in the interval \((0,1-\alpha ),\) further these functions cross also at the point \(1-\alpha .\) Thus there are two crossing points of \(F_9,F_6,\) in view of Lemma 2 from [8], this means that the expressions

$$\begin{aligned} \int _0^1f\mathrm{d}F_6,\int _0^1f\mathrm{d}F_9 \end{aligned}$$

are incomparable in the class of convex functions (as claimed). The reasoning in the case \(\alpha >\frac{2}{3}\) is similar.

Now we shall prove the inequality (32). If \(\alpha \in \left( 0,\frac{1}{3}\right] \cup [\frac{2}{3},1),\) then \(F_9'(0)\le \frac{\alpha }{1-\alpha }\) and \(F_9'(1)\le \frac{1-\alpha }{\alpha },\) this means that the functions \(F_9\) and \(F_8\) have only one crossing point, and therefore, we have (32).

If on the other hand \(\alpha \in (\frac{1}{3},\frac{1}{2}),\) then \(F_9'(0)<\frac{\alpha }{1-\alpha }\) and \(F_9'(1)>\frac{1-\alpha }{\alpha }\) and, consequently, the functions \(F_9,F_8\) have two crossing points. Similarly as before from Lemma 2, [8] we know that for \(\alpha \in \left( \frac{1}{3},\frac{1}{2}\right) ,\) \(S^1_\alpha f(x,y)\) and \(S^2_\alpha f(x,y)\) are incomparable in the class of convex functions, as claimed. It is easy to see that in the case \(\alpha \in \left( \frac{1}{2},\frac{2}{3}\right) ,\) the functions \(F_9,F_8\) have again two crossing points which finishes the proof.

4 Concluding Remarks and Examples

In the previous sections we made an exhaustive study of two types of inequalities. Now we briefly describe the possible extensions of our results.

Remark 8

In order to obtain inequalities involving expressions of the form \(\frac{a_1\Phi (x)+a_2\Phi (\alpha x+(1-\alpha )y)+a_3\Phi (y)}{(y-x)^2},\) the functions of the form

$$\begin{aligned} F_1(t):=\left\{ \begin{array}{ll} ax^2+(1-\alpha )x&{}\quad t\in [0,\alpha )\\ cx^2+(1-c\alpha -c)x+c\alpha &{}\quad t\in [\alpha ,1] \end{array}\right. , \end{aligned}$$

where \(c=\left( -\frac{\alpha }{1-\alpha }\right) ^3,\) must be used. Since the description of all possible cases in Theorem 2 was already quite complicated, we shall not present these inequalities in details here.

Remark 9

It is possible to use methods developed in this paper to get inequalities involving longer expressions of the form (3). In order to do that it is necessary to use more than two quadratic functions. For example considering the function

$$\begin{aligned} F_1(t):=\left\{ \begin{array}{ll} 4t^2&{}\quad t\le \frac{1}{4},\\ -4t^2+4t-\frac{1}{2}&{}\quad t\in \left( \frac{1}{4},\frac{1}{2}\right] \\ 4t^2-4t+\frac{3}{2}&{}\quad t\in \left( \frac{1}{2},\frac{3}{4}\right] \\ -4t^2+8t-3&{}\quad t>\frac{3}{4} \end{array}\right. \end{aligned}$$
(34)

and using Levin–Stechkin theorem, we get the following inequality

$$\begin{aligned}&\frac{8\Phi (x)-16\Phi \left( \frac{3x+y}{4}\right) +16\Phi \left( \frac{x+y}{2}\right) -16\Phi \left( \frac{x+3y}{4}\right) +8\Phi (y)}{(y-x)^2}\\&\quad \le \frac{1}{y-x}\int _x^yf(t)\mathrm{d}t, \end{aligned}$$

where f: \([x,y]\rightarrow \mathbb R\) is any convex function and \(\Phi ''=f.\)

Remark 10

We have

$$\begin{aligned} \int _0^1 t^2\mathrm{d}F_9(t)=\frac{5}{6}-\alpha \end{aligned}$$

and

$$\begin{aligned} \int _0^1t^2\mathrm{d}F_6(t)=(1-\alpha )^2. \end{aligned}$$

This means that for two values of \(\alpha :\) \(\frac{3-\sqrt{3}}{6}\) and \(\frac{3+\sqrt{3}}{6}\) we have \(\int _0^1 t^2\mathrm{d}F_9(t)=\int _0^1 t^2\mathrm{d}F_6(t).\) Moreover, as it was mentioned in the proof of Theorem 3, the functions \(F_9,F_6\) have in this case two crossing points. This implies (see [2, 9]) that the inequalities:

$$\begin{aligned} S^2_{\frac{3-\sqrt{3}}{6}}(x,y)\ge f\left( \frac{3-\sqrt{3}}{6}x+\frac{3+\sqrt{3}}{6}y\right) \end{aligned}$$

and

$$\begin{aligned} S^2_{\frac{3+\sqrt{3}}{6}}(x,y)\le f\left( \frac{3+\sqrt{3}}{6}x+\frac{3-\sqrt{3}}{6}y\right) \end{aligned}$$

are satisfied by all 2-convex functions f: \([x,y]\rightarrow \mathbb R\)

Remark 11

It is easy to see that all inequalities obtained in this paper in fact characterize convex functions (or 2-convex functions). This is a consequence of results contained in paper [1].