1 Introduction

Throughout this paper I will stand for a nonempty open real interval. In the sequel, the classes of continuous strictly monotone and continuous positive real-valued functions defined on I will be denoted by \(\mathscr {CM}(I)\) and \(\mathscr {CP}(I)\), respectively.

In general, a continuous function \(M:I^2\rightarrow I\) is called a two-variable mean on I if the so-called mean value inequality

$$\begin{aligned} \min (x,y)\le M(x,y)\le \max (x,y) \quad (x,y\in I) \end{aligned}$$
(1)

holds. If, for \(x\ne y\), both of the inequalities in (1) are strict, then M is called a two-variable strict mean. Arithmetic and geometric means are well known instances of strict means on \(\mathbb {R}_+\).

Given a function \(\varphi \in \mathscr {CM}(I)\), the two-variable quasiarithmetic mean generated by \(\varphi \) is the function \(A_\varphi :I^2\rightarrow I\) defined by

$$\begin{aligned} A_\varphi (x,y) :=\varphi ^{-1}\bigg (\frac{\varphi (x)+\varphi (y)}{2}\bigg ) \quad (x,y\in I). \end{aligned}$$

The systematic treatment of these means was first given by Hardy, Littlewood and Pólya [10]. The most basic problem, the characterization of the equality of these means, states that \(A_\varphi \) and \(A_\psi \) are equal to each other if and only if there exist two real constants \(a\ne 0\) and b such that \(\psi =a\varphi +b\).

The characterization of quasiarithmetic means was solved independently by Kolmogorov [13], Nagumo [23], de Finetti [9] for the case when the number of variables is non-fixed. For the two-variable case, Aczél [1,2,3,4] (see also [5]), proved a characterization theorem involving the notion of bisymmetry. This result was extended to the n-variable case by Maksa–Münnich–Mokken [22].

In this paper, we consider the following generalization of quasiarithmetic means, which was introduced in [19] and also investigated in [20]. Given two continuous functions \(f,g:I\rightarrow \mathbb {R}\) with \(g\in \mathscr {CP}(I)\), \(f/g\in \mathscr {CM}(I)\) and a probability measure \(\mu \) on the Borel subsets of [0, 1], the two-variable mean \(M_{f,g;\mu }:I^2\rightarrow I\) is defined by

$$\begin{aligned} M_{f,g;\mu }(x,y) :=\bigg (\frac{f}{g}\bigg )^{-1}\left( \frac{\int _0^1 f\big (tx+(1-t)y\big )d\mu (t)}{\int _0^1 g\big (tx+(1-t)y\big )d\mu (t)}\right) \quad (x,y\in I). \end{aligned}$$
(2)

Means of the above form, will be called generalized quasiarithmetic means.

The first important particular case of this definition is when \(\mu =\frac{\delta _0+\delta _1}{2}\). Here and in the sequel, \(\delta _\tau \) will denote the Dirac measure concentrated at the point \(\tau \in [0,1]\). If \(\varphi \in \mathscr {CM}(I)\), and \(p\in \mathscr {CP}(I)\), then \(M_{\varphi \cdot p,p;\mu }=B_{\varphi ,p}\), which is defined by

$$\begin{aligned} B_{\varphi ,p}(x,y) :=\varphi ^{-1}\bigg (\frac{p(x)\varphi (x)+p(y)\varphi (y)}{p(x)+p(y)}\bigg ) \quad (x,y\in I) \end{aligned}$$

and is called the two-variable Bajraktarević mean (cf. Bajraktarević [6, 7]). By taking \(p=1\), we can see that this class of means includes quasiarithmetic means. Assuming 6 times continuous differentiability, the equality problem of these means was solved by Losonczi [14, 18].

The second important particular case is when \(\mu \) is the Lebesgue measure on [0, 1] and \(\varphi ,\psi :I\rightarrow I\) are continuously differentiable functions with \(\psi '\in \mathscr {CP}(I)\) and \(\varphi '/\psi '\in \mathscr {CM}(I)\). Then, by the fundamental theorem of Calculus, one can easily see that \(M_{\varphi ',\psi ';\mu }=C_{\varphi ,\psi }\), which is defined by

$$\begin{aligned} C_{\varphi ,\psi }(x,y) :={\left\{ \begin{array}{ll} \bigg (\dfrac{\varphi '}{\psi '}\bigg )^{-1} \bigg (\dfrac{\varphi (y)-\varphi (x)}{\psi (y)-\psi (x)}\bigg ) &{}\text{ if } x\ne y\\ x &{}\text{ if } x=y \end{array}\right. } \quad (x,y\in I). \end{aligned}$$

Assuming 7 times continuous differentiability, the equality problem of these means was solved by Losonczi [17].

The equality problem of means in various classes of two-variable means has been solved. We refer here to Losonczi’s works [14,15,16,17,18] where the equality of two-variable means is characterized. The key idea in these papers, under high order differentiability assumptions, is to calculate and then compare the partial derivatives of the means at points of the diagonal. A similar problem, the mixed equality problem of quasiarithmetic and Lagrangian means was solved by Páles [24]. Another mixed equality problem, the equality of two-variable quasiarithmetic and Bajraktarevic means in the symmetric and in the weighted setting was also solved by Daróczy–Maksa–Páles [8] and by Kiss–Páles [11], respectively.

The aim of this paper is to study the equality problem of generalized quasiarithmetic means, i.e., to characterize those pairs of functions (fg) and (FG) for which

$$\begin{aligned} M_{f,g;\mu }(x,y)=M_{F,G;\mu }(x,y) \quad (x,y\in I) \end{aligned}$$
(3)

holds. Due to the complexity of the problem, we will not solve it in its natural generality. In our final main results we consider the cases when the measure \(\mu \) is either of the form \(\frac{\delta _0+\delta _1}{2}\) or is the Lebesgue measure on [0, 1]. For these two cases, we shall need sixth-order differentiability properties of the unknown functions fg and FG.

2 Basic results

Given a Borel probability measure \(\mu \) on the interval [0, 1], we define the first moment and the nth centralized moment of \(\mu \) by

$$\begin{aligned} \widehat{\mu }_1:=\int _0^1 t d\mu (t) \quad \text{ and }\quad \mu _n:=\int _0^1 (t-\widehat{\mu }_1)^n d\mu (t) \quad (n\in \mathbb {N}\cup \{0\}). \end{aligned}$$

Clearly, \(\mu _0=1\) and \(\mu _1=0\). It is also obvious that \(\mu _{2n}\ge 0\) and equality can hold if and only if \(\mu \) is the Dirac measure \(\delta _{\widehat{\mu }_1}\).

In order to describe the regularity conditions related to the two unknown functions fg generating the mean \(M_{f,g;\mu }\), we introduce some notations. The class \(\mathscr {C}_0(I)\) consists of all pairs (fg) of continuous functions \(f,g:I\rightarrow \mathbb {R}\) such that \(g\in \mathscr {CP}(I)\) and \(f/g\in \mathscr {CM}(I)\). For \(n\in \mathbb {N}\), we say that the pair (fg) is in the class \(\mathscr {C}_n(I)\) if fg are n-times continuously differentiable functions such that \(g\in \mathscr {CP}(I)\) and the function \(f'g-fg'\) does not vanish anywhere on I. Obviously, this latter condition implies that f/g is strictly monotone, i.e., \(f/g\in \mathscr {CM}(I)\).

In what follows, the symbol \(f^{(i)}\) will stand for the ith derivative of the function \(f:I\rightarrow \mathbb {R}\), where \(i\in \mathbb {N}\cup \{0\}\). In the particular cases \(i\in \{0,1,2\}\), we may use the alternative notations \(f,f',f''\), respectively. For \((f,g)\in \mathscr {C}_2(I)\), we also introduce the notation

$$\begin{aligned} \Phi _{f,g}:=\frac{W_{f,g}^{2,0}}{W_{f,g}^{1,0}}\quad \text{ and }\quad \Psi _{f,g}:=-\frac{W_{f,g}^{2,1}}{W_{f,g}^{1,0}}, \end{aligned}$$

where the (ij)-order Wronskian operator \(W^{i,j}\) is defined in terms of the ith and jth derivatives by

$$\begin{aligned} W_{f,g}^{i,j}:=\begin{vmatrix}f^{(i)}&f^{(j)}\\g^{(i)}&g^{(j)}\end{vmatrix}. \end{aligned}$$

Our first result establishes a formula for the higher-order derivatives of f and g as well as for their (ij)-order Wronskian in terms of the functions \(\Phi _{f,g}\) and \(\Psi _{f,g}\).

Lemma 1

Let \((f,g)\in \mathscr {C}_n(I)\), where \(n\ge 2\) and define two sequences \((\varphi _i)\) and \((\psi _i)\) by the recursions

$$\begin{aligned} \begin{aligned} \varphi _0&:=0,&\quad \varphi _{i+1}&:=\varphi '_i+\varphi _i\Phi _{f,g}+\psi _i&\quad (i&\in \{0,\dots ,n-1\}),\\ \psi _0&:=1,&\psi _{i+1}&:=\varphi _i\Psi _{f,g}+\psi '_i&\quad (i&\in \{0,\dots ,n-1\}). \end{aligned} \end{aligned}$$
(4)

Then, for \(h\in \{f,g\}\), that is, for \(h=f\) and \(h=g\),

$$\begin{aligned} h^{(i)}=\varphi _ih'+\psi _ih \quad (i\in \{0,\dots ,n\}) \end{aligned}$$
(5)

and

$$\begin{aligned} W_{f,g}^{i,j}=\begin{vmatrix}\varphi _i&\varphi _j\\ \psi _i&\psi _j\end{vmatrix} \cdot W_{f,g}^{1,0}\quad (i,j\in \{0,\dots ,n\}). \end{aligned}$$
(6)

In particular,

$$\begin{aligned} W_{f,g}^{i,0}=\varphi _i W_{f,g}^{1,0},\quad W_{f,g}^{i,1}=-\psi _i W_{f,g}^{1,0} \quad (i\in \{0,\dots ,n\}). \end{aligned}$$
(7)

Proof

Consider the second-order linear differential equation

$$\begin{aligned} \begin{vmatrix}f''&f'&f\\g''&g'&g\\h''&h'&h\end{vmatrix} =W_{f,g}^{1,0}h''-W_{f,g}^{2,0}h'+W_{f,g}^{2,1}h=0 \end{aligned}$$
(8)

for the unknown function \(h:I\rightarrow \mathbb {R}\). Obviously, (8) is satisfied for \(h\in \{f,g\}\). We can see that (8) is equivalent to the equation

$$\begin{aligned} h''=\Phi _{f,g}h'+\Psi _{f,g}h, \end{aligned}$$
(9)

i.e., \(h\in \{f,g\}\) is also a solution of (9). (Observe that (9) is a particular case of (5) when \(i=2\).)

The equality (5) trivially holds if \(i=0\). Assume that (5) has been proved for some \(i\in \{0,\dots ,n-1\}\). Then, using (5), (9), and (4), we get

$$\begin{aligned} h^{(i+1)}= & {} \big (h^{(i)}\big )'=\big (\varphi _ih'+\psi _ih\big )' =\varphi _ih''+\varphi '_ih'+\psi _ih'+\psi '_ih\\= & {} \varphi _i(\Phi _{f,g}h'+\Psi _{f,g}h)+\varphi '_ih'+\psi _ih'+\psi '_ih =\varphi _{i+1}h'+\psi _{i+1}h, \end{aligned}$$

which completes the proof of the induction.

The equality in (6) follows from (5). Indeed, applying (5) for \(h=f\) and \(h=g\), we obtain

$$\begin{aligned} \begin{aligned} W_{f,g}^{i,j}&=\begin{vmatrix}f^{(i)}&f^{(j)}\\g^{(i)}&g^{(j)}\end{vmatrix} =\begin{vmatrix}\varphi _if'+\psi _if&\varphi _jf'+\psi _jf\\ \varphi _ig'+\psi _ig&\varphi _jg'+\psi _jg\end{vmatrix}\\&=\begin{vmatrix}f'&f\\g'&g\end{vmatrix}\cdot \begin{vmatrix}\varphi _i&\varphi _j\\ \psi _i&\psi _j\end{vmatrix} =\begin{vmatrix}\varphi _i&\varphi _j\\ \psi _i&\psi _j\end{vmatrix}\cdot W_{f,g}^{1,0}. \end{aligned} \end{aligned}$$

Hence, the proof of the lemma is complete. \(\square \)

In the sequel we shall need the first few members of the sequences \((\varphi _i)\) and \((\psi _i)\) constructed in (4). For the sake of convenience, we list their first few members for small i:

$$\begin{aligned} \begin{aligned} \varphi _1&=1,&\quad \varphi _2&=\Phi _{f,g},&\quad \varphi _3&=\Phi '_{f,g}+\Phi ^2_{f,g}+\Psi _{f,g},\\ \psi _1&=0,&\psi _2&=\Psi _{f,g},&\psi _3&=\Phi _{f,g}\Psi _{f,g}+\Psi '_{f,g}, \end{aligned} \end{aligned}$$

and

$$\begin{aligned} \begin{aligned} \varphi _4&=\Phi ^{(2)}_{f,g}+3\Phi '_{f,g}\Phi _{f,g}+\Phi ^3_{f,g} +2\Phi _{f,g}\Psi _{f,g}+2\Psi '_{f,g},\\ \psi _4&=\big (2\Phi '_{f,g}+\Phi ^2_{f,g}\big )\Psi _{f,g} +\Phi _{f,g}\Psi '_{f,g}+\Psi ^2_{f,g}+\Psi ^{(2)}_{f,g},\\ \varphi _5&=\Phi ^{(3)}_{f,g}+4\Phi ^{(2)}_{f,g}\Phi _{f,g}+3{\Phi '}^2_{f,g} +6\Phi '_{f,g}\Phi ^2_{f,g}+\Phi ^4_{f,g}\\&\quad +\big (4\Phi '_{f,g}+3\Phi ^2_{f,g}\big )\Psi _{f,g} +5\Phi _{f,g}\Psi '_{f,g}+\Psi ^2_{f,g}+3\Psi ^{(2)}_{f,g},&\\ \psi _5&=2\Phi _{f,g}\Psi ^2_{f,g} +\big (3\Phi ^{(2)}_{f,g}+5\Phi '_{f,g}\Phi _{f,g}+\Phi ^3_{f,g}\big )\Psi _{f,g} \\&\quad +\big (3\Phi '_{f,g}+\Phi ^2_{f,g}\big )\Psi '_{f,g} +\Phi _{f,g}\Psi ^{(2)}_{f,g}+4\Psi '_{f,g}\Psi _{f,g}+\Psi ^{(3)}_{f,g},\\ \varphi _6&=\Phi ^{(4)}_{f,g}+5\Phi ^{(3)}_{f,g}\Phi _{f,g}+10\Phi ^{(2)}_{f,g}\Phi '_{f,g} +10\Phi ^{(2)}_{f,g}\Phi ^2_{f,g}+10\Phi '_{f,g}\Phi ^3_{f,g} \\&\quad +15{\Phi '}^2_{f,g}\Phi _{f,g}+\Phi ^5_{f,g}+3\Phi _{f,g}\Psi ^2_{f,g} +\big (7\Phi ^{(2)}_{f,g}\!+\!15\Phi '_{f,g}\Phi _{f,g}\!+\!4\Phi ^3_{f,g}\big )\Psi _{f,g} \\&\quad +\big (12\Phi '_{f,g}+9\Phi ^2_{f,g}\big )\Psi '_{f,g}+9\Phi _{f,g}\Psi ^{(2)}_{f,g} +6\Psi '_{f,g}\Psi _{f,g}+4\Psi ^{(3)}_{f,g},\\ \psi _6&=\big (6\Phi '_{f,g}+3\Phi ^2_{f,g}\big )\Psi ^2_{f,g} +\big (4\Phi ^{(3)}_{f,g}+9\Phi ^{(2)}_{f,g}\Phi _{f,g}+8{\Phi '}^2_{f,g} +9\Phi '_{f,g}\Phi ^2_{f,g} \\&\quad +\Phi ^4_{f,g}\big )\Psi _{f,g}+\big (4\Phi '_{f,g}+\Phi ^2_{f,g}\big )\Psi ^{(2)}_{f,g}+\big (6\Phi ^{(2)}_{f,g}+7\Phi '_{f,g}\Phi _{f,g} +\Phi ^3_{f,g}\big )\Psi '_{f,g} \\&\quad +\Phi _{f,g}\big (\Psi ^{(3)}_{f,g}+9\Psi '_{f,g}\Psi _{f,g}\big ) +\Psi ^3_{f,g}+4{\Psi '}^2_{f,g}+7\Psi ^{(2)}_{f,g}\Psi _{f,g}+\Psi ^{(4)}_{f,g}. \end{aligned} \end{aligned}$$

We say that two pairs of functions \((f,g),(F,G)\in \mathscr {C}_0(I)\) are equivalent, denoted \((f,g)\sim (F,G)\), if there exists a nonsingular \(2\times 2\)-matrix A (with real entries) such that

$$\begin{aligned} \left( {\begin{array}{c}F\\ G\end{array}}\right) =A\left( {\begin{array}{c}f\\ g\end{array}}\right) . \end{aligned}$$
(10)

In other words, \((f,g)\sim (F,G)\) holds if there exist four real constants abcd with \(ad\ne bc\) such that \(F=af+bg\) and \(G=cf+dg\).

The remaining auxiliary results of this section were obtained in [19] and [25]. The property of equivalence in the class \(\mathscr {C}_2(I)\) is completely characterized by the following result.

Lemma 2

[25, Theorem 2.1] Let \((f,g),(F,G)\in \mathscr {C}_2(I)\). Then \((f,g)\sim (F,G)\) holds if and only if

$$\begin{aligned} \Phi _{f,g}=\Phi _{F,G}\quad \text{ and }\quad \Psi _{f,g}=\Psi _{F,G}. \end{aligned}$$
(11)

The next result characterizes the mean \(M_{f,g;\mu }\) via an implicit equation.

Lemma 3

([19, Lemma 1], [25, Lemma 1.1]) Let \((f,g)\in \mathscr {C}_0(I)\) and \(\mu \) be a Borel probability measure on [0, 1]. Then for all \(x,y\in I\), the value \(z=M_{f,g;\mu }(x,y)\) is the unique solution of the equation

$$\begin{aligned} \begin{aligned} \int _0^1 \begin{vmatrix}f\big (tx+(1-t)y\big )&f(z)\\ g\big (tx+(1-t)y\big )&g(z)\end{vmatrix}d\mu (t)=0. \end{aligned} \end{aligned}$$
(12)

As a consequence, the next lemma shows that equivalent pairs of generating functions determine identical means.

Lemma 4

[19, 25] Let \((f,g),(F,G)\in \mathscr {C}_0(I)\) and \(\mu \) be a Borel probability measure on [0, 1]. Assume that \((f,g)\sim (F,G)\). Then \(M_{F,G;\mu }=M_{f,g;\mu }\).

3 Higher-order directional derivatives of generalized quasiarithmetic means

Lemma 5

Let \(n\in \mathbb {N}\), \((f,g)\in \mathscr {C}_n(I)\) and \(\mu \) be a Borel probability measure on [0, 1]. Then \(M_{f,g;\mu }\) is n-times continuously differentiable on \(I\times I\).

Proof

The proof of this statement requires the use of standard calculus rules and a standard argument. One can verify that the inverse of f/g and the maps \((x,y)\mapsto \int _0^1 h(tx+(1-t)y)d\mu (t)\) (where \(h\in \{f,g\}\)) are n-times differentiable on (f/g)(I) and \(I^2\), respectively. \(\square \)

In what follows, we deduce explicit formulae for the high-order directional derivatives of \(M_{f,g;\mu }\) at the diagonal points of the Cartesian product \(I\times I\). Given \((f,g)\in \mathscr {C}_0(I)\) and a fixed element \(x\in I\), define the function \(m_x=m_{x;f,g;\mu }\) in a neigborhood of zero by

$$\begin{aligned} m_x(u):=m_{x;f,g;\mu }(u):=M_{f,g;\mu }\big (x+(1-\hat{\mu }_1)u,x-\hat{\mu }_1 u\big ), \end{aligned}$$
(13)

where \(\hat{\mu }_1\) denotes the first moment of the measure \(\mu \).

Lemma 6

Let \(n\in \mathbb {N}\), \((f,g)\in \mathscr {C}_n(I)\), and \(\mu \) be a Borel probability measure on [0, 1]. Then, for fixed \(x\in I\), the function \(m_x\) defined by (13) is n-times continuously differentiable at the origin, \(m_x(0)=x\) and in the cases \(n=1,2,3,4,5,6\), we have

$$\begin{aligned} m_x'(0)&=0,\\ m_x^{(2)}(0)&=\mu _2\Phi _{f,g}(x),\\ m_x^{(3)}(0)&=\mu _3\big (\Phi '_{f,g}+\Phi ^2_{f,g}+\Psi _{f,g}\big )(x),\\ m_x^{(4)}(0)&=-3\mu _2^2\big (\Phi _{f,g}^3+2\Phi _{f,g}\Psi _{f,g}\big )(x)\\&\quad +\mu _4\big (\Phi ^{(2)}_{f,g}+3\Phi '_{f,g}\Phi _{f,g}+\Phi ^3_{f,g} +2\Phi _{f,g}\Psi _{f,g}+2\Psi '_{f,g}\big )(x),\\ m_x^{(5)}(0)&=-10\mu _3\mu _2\big (\Phi _{f,g}^2\Phi '_{f,g}+\Phi _{f,g}^4+(\Phi '_{f,g}+3\Phi _{f,g}^2+\Psi _{f,g})\Psi _{f,g}\\&\quad +\Phi _{f,g}\Psi '_{f,g}\big )(x)+\mu _5\big (\Phi ^{(3)}_{f,g}+4\Phi ^{(2)}_{f,g}\Phi _{f,g}+3{\Phi '}^2_{f,g} +6\Phi '_{f,g}\Phi ^2_{f,g}\\&\quad +\Phi ^4_{f,g}+\big (4\Phi '_{f,g}+3\Phi ^2_{f,g}\big )\Psi _{f,g} +\Psi ^2_{f,g}+5\Phi _{f,g}\Psi '_{f,g}+3\Psi ^{(2)}_{f,g}\big )(x), \end{aligned}$$

and

$$\begin{aligned} \begin{aligned} m_x^{(6)}(0)&=+15\mu _2^3\big (-\Phi '_{f,g}\Phi ^3_{f,g}+2\Phi _{f,g}^5+8\Phi ^3_{f,g}\Psi _{f,g}+6\Phi _{f,g}\Psi ^2_{f,g}\big )(x)\\&\quad -10\mu _3^2( {\Phi '}^2_{f,g}\Phi _{f,g}+2\Phi '_{f,g}\Phi _{f,g}^3+\Phi _{f,g}^5+3\Phi _{f,g}\Psi _{f,g}^2 \\&\quad +4\big (\Phi '_{f,g}\Phi _{f,g}+\Phi _{f,g}^3\big )\Psi _{f,g}+2\big (\Phi '_{f,g}+\Phi _{f,g}^2+\Psi _{f,g}\big )\Psi '_{f,g}\big )(x)\\&\quad -15\mu _2\mu _4\big (\Phi ^{(2)}_{f,g}(\Phi ^2_{f,g}+\Psi _{f,g})+(3\Phi '_{f,g}+4\Psi _{f,g})\Phi ^3_{f,g}+3\Phi _{f,g}\Psi _{f,g}^2 \\&\quad +\Phi ^5_{f,g}+5\Phi '_{f,g}\Phi _{f,g}\Psi _{f,g}+(3\Phi ^2_{f,g}+2\Psi _{f,g})\Psi '_{f,g}+\Phi _{f,g}\Psi ^{(2)}_{f,g} \big )(x)\\&\quad +\mu _6\big (\Phi ^{(4)}_{f,g}+5\Phi ^{(3)}_{f,g}\Phi _{f,g}+10\Phi ^{(2)}_{f,g}(\Phi '_{f,g}+\Phi ^2_{f,g})+10\Phi '_{f,g}\Phi ^3_{f,g}+\Phi ^5_{f,g} \\&\quad +15{\Phi '}^2_{f,g}\Phi _{f,g} +3\Phi _{f,g}\Psi ^2_{f,g}+\big (7\Phi ^{(2)}_{f,g}+15\Phi '_{f,g}\Phi _{f,g}+4\Phi ^3_{f,g}\big )\Psi _{f,g} \\&\quad +\big (12\Phi '_{f,g}+9\Phi ^2_{f,g}+6\Psi _{f,g}\big )\Psi '_{f,g} +9\Phi _{f,g}\Psi ^{(2)}_{f,g}+4\Psi ^{(3)}_{f,g}\big )(x). \end{aligned} \end{aligned}$$

Proof

Let \(x\in I\) be fixed. Then the n-times continuous differentiability of \(m_x\) at the origin is a consequence of Lemma 5. By Lemma 3, for small u, we have the equality

$$\begin{aligned} \int _0^1 \begin{vmatrix}f\big (x+(t-\hat{\mu }_1)u\big )&(f\circ m_x)(u)\\ g\big (x+(t-\hat{\mu }_1)u\big )&(g\circ m_x)(u)\end{vmatrix}d\mu (t)=0. \end{aligned}$$

Differentiating this equality n-times with respect to u and using Leibniz’s rule, we obtain

$$\begin{aligned} \sum _{i=0}^n\left( {\begin{array}{c}n\\ i\end{array}}\right) \int _0^1 \begin{vmatrix}f^{(i)}\big (x+(t-\hat{\mu }_1)u\big )&(f\circ m_x)^{(n-i)}(u)\\ g^{(i)}\big (x+(t-\hat{\mu }_1)u\big )&(g\circ m_x)^{(n-i)}(u)\end{vmatrix} (t-\hat{\mu }_1)^id\mu (t)=0. \end{aligned}$$

Now the substitution \(u=0\) implies

$$\begin{aligned} \sum _{i=0}^n\left( {\begin{array}{c}n\\ i\end{array}}\right) \mu _i\begin{vmatrix}f^{(i)}(x)&(f\circ m_x)^{(n-i)}(0)\\ g^{(i)}(x)&(g\circ m_x)^{(n-i)}(0)\end{vmatrix}=0. \end{aligned}$$
(14)

The equality \(m_x(0)=x\) follows from the definition of \(m_x\). Since \(\mu _0=1\), \(\mu _1=0\), in the case \(n=1\), (14) reduces to

$$\begin{aligned} 0=\begin{vmatrix}f(x)&(f\circ m_x)'(0)\\g(x)&(g\circ m_x)'(0)\end{vmatrix} =\begin{vmatrix}f(x)&f'(x)\\g(x)&g'(x)\end{vmatrix}m_x'(0), \end{aligned}$$

which yields \(m_x'(0)=0\).

To elaborate the condition (14) in the cases \(n=2,3,4,5,6\), we shall need the following computational rules for the functions \(h\in \{f,g\}\),

$$\begin{aligned} (h\circ m_x)'&=(h'\circ m_x)m_x',\\ (h\circ m_x)^{(2)}&=(h^{(2)}\circ m_x)(m_x')^2+(h'\circ m_x)m_x^{(2)},\\ (h\circ m_x)^{(3)}&=(h^{(3)}\circ m_x)(m_x')^3+3(h^{(2)}\circ m_x)m_x^{(2)}m_x'+(h'\circ m_x)m_x^{(3)},\\ (h\circ m_x)^{(4)}&=(h^{(4)}\circ m_x)(m_x')^4+6(h^{(3)}\circ m_x)m_x^{(2)}(m_x')^2 \\&\quad +(h^{(2)}\circ m_x)\big (4m_x^{(3)}m_x'+3(m_x^{(2)})^2\big )+(h'\circ m_x)m_x^{(4)},\\ (h\circ m_x)^{(5)}&=(h^{(5)}\circ m_x)(m_x')^5+10(h^{(4)}\circ m_x)m_x^{(2)}(m_x')^3 \\&\quad +(h^{(3)}\circ m_x)\big (10m_x^{(3)}(m_x')^2+15(m_x^{(2)})^2m_x'\big )\\&\quad +(h^{(2)}\circ m_x)\big (5m_x^{(4)}m_x'+10m_x^{(3)}m_x^{(2)}\big )+(h'\circ m_x)m_x^{(5)},\\ (h\circ m_x)^{(6)}&=(h^{(6)}\circ m_x)(m_x')^6+15(h^{(5)}\circ m_x)m_x^{(2)}(m_x')^4 \\&\quad +(h^{(4)}\circ m_x)\big (20m_x^{(3)}(m_x')^3+45(m_x^{(2)})^2(m_x')^2\big )\\&\quad +(h^{(3)}\circ m_x)\big (15m_x^{(4)}(m_x')^2+60m_x^{(3)}m_x^{(2)}m_x'+15(m_x^{(2)})^3\big )\\&\quad +(h^{(2)}\circ m_x)\big (6m_x^{(5)}m_x'+15m_x^{(4)}m_x^{(2)}+10(m_x^{(3)})^2\big )\\ {}&\quad +(h'\circ m_x)m_x^{(6)}. \end{aligned}$$

Hence, using \(m_x(0)=x\) and \(m_x'(0)=0\), it follows that

$$\begin{aligned} \begin{aligned} (h\circ m_x)'(0)&=0,\\ (h\circ m_x)^{(2)}(0)&=h'(x)m_x^{(2)}(0),\\ (h\circ m_x)^{(3)}(0)&=h'(x)m_x^{(3)}(0),\\ (h\circ m_x)^{(4)}(0)&=h'(x)m_x^{(4)}(0)+3h^{(2)}(x)(m_x^{(2)}(0))^2,\\ (h\circ m_x)^{(5)}(0)&=h'(x)m_x^{(5)}(0)+10h^{(2)}(x)m_x^{(3)}(0)m_x^{(2)}(0),\\ (h\circ m_x)^{(6)}(0)&=h'(x)m_x^{(6)}(0)+h^{(2)}(x)\big (15m_x^{(4)}(0)m_x^{(2)}(0)\\ {}&\quad +10(m_x^{(3)}(0))^2\big )+15h^{(3)}(x)(m_x^{(2)}(0))^3. \end{aligned} \end{aligned}$$
(15)

In the case \(n=2\), using \(\mu _0=1\) and \(\mu _1=0\), Eq. (14) yields

$$\begin{aligned} \begin{vmatrix}f(x)&(f\circ m_x)^{(2)}(0)\\ g(x)&(g\circ m_x)^{(2)}(0)\end{vmatrix} +\mu _2\begin{vmatrix}f^{(2)}(x)&(f\circ m_x)(0)\\ g^{(2)}(x)&(g\circ m_x)(0)\end{vmatrix} =0, \end{aligned}$$

which, in view of the identities (15), reduces to the equality

$$\begin{aligned} -W_{f,g}^{1,0}(x)m_x^{(2)}(0)+\mu _2W_{f,g}^{2,0}(x)=0, \end{aligned}$$

proving \(m_x^{(2)}(0)=\mu _2\Phi _{f,g}(x)\).

In the case \(n=3\), using \(\mu _0=1\), \(\mu _1=0\), and \(m'(0)=0\), Eq. (14) gives

$$\begin{aligned} \begin{vmatrix}f(x)&(f\circ m_x)^{(3)}(0)\\ g(x)&(g\circ m_x)^{(3)}(0)\end{vmatrix} +\mu _3\begin{vmatrix}f^{(3)}(x)&(f\circ m_x)(0)\\ g^{(3)}(x)&(g\circ m_x)(0)\end{vmatrix} =0, \end{aligned}$$

which, applying the third identity in (15) for \(h=f\) and \(h=g\), implies

$$\begin{aligned} -W_{f,g}^{1,0}(x)m_x^{(3)}(0)+\mu _3W_{f,g}^{3,0}(x)=0. \end{aligned}$$

Hence, using (7) for \(i=3\), we get

$$\begin{aligned} m_x^{(3)}(0)=\mu _3\frac{W_{f,g}^{3,0}}{W_{f,g}^{1,0}}(x) =\mu _3\varphi _3(x)=\mu _3\big (\Phi '_{f,g}+\Phi ^2_{f,g}+\Psi _{f,g}\big )(x). \end{aligned}$$

In the case \(n=4\), using \(\mu _0=1\), \(\mu _1=0\) and \(m'(0)=0\), Eq. (14) results in

$$\begin{aligned} \begin{vmatrix}f(x)&(f\circ m_x)^{(4)}(0)\\ g(x)&(g\circ m_x)^{(4)}(0)\end{vmatrix}&+6\mu _2\begin{vmatrix}f^{(2)}(x)&(f\circ m_x)^{(2)}(0)\\ g^{(2)}(x)&(g\circ m_x)^{(2)}(0)\end{vmatrix}\\&+\mu _4\begin{vmatrix}f^{(4)}(x)&(f\circ m_x)(0)\\ g^{(4)}(x)&(g\circ m_x)(0)\end{vmatrix} =0, \end{aligned}$$

which, by the second and fourth identities in (15), implies

$$\begin{aligned}&-W_{f,g}^{1,0}(x)m_x^{(4)}(0)-3W_{f,g}^{2,0}(x)(m_x^{(2)}(0))^2 \\&\quad +6\mu _2W_{f,g}^{2,1}(x)m_x^{(2)}(0)+\mu _4W_{f,g}^{4,0}(x)=0. \end{aligned}$$

Thus, applying (7) and the formulae for \(m_x^{(2)}(0)\), \(\varphi _2,\varphi _4\), and \(\psi _2\), we obtain

$$\begin{aligned} m_x^{(4)}(0)&=-3\varphi _2(x)(m_x^{(2)}(0))^2-6\mu _2\psi _2(x)m_x^{(2)}(0)+\mu _4\varphi _4(x)\\&=-3\mu _2^2\big (\Phi _{f,g}^3+2\Phi _{f,g}\Psi _{f,g}\big )(x) \\&\quad +\mu _4\big (\Phi ^{(2)}_{f,g}+3\Phi '_{f,g}\Phi _{f,g}+\Phi ^3_{f,g}+2\Phi _{f,g}\Psi _{f,g}+2\Psi '_{f,g}\big )(x). \end{aligned}$$

In the case \(n=5\), using \(\mu _0=1\), \(\mu _1=0\) and \(m'(0)=0\), Eq. (14) results in

$$\begin{aligned} \begin{aligned}&\begin{vmatrix} f(x)&(f\circ m_x)^{(5)}(0)\\ g(x)&(g\circ m_x)^{(5)}(0)\end{vmatrix} +10\mu _2\begin{vmatrix}f^{(2)}(x)&(f\circ m_x)^{(3)}(0)\\ g^{(2)}(x)&(g\circ m_x)^{(3)}(0)\end{vmatrix}\\&\quad +10\mu _3\begin{vmatrix}f^{(3)}(x)&(f\circ m_x)^{(2)}(0)\\ g^{(3)}(x)&(g\circ m_x)^{(2)}(0)\end{vmatrix} +\mu _5\begin{vmatrix}f^{(5)}(x)&(f\circ m_x)(0)\\ g^{(5)}(x)&(g\circ m_x)(0)\end{vmatrix} =0, \end{aligned} \end{aligned}$$

which, by the identities (15), implies

$$\begin{aligned}&-W_{f,g}^{1,0}(x)m_x^{(5)}(0)-10W_{f,g}^{2,0}(x)m_x^{(3)}(0)m_x^{(2)}(0) +10\mu _2W_{f,g}^{2,1}(x)m_x^{(3)}(0)\\&\quad +10\mu _3W_{f,g}^{3,1}(x)m_x^{(2)}(0)+\mu _5W_{f,g}^{5,0}(x)=0. \end{aligned}$$

Thus, applying (7), the above equality yields that

$$\begin{aligned} m_x^{(5)}(0)&=-10\varphi _2(x)m_x^{(3)}(0)m_x^{(2)}(0)-10\mu _2\psi _2(x)m_x^{(3)}(0) \\&-10\mu _3\psi _3(x)m_x^{(2)}(0)+\mu _5\varphi _5(x). \end{aligned}$$

Using the explicit formulae for \(m_x^{(2)}(0)\), \(m_x^{(3)}(0)\), \(\varphi _2,\varphi _5\), and \(\psi _2,\psi _3\), this expression simplifies to the required statement.

Finally, in the case \(n=6\), using \(\mu _0=1\), \(\mu _1=0\) and \(m'(0)=0\), Eq. (14) results in

$$\begin{aligned} \begin{aligned}&\begin{vmatrix}f(x)&(f\circ m_x)^{(6)}(0)\\ g(x)&(g\circ m_x)^{(6)}(0)\end{vmatrix} +15\mu _2\begin{vmatrix}f^{(2)}(x)&(f\circ m_x)^{(4)}(0)\\ g^{(2)}(x)&(g\circ m_x)^{(4)}(0)\end{vmatrix} \\&\quad +20\mu _3\begin{vmatrix}f^{(3)}(x)&(f\circ m_x)^{(3)}(0)\\ g^{(3)}(x)&(g\circ m_x)^{(3)}(0)\end{vmatrix} +15\mu _4\begin{vmatrix}f^{(4)}(x)&(f\circ m_x)^{(2)}(0)\\ g^{(4)}(x)&(g\circ m_x)^{(2)}(0)\end{vmatrix} \\&\quad +\mu _6\begin{vmatrix}f^{(6)}(x)&(f\circ m_x)(0)\\ g^{(6)}(x)&(g\circ m_x)(0)\end{vmatrix} =0, \end{aligned} \end{aligned}$$

which, using the identities (15), implies

$$\begin{aligned}&-W_{f,g}^{1,0}(x)m_x^{(6)}(0)-W_{f,g}^{2,0}(x)\big (15m_x^{(4)}(0)m_x^{(2)}(0) +10(m_x^{(3)}(0))^2\big )\\&\quad -15W_{f,g}^{3,0}(x)(m_x^{(2)}(0))^3 +15\mu _2W_{f,g}^{2,1}(x)m_x^{(4)}(0)+20\mu _3W_{f,g}^{3,1}(x)m_x^{(3)}(0) \\&\quad +15\mu _4W_{f,g}^{4,1}(x)m_x^{(2)}(0)+\mu _6W_{f,g}^{6,0}(x)=0. \end{aligned}$$

Thus, applying (7), we get

$$\begin{aligned}&m_x^{(6)}(0) =-\varphi _2(x)\big (15m_x^{(4)}(0)m_x^{(2)}(0)+10(m_x^{(3)}(0))^2\big )-15\varphi _3(x)(m_x^{(2)}(0))^3\\&\quad -15\mu _2\psi _2(x)m_x^{(4)}(0)-20\mu _3\psi _3(x)m_x^{(3)}(0) -15\mu _4\psi _4(x)m_x^{(2)}(0)+\mu _6\varphi _6(x). \end{aligned}$$

Using the explicit formulae for \(m_x^{(2)}(0),m_x^{(3)}(0),m_x^{(4)}(0)\), \(\varphi _2,\varphi _3,\varphi _6\), and for \(\psi _2,\psi _3,\psi _4\), this formula simplifies to the desired statement. \(\square \)

4 Necessary and sufficient conditions for the equality of generalized quasiarithmetic means

In what follows, given \((f,g),(F,G)\in \mathscr {C}_0(I)\) and a probability measure \(\mu \) on [0, 1], we say that \(M_{f,g;\mu }\) equals \(M_{F,G;\mu }\) if they coincide at every point of \(I^2\). We say that these two means are equal near the diagonal \(\Delta (I):=\{(x,x)\mid x\in I\}\) of \(I^2\), if there exists an open set \(U\subseteq I^2\) containing a dense subset D of \(\Delta (I)\) such that the two means are equal at every point of U.

Lemma 7

Let \(\mu \) be a Borel probability measure on [0, 1], let \(n\in \mathbb {N}\) and let \((f,g),(F,G)\in \mathscr {C}_n(I)\). If \(M_{f,g;\mu }\) equals \(M_{F,G;\mu }\) near the diagonal of \(I^2\), then, for all \(k\in \{1,\dots ,n\}\) and \(x\in I\),

$$\begin{aligned} m_{x;f,g;\mu }^{(k)}(0)=m_{x;F,G;\mu }^{(k)}(0). \end{aligned}$$
(16)

Proof

Let \(U\subseteq I^2\) be an open set containing a dense subset D of \(\Delta (I)\) such that the two means are equal at every point of U. Let \(x\in I\) be fixed so that \((x,x)\in D\). Define

$$\begin{aligned} U_x:=\{u\in \mathbb {R}\mid (x+(1-\hat{\mu }_1)u,x-\hat{\mu }_1 u)\in U\}. \end{aligned}$$

Then \(U_x\) is a neighbourhood of 0 (because U is open), and the equality of the means on U implies that, for any \(u\in U_x\),

$$\begin{aligned} m_{x;f,g;\mu }(u)=m_{x;F,G;\mu }(u). \end{aligned}$$

Therefore (16) holds for all \(k\in \{1,\dots ,n\}\) and \(x\in I\) with \((x,x)\in D\). Using the continuity, the density of D yields that this equality holds for all \(x\in I\). \(\square \)

In the subsequent lemmas, we will analyse the consequences of the equalities (16) for \(k\in \{2,3,4,5,6\}\).

Lemma 8

Let \(\mu \) be a Borel probability measure on [0, 1] with \(\mu _2>0\) and let \((f,g),(F,G)\in \mathscr {C}_2(I)\). If, for all \(x\in I\),

$$\begin{aligned} m_{x;f,g;\mu }^{(2)}(0)=m_{x;F,G;\mu }^{(2)}(0) \end{aligned}$$
(17)

holds, then

$$\begin{aligned} \Phi _{f,g}=\Phi _{F,G}. \end{aligned}$$
(18)

Proof

Applying the second-order formula of Lemma 6, the equality (17) implies

$$\begin{aligned} \mu _2\Phi _{f,g}=\mu _2\Phi _{F,G}, \end{aligned}$$

which, using \(\mu _2>0\), proves (18). \(\square \)

Lemma 9

Let \(\mu \) be a Borel probability measure on [0, 1] with \(\mu _3\ne 0\) and let \((f,g),(F,G)\in \mathscr {C}_3(I)\). If, for all \(x\in I\),

$$\begin{aligned} m_{x;f,g;\mu }^{(2)}(0)=m_{x;F,G;\mu }^{(2)}(0) \quad \text{ and }\quad m_{x;f,g;\mu }^{(3)}(0)=m_{x;F,G;\mu }^{(3)}(0) \end{aligned}$$
(19)

hold, then

$$\begin{aligned} \Phi _{f,g}=\Phi _{F,G} \quad \text{ and }\quad \Psi _{f,g}=\Psi _{F,G}. \end{aligned}$$
(20)

Proof

The condition \(\mu _3\ne 0\) implies that \(\mu _2>0\) is also valid. Thus, the first equality in (20) is a consequence of Lemma 8. Applying the third-order formula of Lemma 6, the second equality in (19) implies

$$\begin{aligned} \mu _3\big (\Phi '_{f,g}+\Phi ^2_{f,g}+\Psi _{f,g}\big ) =\mu _3\big (\Phi '_{F,G}+\Phi ^2_{F,G}+\Psi _{F,G}\big ), \end{aligned}$$

which, using \(\mu _3\ne 0\) and the equality \(\Phi _{f,g}=\Phi _{F,G}\), proves the last equation in (20). \(\square \)

The following theorem characterizes the equality of generalized quasiarithmetic means under 3 times differentiability assumptions in the case when the third central moment is different from zero.

Theorem 10

Let \(\mu \) be a Borel probability measure on [0, 1] with \(\mu _3\ne 0\) and let \((f,g),(F,G)\in \mathscr {C}_3(I)\). Then the following assertions are equivalent:

  1. (i)

    The means \(M_{f,g;\mu }\) and \(M_{F,G;\mu }\) are equal on \(I^2\).

  2. (ii)

    The means \(M_{f,g;\mu }\) and \(M_{F,G;\mu }\) are equal near the diagonal of \(I^2\).

  3. (iii)

    For all \(x\in I\), the equalities in (19) hold.

  4. (iv)

    The equalities \(\Phi _{f,g}=\Phi _{F,G}\) and \(\Psi _{f,g}=\Psi _{F,G}\) hold on I.

  5. (v)

    \((f,g)\sim (F,G)\) holds.

Proof

The implication (i) \(\Rightarrow \) (ii) is obvious. The implication (ii) \(\Rightarrow \) (iii) is a consequence of Lemma 7. The implication (iii) \(\Rightarrow \) (iv) follows from Lemma 9. Finally, the implications (iv) \(\Rightarrow \) (v) and (v) \(\Rightarrow \) (i) are consequences of Lemma 2 and Lemma 4, respectively. \(\square \)

Lemma 11

Let \(\mu \) be a Borel probability measure on [0, 1] with \(\mu _2>0\) and let \((f,g),(F,G)\in \mathscr {C}_4(I)\). If, for all \(x\in I\),

$$\begin{aligned} m_{x;f,g;\mu }^{(2)}(0)=m_{x;F,G;\mu }^{(2)}(0) \quad \text{ and }\quad m_{x;f,g;\mu }^{(4)}(0)=m_{x;F,G;\mu }^{(4)}(0) \end{aligned}$$
(21)

hold, then the equality \(\Phi _{f,g}=\Phi _{F,G}=:\Phi \) holds on I and there exists a constant \(\gamma \in \mathbb {R}\) such that

$$\begin{aligned} \Psi _{f,g}-\Psi _{F,G}=2\gamma \big |W_{f,g}^{1,0}\big |^p, \end{aligned}$$
(22)

where

$$\begin{aligned} p:=3\dfrac{\mu _2^2}{\mu _4}-1. \end{aligned}$$
(23)

Proof

The condition \(\mu _2>0\) implies that \(\mu _4>0\) is also valid. It follows from Lemma 8 and the first condition in (21) that \(\Phi _{f,g}=\Phi _{F,G}\) holds on I. Using the formula for the fourth-order derivative by Lemma 6, the second equality in (21) simplifies to

$$\begin{aligned} -6\mu _2^2\Phi \Psi _{f,g}+2\mu _4(\Phi \Psi _{f,g}+\Psi _{f,g}') =-6\mu _2^2\Phi \Psi _{F,G}+2\mu _4(\Phi \Psi _{F,G}+\Psi _{F,G}'). \end{aligned}$$

Therefore, we get the following first-order homogeneous linear differential equation for the difference function \(R:=\Psi _{f,g}-\Psi _{F,G}\):

$$\begin{aligned} R'=\Big (3\frac{\mu _2^2}{\mu _4}-1\Big )\Phi R =p\Phi R =p\frac{W_{f,g}^{2,0}}{W_{f,g}^{1,0}} R =p\frac{\big (W_{f,g}^{1,0}\big )'}{W_{f,g}^{1,0}} R. \end{aligned}$$
(24)

The solution of this differential equation implies (22) for some \(\gamma \in \mathbb {R}\). \(\square \)

Lemma 12

Let \(\mu \) be a Borel probability measure on [0, 1] with \(\mu _3=0\ne \mu _5\) and let \((f,g),(F,G)\in \mathscr {C}_5(I)\). If, for all \(x\in I\),

$$\begin{aligned}&m_{x;f,g;\mu }^{(2)}(0)=m_{x;F,G;\mu }^{(2)}(0),\nonumber \\&m_{x;f,g;\mu }^{(4)}(0)=m_{x;F,G;\mu }^{(4)}(0) \quad \text{ and }\\&m_{x;f,g;\mu }^{(5)}(0)=m_{x;F,G;\mu }^{(5)}(0)\nonumber \end{aligned}$$
(25)

hold, then the equality \(\Phi _{f,g}=\Phi _{F,G}=:\Phi \) holds on I and either \(\Psi _{f,g}=\Psi _{F,G}\) holds on I or there exists a nonzero real constant \(\gamma \) such that

$$\begin{aligned} \Psi _{f,g}&=\gamma \big |W_{f,g}^{1,0}\big |^p-\tfrac{4+3p}{2}\Phi '-\tfrac{3+5p+3p^2}{2}\Phi ^2,\nonumber \\ \Psi _{F,G}&=-\gamma \big |W_{f,g}^{1,0}\big |^p-\tfrac{4+3p}{2}\Phi '-\tfrac{3+5p+3p^2}{2}\Phi ^2, \end{aligned}$$
(26)

where p is defined by (23).

Proof

The condition \(\mu _5\ne 0\) implies that \(\mu _2\mu _4\ne 0\) is also valid. Therefore, by Lemma 8 and Lemma 11, the first two conditions in (25) yield that \(\Phi _{f,g}=\Phi _{F,G}\) and, with the notation \(R:=\Psi _{f,g}-\Psi _{F,G}\), the equalities in (22) and (24) hold for some \(\gamma \in \mathbb {R}\). Then

$$\begin{aligned} R^{(2)}=(p\Phi R)'=p\Phi 'R+p\Phi R'=(p\Phi '+p^2\Phi ^2)R. \end{aligned}$$
(27)

From Lemma 11 it follows that R is either identically zero or nowhere zero in I. In the first case, we have that \(\Psi _{f,g}=\Psi _{F,G}\). Thus, in the rest of the proof, we may assume that R is nowhere zero in I, i.e., \(\gamma \ne 0\).

Using the formula for the fifth-order derivative by Lemma 6, the third condition of (25) simplifies to

$$\begin{aligned}&(4\Phi '+3\Phi ^2\big )\Psi _{f,g} +5\Phi \Psi '_{f,g}+\Psi ^2_{f,g}+3\Psi ^{(2)}_{f,g}\\&\quad = (4\Phi '+3\Phi ^2\big )\Psi _{F,G} +5\Phi \Psi '_{F,G}+\Psi ^2_{F,G}+3\Psi ^{(2)}_{F,G}. \end{aligned}$$

Define \(S:=\Psi _{f,g}+\Psi _{F,G}\). Then the above equality yields

$$\begin{aligned} (4\Phi '+3\Phi ^2\big )R+5\Phi R'+RS+3R^{(2)}=0. \end{aligned}$$

Using (27), we finally get that

$$\begin{aligned} \big ((4+3p)\Phi '+(3+5p+3p^2)\Phi ^2+S\big )R=0. \end{aligned}$$

Therefore,

$$\begin{aligned} S=-(4+3p)\Phi '-(3+5p+3p^2)\Phi ^2. \end{aligned}$$

Thus

$$\begin{aligned} \Psi _{f,g}=\frac{S+R}{2}= & {} \gamma \big |W_{f,g}^{1,0}\big |^p-\tfrac{4+3p}{2}\Phi '-\tfrac{3+5p+3p^2}{2}\Phi ^2,\\ \Psi _{F,G}=\frac{S-R}{2}= & {} -\gamma \big |W_{f,g}^{1,0}\big |^p-\tfrac{4+3p}{2}\Phi '-\tfrac{3+5p+3p^2}{2}\Phi ^2, \end{aligned}$$

which was to be proved. \(\square \)

Lemma 13

Let \(\mu \) be a Borel probability measure on [0, 1] with \(\mu _2>0=\mu _3\) and let \((f,g),(F,G)\in \mathscr {C}_6(I)\). If, for all \(x\in I\),

$$\begin{aligned}&m_{x;f,g;\mu }^{(2)}(0)=m_{x;F,G;\mu }^{(2)}(0), \nonumber \\&m_{x;f,g;\mu }^{(4)}(0)=m_{x;F,G;\mu }^{(4)}(0) \quad \text{ and }\\&m_{x;f,g;\mu }^{(6)}(0)=m_{x;F,G;\mu }^{(6)}(0)\nonumber \end{aligned}$$
(28)

hold, then \(\Phi _{f,g}=\Phi _{F,g}=:\Phi \) and either \(\Psi _{f,g}=\Psi _{F,g}\) or there exists a nonzero real constant \(\gamma \) such that (22) holds with p defined by (23) and we have the following alternatives:

  1. (1)

    If \(\mu _6=5\mu _2\mu _4\) and \(\mu _4=3\mu _2^2\), then \(\Phi \) is an at most first degree polynomial and \(\Psi _{f,g}-\Psi _{F,g}\) is constant on I.

  2. (2)

    If \(\mu _6=5\mu _2\mu _4\) and \(\mu _4\ne 3\mu _2^2\), then the equalites

    $$\begin{aligned} \Psi _{f,g}&=\gamma \big |W_{f,g}^{1,0}\big |^p -\tfrac{p+1}{3p}\tfrac{\Phi ^{(2)}}{\Phi }-\tfrac{2p+3}{2}\Phi ' -\tfrac{2p^2+3p+4}{6}\Phi ^2, \\ \Psi _{F,G}&=-\gamma \big |W_{f,g}^{1,0}\big |^p -\tfrac{p+1}{3p}\tfrac{\Phi ^{(2)}}{\Phi }-\tfrac{2p+3}{2}\Phi ' -\tfrac{2p^2+3p+4}{6}\Phi ^2 \end{aligned}$$

    hold on the subset \(I\setminus \Phi ^{-1}(0)=\{x\in I\mid \Phi (x)\ne 0\}\).

  3. (3)

    If \(\mu _6\ne 5\mu _2\mu _4\) and \(\mu _4=3\mu _2^2\), then there exists a real constant \(\delta \) such that the equalities

    $$\begin{aligned} \Psi _{f,g}&=\gamma +\delta \big |W_{f,g}^{1,0}\big |^{-1}\!-\tfrac{r}{2}\Phi ' +\tfrac{r-5}{4} \Phi ^2-\tfrac{3r-7}{12}\big |W_{f,g}^{1,0}\big |^{-1} \bigg (\!\int \!\! \Phi ^3\big |W_{f,g}^{1,0}\big |\!\bigg ), \\ \Psi _{F,G}&=-\gamma +\delta \big |W_{f,g}^{1,0}\big |^{-1}\!-\tfrac{r}{2}\Phi ' +\tfrac{r-5}{4} \Phi ^2-\tfrac{3r-7}{12}\big |W_{f,g}^{1,0}\big |^{-1} \bigg (\!\int \!\! \Phi ^3\big |W_{f,g}^{1,0}\big |\!\bigg ) \end{aligned}$$

    hold on I, where

    $$\begin{aligned} r:=\dfrac{7\mu _6-45\mu _2^3}{3\mu _6-45\mu _2^3}. \end{aligned}$$
    (29)
  4. (4)

    If \(\mu _6\ne 5\mu _2\mu _4\) and \(\mu _4\ne 3\mu _2^2\), then there exists a real constant \(\delta \) such that the equalities

    $$\begin{aligned} \Psi _{f,g}&=\gamma \big |W_{f,g}^{1,0}\big |^p +\delta \big |W_{f,g}^{1,0}\big |^q+\tfrac{2(q-p)(p+1)-p+2}{6p}\Phi '\\&\quad +\tfrac{(q-p)(q+3p+1)(p+1)+p^2-2p}{6p} \Phi ^2\\&\quad +\tfrac{(q-p)(2p+q)(p+q+1)(p+1)}{6p}\cdot \big |W_{f,g}^{1,0}\big |^q \bigg (\int \Phi ^3\big |W_{f,g}^{1,0}\big |^{-q}\bigg ), \\ \Psi _{F,G}&=-\gamma \big |W_{f,g}^{1,0}\big |^p +\delta \big |W_{f,g}^{1,0}\big |^q+\tfrac{2(q-p)(p+1)-p+2}{6p}\Phi '\\&\quad +\tfrac{(q-p)(q+3p+1)(p+1)+p^2-2p}{6p} \Phi ^2\\&\quad +\tfrac{(q-p)(2p+q)(p+q+1)(p+1)}{6p}\cdot \big |W_{f,g}^{1,0}\big |^q \bigg (\int \Phi ^3\big |W_{f,g}^{1,0}\big |^{-q}\bigg ) \end{aligned}$$

    hold on I, where

    $$\begin{aligned} q:=\frac{\mu _2}{\mu _4}\cdot \frac{10\mu _4^2-3\mu _6\mu _2-15\mu _4\mu _2^2}{\mu _6-5\mu _4\mu _2}. \end{aligned}$$
    (30)

Proof

The condition \(\mu _2>0\) implies that \(\mu _4>0\) and \(\mu _6>0\) are also valid. The equalities \(\Phi _{f,g}=\Phi _{F,g}\) and (22) are consequences of Lemma 8 and Lemma 11, respectively. If \(\gamma =0\), then \(\Psi _{f,g}=\Psi _{F,g}\). Therefore, in the rest of the proof, we may assume that \(\gamma \) is not zero.

Using the formula for the sixth-order derivative by Lemma 6, the third condition of (28), we arrive at

$$\begin{aligned}&15\mu _2^3\big (8\Phi ^3\Psi _{f,g}+6\Phi \Psi ^2_{f,g}\big ) -15\mu _2\mu _4\big (3\Phi \Psi _{f,g}^2 +\big (\Phi ^{(2)}+5\Phi '\Phi +4\Phi ^3\big )\Psi _{f,g} \\&\quad +(3\Phi ^2+2\Psi _{f,g})\Psi '_{f,g}+\Phi \Psi ^{(2)}_{f,g}\big ) +\mu _6\big (\big (7\Phi ^{(2)}+15\Phi '\Phi +4\Phi ^3\big )\Psi _{f,g} \\&\quad +3\Phi \Psi ^2_{f,g}+\big (12\Phi '+9\Phi ^2+6\Psi _{f,g}\big )\Psi '_{f,g}+9\Phi \Psi ^{(2)}_{f,g}+4\Psi ^{(3)}_{f,g}\big )\\&\quad =15\mu _2^3\big (8\Phi ^3\Psi _{F,G}+6\Phi \Psi ^2_{F,G}\big ) \!-\!15\mu _2\mu _4\big (3\Phi \Psi _{F,G}^2 +\big (\Phi ^{(2)}+5\Phi '\Phi +4\Phi ^3\big )\Psi _{F,G} \\&\quad +(3\Phi ^2+2\Psi _{F,G})\Psi '_{F,G}+\Phi \Psi ^{(2)}_{F,G}\big ) +\mu _6\big (\big (7\Phi ^{(2)}+15\Phi '\Phi +4\Phi ^3\big )\Psi _{F,G} \\&\quad +3\Phi \Psi ^2_{F,G}+\big (12\Phi '+9\Phi ^2+6\Psi _{F,G}\big )\Psi '_{F,G}+9\Phi \Psi ^{(2)}_{F,G}+4\Psi ^{(3)}_{F,G}\big ). \end{aligned}$$

Thus, introducing \(R:=\Psi _{f,g}-\Psi _{F,G}\) and using the function \(S:=\Psi _{f,g}+\Psi _{F,G}\) defined earlier, we can rewrite this equation as

$$\begin{aligned}&4\mu _6R^{(3)}+(9\mu _6-15\mu _2\mu _4)\Phi R^{(2)}+(9\mu _6-45\mu _2\mu _4)\Phi ^2R'+12\mu _6\Phi 'R' \nonumber \\&\quad +(3\mu _6-15\mu _2\mu _4)(SR'+RS')+(7\mu _6-15\mu _2\mu _4)\Phi ^{(2)}R\\&\quad +(15\mu _6-75\mu _2\mu _4)\Phi '\Phi R+(4\mu _6-60\mu _2\mu _4+120\mu _2^3)\Phi ^3R\nonumber \\&\quad +(3\mu _6-45\mu _2\mu _4+90\mu _2^3)\Phi RS=0.\nonumber \end{aligned}$$
(31)

On the other hand, using (24), (27), and \(R^{(3)}=(p\Phi ^{(2)}+3p^2\Phi '\Phi +p^3\Phi ^3)R\), we obtain

$$\begin{aligned}&R\Big (4\mu _6(p\Phi ^{(2)}+3p^2\Phi '\Phi +p^3\Phi ^3)+(9\mu _6-15\mu _2\mu _4)(p\Phi '\Phi +p^2\Phi ^3) \\&\quad +p(9\mu _6-45\mu _2\mu _4)\Phi ^3 +12p\mu _6\Phi '\Phi +(3\mu _6-15\mu _2\mu _4)(p\Phi S+S') \\&\quad +(7\mu _6-15\mu _2\mu _4)\Phi ^{(2)}+(15\mu _6-75\mu _2\mu _4)\Phi '\Phi \\&\quad +(4\mu _6-60\mu _2\mu _4+120\mu _2^3)\Phi ^3 +(3\mu _6-45\mu _2\mu _4+90\mu _2^3)\Phi S\Big )=0. \end{aligned}$$

Since \(\gamma \ne 0\), the function R is nowhere zero and we get the following equation for S and \(\Phi \):

$$\begin{aligned} \begin{aligned}&3(\mu _6-5\mu _2\mu _4)S'+(3\mu _6(p+1)-15\mu _2\mu _4(p+3)+90\mu _2^3)\Phi S\\&\quad +(\mu _6(4p+7)-15\mu _2\mu _4)\Phi ^{(2)}+(3\mu _6(4p^2+7p+5)-15\mu _2\mu _4(p+5))\Phi '\Phi \\&\quad +(\mu _6(4p^3+9p^2+9p+4)-15\mu _2\mu _4(p^2+3p+4)+120\mu _2^3)\Phi ^3=0. \end{aligned} \end{aligned}$$
(32)

Consider first the case when \(\mu _4=3\mu _2^2\). Then \(p=0\) and (32) simplifies to

$$\begin{aligned}&3(\mu _6-15\mu _2^3)S'+3(\mu _6-15\mu _2^3)\Phi S+(7\mu _6-45\mu _2^3)\Phi ^{(2)}\nonumber \\&\quad +15(\mu _6-15\mu _2^3)\Phi '\Phi +4(\mu _6-15\mu _2^3)\Phi ^3=0. \end{aligned}$$
(33)

If additionally \(\mu _6=5\mu _2\mu _4=15\mu _2^3\), then

$$\begin{aligned} 60\mu _2^3\Phi ^{(2)}=0, \end{aligned}$$

which yields that \(\Phi \) is an at most first degree polynomial. This, together with the result of Lemma 11, completes the proof of assertion (i). On the other hand, if \(\mu _6\ne 5\mu _2\mu _4=15\mu _2^3\), then dividing the Eq. (33) by \(3(\mu _6-15\mu _2^3)\ne 0\), we get

$$\begin{aligned} S'+\Phi S+r\Phi ^{(2)}+5\Phi '\Phi +\tfrac{4}{3}\Phi ^3=0, \end{aligned}$$

where r is defined in (29). This is a first-order inhomogeneous linear differential equation for S, whose general solution is of the form

$$\begin{aligned} S=2\delta \big |W_{f,g}^{1,0}\big |^{-1}-r\Phi '+\tfrac{r-5}{2} \Phi ^2 -\tfrac{3r-7}{6}\cdot \big |W_{f,g}^{1,0}\big |^{-1} \bigg (\int \Phi ^3\big |W_{f,g}^{1,0}\big |\bigg ), \end{aligned}$$

where \(\delta \) is an arbitrary real constant. Using the equalities

$$\begin{aligned} \Psi _{f,g}=\frac{S+R}{2} \quad \text{ and }\quad \Psi _{F,G}=\frac{S-R}{2} \end{aligned}$$
(34)

and (22), assertion (iii) follows directly.

Now consider the case when \(\mu _4\ne 3\mu _2^2\) which is equivalent to \(p\ne 0\). If \(\mu _6=5\mu _2\mu _4\), then the coefficient of \(S'\) in the equality (32) is zero. Using the definition (23) of p and the equality \(\mu _6=5\mu _2\mu _4\), (32) can be rewritten as

$$\begin{aligned}&30\mu _2\mu _4p \Phi S+20\mu _2\mu _4(p+1)\Phi ^{(2)} +30\mu _2\mu _4(2p^2+3p)\Phi '\Phi \\&\quad +10\mu _2\mu _4(2p^3+3p^2+4p)\Phi ^3=0. \end{aligned}$$

This implies that

$$\begin{aligned} p \Phi S+20(p+1)\Phi ^{(2)} +30(2p^2+3p)\Phi '\Phi +10(2p^3+3p^2+4p)\Phi ^3=0. \end{aligned}$$

Therefore, using (34) and (22), the second assertion follows.

If \(\mu _6\ne 5\mu _2\mu _4\), then a simple computation shows that

$$\begin{aligned} p+q+1=\frac{10\mu _2\mu _4}{5\mu _2\mu _4-\mu _6}p, \end{aligned}$$

therefore we have that \(p+q+1\ne 0\) and the coefficient of \(S'\) in the equality (32) is not zero either. From the definitions of p and q it follows that

$$\begin{aligned} \mu _4=\dfrac{3\mu _2^2}{p+1} \quad \text{ and }\quad \mu _6=\dfrac{15\mu _2^3(q-p+1)}{(p+1)(p+q+1)}, \end{aligned}$$

respectively. Substituting these expressions into (32) and then multiplying it by \(-\tfrac{(p+1)(p+q+1)}{90\mu _2^3p}\), we arrive at

$$\begin{aligned}&S'-q\Phi S +\tfrac{2p^2-2pq+3p-2q-2}{3p}\Phi ^{(2)} +(2p^2-2pq+2p-3q+2)\Phi '\Phi \\&\quad +\tfrac{2p^3-2p^2q+4p^2-3pq+2p-4q}{3}\Phi ^3=0. \end{aligned}$$

This is an inhomogeneous first-order linear differential equation for S, whose general solution is of the following form

$$\begin{aligned} S&=2\delta \big |W_{f,g}^{1,0}\big |^q+\tfrac{2(q-p)(p+1)-p+2}{3p}\Phi ' +\tfrac{(q-p)(q+3p+1)(p+1)+p^2-2p}{3p} \Phi ^2\\&\quad +\tfrac{(q-p)(2p+q)(p+q+1)(p+1)}{3p}\cdot \big |W_{f,g}^{1,0}\big |^q \bigg (\int \Phi ^3\big |W_{f,g}^{1,0}\big |^{-q}\bigg ). \end{aligned}$$

This equality combined with (22) and (34) completes the proof of the last assertion of the lemma. \(\square \)

Corollary 14

Let \(\mu \) be a Borel probability measure on [0, 1] with \(\mu _2>0=\mu _3\) and \(6\mu _6\mu _2^2-\mu _6\mu _4-5\mu _4^2\mu _2=0\) and let \((f,g),(F,G)\in \mathscr {C}_6(I)\). If, for all \(x\in I\), the equalities in (28) are satisfied, then \(\Phi _{f,g}=\Phi _{F,g}=:\Phi \) and we have the following alternatives

  1. (1)

    If \(\mu _4=3\mu _2^2\), then \(p=0\), \(\Phi \) is an at most first degree polynomial and \(\Psi _{f,g}-\Psi _{F,G}\) is a constant.

  2. (2)

    If \(\mu _4\ne 3\mu _2^2\), then \(p\ne 0\) and there exist real constants \(\alpha \) and \(\beta \) such that the equalities

    $$\begin{aligned} \Psi _{f,g}&=\alpha \big |W_{f,g}^{1,0}\big |^p +\tfrac{2-p}{6p}\Phi '+\tfrac{p-2}{6}\Phi ^2 \quad \text{ and }\nonumber \\ \Psi _{F,G}&=\beta \big |W_{f,g}^{1,0}\big |^p +\tfrac{2-p}{6p}\Phi '+\tfrac{p-2}{6} \Phi ^2 \end{aligned}$$
    (35)

    hold on I, where p is given by (23).

Proof

The equality \(\Phi _{f,g}=\Phi _{F,g}\) is a consequence of Lemma 8.

If \(\mu _4=3\mu _2^2\), then the moment condition \(6\mu _6\mu _2^2-\mu _6\mu _4-5\mu _4^2\mu _2=0\) implies that \(\mu _6=5\mu _4\mu _2\). Hence, we are in the alternative (i) of Lemma 13, which yields that \(\Phi \) is an at most first degree polynomial and \(\Psi _{f,g}-\Psi _{F,G}\) is a constant on I.

If \(\mu _4\ne 3\mu _2^2\), then \(p\ne 0\) and the moment condition \(6\mu _6\mu _2^2-\mu _6\mu _4-5\mu _4^2\mu _2=0\) implies that \(\mu _6\ne 5\mu _4\mu _2\) and \(p=q\), where q is defined by (30). Now we satisfy the conditions of the alternative (iv) of Lemma 13, hence (35) is valid with \(\alpha :=\gamma +\delta \) and \(\beta :=\delta -\gamma \). \(\square \)

As the main applications of the above corollary, we restate and reprove the solution of the equality problems related to Bajraktarević and Cauchy means in the following two subsections.

For a real parameter \(t\in \mathbb {R}\), introduce the sine and cosine type functions \(S_t,C_t:\mathbb {R}\rightarrow \mathbb {R}\) by

$$\begin{aligned} S_t(x):={\left\{ \begin{array}{ll} \sin (\sqrt{-t}x) &{} \text{ if } t<0, \\ x &{} \text{ if } t=0, \\ \sinh (\sqrt{t}x) &{} \text{ if } t>0, \end{array}\right. }\quad \text{ and }\quad C_t(x):={\left\{ \begin{array}{ll} \cos (\sqrt{-t}x) &{} \text{ if } t<0, \\ 1 &{} \text{ if } t=0, \\ \cosh (\sqrt{t}x) &{} \text{ if } t>0. \end{array}\right. } \end{aligned}$$

It is easily seen that the functions \(S_t\) and \(C_t\) form the fundamental system of solutions for the second-order homogeneous linear differential equation \(h^{(2)}=th\).

4.1 Equality of Bajraktarević means

The first main result of this section is a rephrased form of results of Losonczi [14, 18] who characterized the equality of Bajraktarević means. In these papers Losonczi established the canonical case and additionally 32 cases for the equality of these means. To deduce the result of Losonczi from the theorem below, the most efficient way is to elaborate condition (vi). There, beyond the canonical case (that is the equivalence of the generating functions), the equality is described in terms of two polynomials of at most second degree. In the subcases when, independently, these polynomials are constants, of first degree, of second degree with no real roots, or with one or two real roots, we can distinguish \(6\times 6=36\) subcases which then reduce to the 32 cases considered by Losonczi.

Theorem 15

Let \((f,g),(F,G)\in \mathscr {C}_6(I)\) and let \(\mu :=\frac{\delta _0+\delta _1}{2}\). Then the following assertions are equivalent:

  1. (i)

    The means \(M_{f,g;\mu }\) and \(M_{F,G;\mu }\) are equal on \(I^2\).

  2. (ii)

    The means \(M_{f,g;\mu }\) and \(M_{F,G;\mu }\) are equal near the diagonal of \(I^2\).

  3. (iii)

    For all \(x\in I\), the equalities in (28) are satisfied.

  4. (iv)

    \(\Phi _{f,g}=\Phi _{F,G}\) holds on I and there exist real constants \(\alpha \) and \(\beta \) such that

    $$\begin{aligned} \Psi _{f,g}=\alpha \big (W_{f,g}^{1,0}\big )^2 \quad \text{ and }\quad \Psi _{F,G}=\beta \big (W_{f,g}^{1,0}\big )^2 \end{aligned}$$

    hold on I.

  5. (v)

    Either \((f,g)\sim (F,G)\) or there exist real constants \(a,b,c,A,B,C,\gamma \) such that

    $$\begin{aligned} af^2+bfg+cg^2=1 \quad \text{ and }\quad AF^2+BFG+CG^2=1 \end{aligned}$$
    (36)

    and \(W_{F,G}^{1,0}=\gamma W_{f,g}^{1,0}\).

  6. (vi)

    Either \((f,g)\sim (F,G)\) or there exist two real polynomials P and Q of at most second degree which are positive on the range of f/g and F/G, respectively, and there exist real constants \(\gamma \) and \(\delta \) such that

    $$\begin{aligned}&g=\frac{1}{\sqrt{P}}\!\circ \!\frac{f}{g}, \quad G=\frac{1}{\sqrt{Q}}\!\circ \!\frac{F}{G},\quad \text{ and } \nonumber \\&\quad \quad \bigg (\!\int \frac{1}{Q}\!\bigg )\!\circ \!\frac{F}{G}=\gamma \bigg (\!\int \frac{1}{P}\!\bigg )\!\circ \!\frac{f}{g}+\delta . \end{aligned}$$
    (37)
  7. (vii)

    Either \((f,g)\sim (F,G)\) or there exist a strictly monotone function \(\varphi :I\rightarrow \mathbb {R}\) and real constants \(\alpha \) and \(\beta \) such that

    $$\begin{aligned} (f,g)\sim (S_\alpha \circ \varphi ,C_\alpha \circ \varphi ) \quad \text{ and }\quad (F,G)\sim (S_\beta \circ \varphi ,C_\beta \circ \varphi ). \end{aligned}$$
  8. (viii)

    Either \((f,g)\sim (F,G)\) or \(M_{f,g;\mu }=A_\varphi =M_{F,G;\mu }\) holds on \(I^2\) with \(\varphi :=\int W_{f,g}^{1,0}\).

  9. (ix)

    Either \((f,g)\sim (F,G)\) or there exists a strictly monotone function \(\varphi :I\rightarrow \mathbb {R}\) such that \(M_{f,g;\mu }=A_\varphi =M_{F,G;\mu }\) holds on \(I^2\).

Proof

The implication (i) \(\Rightarrow \) (ii) is obvious. The implication (ii) \(\Rightarrow \) (iii) is a direct consequence of Lemma 7. Assume now that assertion (iii) is valid. Using that \(\mu \) is of the form \(\dfrac{\delta _0+\delta _1}{2}\), an easy computation shows that

$$\begin{aligned} \widehat{\mu }_1=\frac{1}{2} \quad \text{ and }\quad \mu _n={\left\{ \begin{array}{ll} 0 &{}\text{ if } n\ \text{ is } \text{ odd }\\ \frac{1}{2^n} &{}\text{ if } n\ \text{ is } \text{ even } \end{array}\right. } \quad (n\in \mathbb {N}\cup \{0\}). \end{aligned}$$

Therefore, the conditions \(\mu _2>0=\mu _3\), \(\mu _4\ne 3\mu _2^2\) and \(6\mu _6\mu _2^2-\mu _6\mu _4-5\mu _4^2\mu _2=0\) hold, whence using (23), we get \(p=2\). Now the second alternative of Corollary 14 is applicable and it implies assertion (iv).

To prove the implication (iv) \(\Rightarrow \) (v), assume that (iv) holds for some constants \(\alpha ,\beta \in \mathbb {R}\). If \(\alpha =\beta \), then Lemma 2 implies that \((f,g)\sim (F,G)\). Now consider the case when \(\alpha \ne \beta \). The existence of some \(\gamma \) such that the identity \(W_{F,G}^{1,0}=\gamma W_{f,g}^{1,0}\) holds is a direct consequence of the integration of the equality \(\Phi _{f,g}=\Phi _{F,G}\). Applying implication (iv) \(\Rightarrow \) (ii) of [26, Theorem 10], we conclude that there exist real constants abcABC such that the equalities (36) hold. Therefore, assertion (v) is valid.

Assume now that (v) holds for some constants \(a,b,c,A,B,C,\gamma \) and define

$$\begin{aligned} P(t):=at^2+bt+c \quad \text{ and }\quad Q(t):=At^2+Bt+C\quad (t\in \mathbb {R}). \end{aligned}$$

Then, dividing the equalities in (36) side by side by \(g^2\) and by \(G^2\), we obtain that

$$\begin{aligned} P\circ \frac{f}{g}=\frac{1}{g^2} \quad \text{ and }\quad Q\circ \frac{F}{G}=\frac{1}{G^2}. \end{aligned}$$
(38)

Therefore, P and Q are positive on the codomain of f/g and F/G, respectively, and the first two equalities in (37) hold. Furthermore, using (38), we have that

$$\begin{aligned} W_{f,g}^{1,0}=f'g-g'f=g^2\cdot \bigg (\frac{f}{g}\bigg )' =\bigg (\frac{1}{P}\circ \frac{f}{g}\bigg )\cdot \bigg (\frac{f}{g}\bigg )' =\bigg (\bigg (\int \frac{1}{P}\bigg )\circ \frac{f}{g}\bigg )' \end{aligned}$$

and similarly,

$$\begin{aligned} W_{F,G}^{1,0}=\bigg (\bigg (\int \frac{1}{Q}\bigg )\circ \frac{F}{G}\bigg )'. \end{aligned}$$

Applying the equality \(W_{F,G}^{1,0}=\gamma W_{f,g}^{1,0}\), after integration we obtain that the third equality in (37) is also valid for some real constant \(\delta \). This shows that assertion (v) implies (vi).

Reversing the steps of the previous argument, one can easily see that assertion (vi) also implies (v), where abc and ABC are the coefficients of the polynomials P and Q, respectively.

To prove the implication (v) \(\Rightarrow \) (viii), assume that (v) holds for some constants \(a,b,c,A,B,C,\gamma \in \mathbb {R}\). The implication (ii) \(\Rightarrow \) (iii) of [26, Theorem 10] implies that

$$\begin{aligned} M_{f,g;\mu }=A_\varphi \quad \text{ and }\quad M_{F,G;\mu }=A_\psi \end{aligned}$$

hold on \(I^2\) with \(\varphi =\int W_{f,g}^{1,0}\) and \(\psi =\int W_{F,G}^{1,0}\). Thus, using that \(W_{f,g}^{1,0}=\gamma W_{F,G}^{1,0}\), we get \(\varphi =\gamma \psi \). This result implies that \(A_\varphi =A_\psi \) is satisfied on \(I^2\). Therefore, assertion (viii) is valid.

The implications (viii) \(\Rightarrow \) (ix) and (ix) \(\Rightarrow \) (i) are obvious. Finally, the equivalence of (vii) and (ix) is a consequence of [26, Corollary 9]. \(\square \)

4.2 Equality of Cauchy means

The second main result of this section is a rephrased form of results of Losonczi [17, 18] who characterized the equality of Cauchy means and established the canonical case and 32 further cases for the equality of these means. The results of Losonczi can easily be deduced from condition (vi) of the next theorem. There, beyond the canonical case the equality is described in terms of two polynomials of at most second degree. Considering the same subcases as for Theorem 15, one can again distinguish \(6\times 6=36\) subcases which then reduce to the cases considered by Losonczi.

Theorem 16

Let \((f,g),(F,G)\in \mathscr {C}_6(I)\) and let \(\mu \) denote the Lebesgue measure restricted to [0, 1]. Then the following assertions are equivalent:

  1. (i)

    The means \(M_{f,g;\mu }\) and \(M_{F,G;\mu }\) are equal on \(I^2\).

  2. (ii)

    The means \(M_{f,g;\mu }\) and \(M_{F,G;\mu }\) are equal near the diagonal of \(I^2\).

  3. (iii)

    For all \(x\in I\), the equalities in (28) are satisfied.

  4. (iv)

    \(\Phi _{f,g}=\Phi _{F,G}\) and there exist constants \(\alpha ,\beta \in \mathbb {R}\) such that

    $$\begin{aligned}&\Psi _{f,g}=\alpha \big (W_{f,g}^{1,0}\big )^{\frac{2}{3}} +\tfrac{1}{3}\Phi '-\tfrac{2}{9}\Phi ^2\quad \text{ and }\quad \nonumber \\&\Psi _{F,G}=\beta \big (W_{f,g}^{1,0}\big )^{\frac{2}{3}}+\tfrac{1}{3}\Phi '-\tfrac{2}{9}\Phi ^2 \end{aligned}$$
    (39)

    hold on I.

  5. (v)

    Either \((f,g)\sim (F,G)\) or there exist real constants \(a,b,c,A,B,C,\gamma \) such that

    $$\begin{aligned}&af^2+bfg+cg^2=\big (W_{f,g}^{1,0}\big )^{\frac{2}{3}} \quad \text{ and }\\&AF^2+BFG+CG^2=\big (W_{F,G}^{1,0}\big )^{\frac{2}{3}} \end{aligned}$$

    and \(W_{F,G}^{1,0}=\gamma W_{f,g}^{1,0}\).

  6. (vi)

    Either \((f,g)\sim (F,G)\) or there exist two real polynomials P and Q of at most second degree which are positive on the range of f/g and F/G, respectively, and there exist real constants \(\gamma \) and \(\delta \) such that

    $$\begin{aligned}&g=\bigg (\frac{f}{g}\bigg )'\bigg (\frac{1}{\sqrt{P^3}}\circ \frac{f}{g}\bigg ), \quad G=\bigg (\frac{F}{G}\bigg )'\bigg (\frac{1}{\sqrt{Q^3}}\circ \frac{F}{G}\bigg ), \quad \text{ and }\nonumber \\&\quad \bigg (\int \frac{1}{Q}\bigg )\circ \frac{F}{G}\quad =\gamma ^{\frac{1}{3}}\bigg (\int \frac{1}{P}\bigg )\circ \frac{f}{g}+\delta . \end{aligned}$$
    (40)
  7. (vii)

    Either \((f,g)\sim (F,G)\) or there exist a strictly monotone differentiable function \(\varphi :I\rightarrow \mathbb {R}\) and real constants \(\alpha \) and \(\beta \) such that

    $$\begin{aligned} \qquad (f,g)\sim (\varphi '\cdot S_\alpha \!\circ \!\varphi ,\varphi '\cdot C_\alpha \!\circ \!\varphi ) \quad \text{ and }\quad (F,G)\sim (\varphi '\cdot S_\beta \!\circ \!\varphi ,\varphi '\cdot C_\beta \!\circ \!\varphi ). \end{aligned}$$
  8. (viii)

    Either \((f,g)\sim (F,G)\) or \(M_{f,g;\mu }=A_\varphi =M_{F,G;\mu }\) holds on \(I^2\) with \(\varphi :=\int \big (W_{f,g}^{1,0}\big )^{\frac{1}{3}}\).

  9. (ix)

    Either \((f,g)\sim (F,G)\) or there exists a strictly monotone function \(\varphi :I\rightarrow \mathbb {R}\) such that \(M_{f,g;\mu }=A_\varphi =M_{F,G;\mu }\) holds on \(I^2\).

Proof

The implication (i) \(\Rightarrow \) (ii) is clear. The implication (ii) \(\Rightarrow \) (iii) is a direct consequence of Lemma 7. Assume now that assertion (iii) is valid. Using that \(\mu \) is the Lebesgue measure restricted to [0, 1], it is easily seen that

$$\begin{aligned} \widehat{\mu }_1=\frac{1}{2} \quad \text{ and }\quad \mu _n={\left\{ \begin{array}{ll} 0 &{}\text{ if } n\ \text{ is } \text{ odd }\\ \dfrac{1}{(n+1)2^n} &{}\text{ if } n\ \text{ is } \text{ even } \end{array}\right. } \quad (n\in \mathbb {N}\cup \{0\}). \end{aligned}$$

Consequently, the conditions \(\mu _2>0=\mu _3\), \(\mu _4\ne 3\mu _2^2\) and \(6\mu _6\mu _2^2-\mu _6\mu _4-5\mu _4^2\mu _2=0\) are valid and using (23), we get \(p=\frac{2}{3}\). Hence the second alternative of Corollary 14 is applicable. Thus \(\Phi _{f,g}=\Phi _{F,G}\) holds and the equalities in (35) reduce to (39), which completes the proof of assertion (iv).

To prove the implication (iv) \(\Rightarrow \) (v), assume that (iv) holds for some constants \(\alpha ,\beta \in \mathbb {R}\). If \(\alpha =\beta \), then Lemma 2 implies that \((f,g)\sim (F,G)\). Now consider the case when \(\alpha \ne \beta \). The existence of some \(\gamma \) such that the identity \(W_{F,G}^{1,0}=\gamma W_{f,g}^{1,0}\) is valid is a direct consequence of the integration of the equality \(\Phi _{f,g}=\Phi _{F,G}\). The equalities in (39) show that the expressions

$$\begin{aligned} \frac{3W^{3,0}_{f,g}+12W^{2,1}_{f,g}}{\Big (W^{1,0}_{f,g}\Big )^{\frac{5}{3}}} -5\frac{\Big (W^{2,0}_{f,g}\Big )^2}{\Big (W^{1,0}_{f,g}\Big )^{\frac{8}{3}}}\quad \text{ and }\quad \frac{3W^{3,0}_{F,G}+12W^{2,1}_{F,G}}{\Big (W^{1,0}_{F,G}\Big )^{\frac{5}{3}}} -5\frac{\Big (W^{2,0}_{F,G}\Big )^2}{\Big (W^{1,0}_{F,G}\Big )^{\frac{8}{3}}} \end{aligned}$$

are constants. Therefore, applying implication (vii) \(\Rightarrow \) (iv) of [21, Theorem 7], we conclude that there exist real constants abcABC that validate our assertion (v).

Assume now that (v) holds for some constants \(a,b,c,A,B,C,\gamma \) and define

$$\begin{aligned} P(t):=at^2+bt+c \quad \text{ and }\quad Q(t):=At^2+Bt+C\quad (t\in \mathbb {R}). \end{aligned}$$

Then, dividing the equalities in (36) side by side by \(g^2\) and by \(G^2\), we obtain that

$$\begin{aligned} P\circ \frac{f}{g}=\frac{\Big (W^{1,0}_{f,g}\Big )^{\frac{2}{3}}}{g^2} \quad \text{ and }\quad Q\circ \frac{F}{G}=\frac{\Big (W^{1,0}_{F,G}\Big )^{\frac{2}{3}}}{G^2}. \end{aligned}$$
(41)

Therefore, P and Q are positive on the codomain of f/g and F/G, respectively. Using the identities \(W^{1,0}_{f,g}=g^2(f/g)'\) and \(W^{1,0}_{F,G}=G^2(F/G)'\), the above equalities yield the first two equations in (40). Furthermore, using (41), we have that

$$\begin{aligned} \bigg (\bigg (\int \frac{1}{P}\bigg )\circ \frac{f}{g}\bigg )' =\bigg (\frac{1}{P}\circ \frac{f}{g}\bigg )\cdot \bigg (\frac{f}{g}\bigg )' =\frac{g^2}{\Big (W^{1,0}_{f,g}\Big )^{\frac{2}{3}}}\cdot \frac{W^{1,0}_{f,g}}{g^2} =\Big (W_{f,g}^{1,0}\Big )^{\frac{1}{3}} \end{aligned}$$

and similarly,

$$\begin{aligned} \bigg (\bigg (\int \frac{1}{Q}\bigg )\circ \frac{F}{G}\bigg )' =\Big (W_{F,G}^{1,0}\Big )^{\frac{1}{3}}. \end{aligned}$$

Applying the equality \(W_{F,G}^{1,0}=\gamma W_{f,g}^{1,0}\), after integration we obtain that the third equality in (40) is also valid for some real constant \(\delta \). This completes the proof of the implication (v) \(\Rightarrow \) (vi).

Reversing the steps of the previous argument, one can easily see that assertion (vi) also implies (v), where abc and ABC are the coefficients of the polynomials P and Q, respectively.

To prove the implication (v) \(\Rightarrow \) (viii), assume that (v) holds for some constants \(a,b,c,A,B,C,\gamma \in \mathbb {R}\). The implication (iv) \(\Rightarrow \) (vi) of [21, Theorem 7] is equivalent to that

$$\begin{aligned} M_{f,g;\mu }=A_\varphi \quad \text{ and }\quad M_{F,G;\mu }=A_\psi \end{aligned}$$

hold on \(I^2\) with \(\varphi =\int \Big (W_{f,g}^{1,0}\Big )^{\frac{1}{3}}\) and \(\psi =\int \Big (W_{F,G}^{1,0}\Big )^{\frac{1}{3}}\). Thus, using that \(W_{f,g}^{1,0}=\gamma W_{F,G}^{1,0}\), we get \(\varphi =\gamma ^{\frac{1}{3}}\psi \). This equality yields that \(A_\varphi =A_\psi \) is satisfied on \(I^2\). Therefore, assertion (viii) is valid.

The implications (viii) \(\Rightarrow \) (ix) and (ix) \(\Rightarrow \) (i) are obvious. Finally, the equivalence of the assertions (vii) and (ix) is a consequence of the main result of the paper [12]. \(\square \)

4.3 Conclusion and open problems

We have to stress that the different assertions of Theorem 15 and Theorem 16 require different orders of regularity. Obviously, assertions (i), (ii), (vi), (vii), (ix) make sense in the regularity class \(\mathscr {C}_0(I)\). For (v) and (viii) one has to take the unknown functions from \(\mathscr {C}_1(I)\). Finally, assertions (iv) and (iii) require the regularity class \(\mathscr {C}_2(I)\) and \(\mathscr {C}_6(I)\), respectively.

One can also see that some of the implications described in the above proof are valid with smaller order regularity assumptions. For instance, (i) implies (ii) and (ix) implies (i) in the class \(\mathscr {C}_0(I)\). For the implications (ii) \(\Rightarrow \) (iii) \(\Rightarrow \) (iv), we need \(\mathscr {C}_6(I)\). The proof of the implication (iv) \(\Rightarrow \) (v) requires \(\mathscr {C}_2(I)\), while the equivalence of assertions (v) and (vi), and the implications (v) \(\Rightarrow \) (viii) \(\Rightarrow \) (ix) can be verified in the regularity class \(\mathscr {C}_1(I)\).

Based on the above observations, we can formulate the following three open problems.

  1. 1.

    Provided that (fg), \((F,G)\in \mathscr {C}_0(I)\) and \(\mu :=\frac{\delta _0+\delta _1}{2}\) (resp. \(\mu \) is the Lebesgue measure on [0, 1]), are assertions (i), (ii), (vi), (vii), and (ix) of Theorem 15 (resp. Theorem 16) equivalent to each other?

  2. 2.

    Provided that (fg), \((F,G)\in \mathscr {C}_1(I)\) and \(\mu :=\frac{\delta _0+\delta _1}{2}\) (resp. \(\mu \) is the Lebesgue measure on [0, 1]), are assertions (i), (ii), (v), (vi), (vii), (viii), and (ix) of Theorem 15 (resp. Theorem 16) equivalent to each other?

  3. 3.

    Provided that (fg), \((F,G)\in \mathscr {C}_2(I)\) and \(\mu :=\frac{\delta _0+\delta _1}{2}\) (resp. \(\mu \) is the Lebesgue measure on [0, 1]), are assertions (i), (ii), (iv), (v), (vi), (vii), (viii), and (ix) of Theorem 15 (resp. Theorem 16) equivalent to each other?