1 Introduction

In this paper I will stand for a nonempty open interval and the classes of continuous strictly monotone and continuous positive functions defined on I will be denoted by \({{\mathcal {C}}}{{\mathcal {M}}}(I)\) and \({{\mathcal {C}}}{{\mathcal {P}}}(I)\), respectively.

Given two functions \(f,g:I\rightarrow {\mathbb {R}}\) with \(g\in {{\mathcal {C}}}{{\mathcal {P}}}(I)\) and \(f/g\in {{\mathcal {C}}}{{\mathcal {M}}}(I)\), the two-variable Bajraktarević mean \({\mathcal {B}}_{f,g}:I^2\rightarrow I\) is defined by

$$\begin{aligned} {\mathcal {B}}_{f,g}(x,y) :=\left( \frac{f}{g}\right) ^{-1}\bigg (\frac{f(x)+f(y)}{g(x)+g(y)}\bigg ) \qquad (x,y\in I). \end{aligned}$$

The pair (fg) is called the generator of \({\mathcal {B}}_{f,g}\). This notion was introduced, in a somewhat different form and for more than two variables, by Bajraktarević [1, 2] in the late 50s. By taking \(g\equiv 1\), we can see that this class of means includes quasiarithmetic means (cf. [5]).

One of the most basic questions related to this class of means is their equality problem, which is to find the solutions \(f,g,h,k:I\rightarrow {\mathbb {R}}\) of the functional equation

$$\begin{aligned} {\mathcal {B}}_{f,g}(x,y)={\mathcal {B}}_{h,k}(x,y)\qquad (x,y\in I). \end{aligned}$$
(1)

It is not difficult to prove that if there exist four real constants abcd with \(ad-bc\ne 0\) such that

$$\begin{aligned} h=af+bg \qquad \text{ and }\qquad k=cf+dg \end{aligned}$$
(2)

hold on I, then the means \({\mathcal {B}}_{f,g}\) and \({\mathcal {B}}_{h,k}\) are identical. Motivated by this observation, if the equalities (2) are satisfied by some constants abcd with \(ad-bc\ne 0\), then we say that the pair (f, g) is equivalent to (h, k) and we denote this property by \((f,g)\sim (h,k)\). For the equality of two Bajraktarević means with more than two variables the equivalence of their generators is not only sufficient but it is also necessary (cf. [1,2,3, 14, 15]). Surprisingly, in the setting of two-variable means, the situation is completely different. This case was investigated by Losonczi [6, 10] who, assuming 6 times continuous differentiability, discovered that beyond the equality via equivalence of the generators, there are 32 further possibilities.

This result was revisited by Losonczi, Páles, and Zakaria in [11], where several new characterizations of the equality of two-variable Bajraktarević means (1) were obtained. To recall this result, we need to introduce some further notations. If \(f,g:I\rightarrow {\mathbb {R}}\) are differentiable functions, then their Wronskian \(W_{f,g}\) is defined as

$$\begin{aligned} W_{f,g}:=f'g-fg'. \end{aligned}$$

For a real parameter \(\alpha \), let us define the functions \(S_\alpha ,C_\alpha :{\mathbb {R}}\rightarrow {\mathbb {R}}\) as follows:

$$\begin{aligned} S_\alpha (t)&:=\sum _{k=0}^\infty \frac{\alpha ^k t^{2k+1}}{(2k+1)!} ={\left\{ \begin{array}{ll} \dfrac{\sin (\sqrt{-\alpha }t)}{\sqrt{-\alpha }} &{}\quad \text { if } \alpha<0,\\ t &{}\quad \text { if } \alpha =0,\\ \dfrac{\sinh (\sqrt{\alpha }t)}{\sqrt{\alpha }} &{}\quad \text { if } \alpha>0, \end{array}\right. }\\ C_\alpha (t)&:=\sum _{k=0}^\infty \frac{\alpha ^k t^{2k}}{(2k)!} ={\left\{ \begin{array}{ll} \cos (\sqrt{-\alpha }t) &{}\quad \text { if } \alpha <0,\\ 1 &{}\quad \text { if } \alpha =0,\\ \cosh (\sqrt{\alpha }t) &{}\quad \text { if } \alpha >0. \end{array}\right. } \end{aligned}$$

We note that these functions form a fundamental system of solutions of the second-order homogeneous linear differential equation \(Y''=\alpha Y\).

Theorem 1

Let \(f,g,h,k:I\rightarrow {\mathbb {R}}\) be 6 times continuously differentiable functions such that \(g,k\in {{\mathcal {C}}}{{\mathcal {P}}}(I)\) and the derivatives \((f/g)'\), \((h/k)'\) do not vanish in I. Then the following assertions are equivalent:

  1. (i)

    The means \({\mathcal {B}}_{f,g}\) and \({\mathcal {B}}_{h,k}\) satisfy the functional Eq. (1).

  2. (ii)

    Either \((f,g)\sim (h,k)\) or there exist real constants \(\alpha \), \(\beta \) and \(\gamma \) such that

    $$\begin{aligned} W_{f',g'}=\alpha \big (W_{f,g}\big )^3, \quad W_{h',k'}=\beta \big (W_{h,k}\big )^3, \quad \text{ and }\quad W_{h,k}=\gamma W_{f,g} \end{aligned}$$

    hold on I.

  3. (iii)

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

    $$\begin{aligned} af^2+bfg+cg^2=1, \quad Ah^2+Bhk+Ck^2=1, \quad \text{ and }\quad W_{h,k}=\gamma W_{f,g} \end{aligned}$$

    hold on I.

  4. (iv)

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

    $$\begin{aligned} g=\frac{1}{\sqrt{P}}\circ \frac{f}{g}, \quad k=\frac{1}{\sqrt{Q}}\circ \frac{h}{k}, \quad \text{ and }\quad \bigg (\int \frac{1}{Q}\bigg )\circ \frac{h}{k} =\gamma \bigg (\int \frac{1}{P}\bigg )\circ \frac{f}{g}+\delta . \end{aligned}$$
  5. (v)

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

    $$\begin{aligned} (f,g)\sim (S_\alpha \circ w,C_\alpha \circ w) \qquad \text{ and }\qquad (h,k)\sim (S_\beta \circ w,C_\beta \circ w). \end{aligned}$$
  6. (vi)

    Either \((f,g)\sim (h,k)\) or \({\mathcal {B}}_{f,g}={\mathcal {B}}_{w,1}={\mathcal {B}}_{h,k}\) holds on \(I^2\) with \(w:=\int W_{f,g}\).

  7. (vii)

    Either \((f,g)\sim (h,k)\) or there exists a continuous strictly monotone function \(w:I\rightarrow {\mathbb {R}}\) such that \({\mathcal {B}}_{f,g}={\mathcal {B}}_{w,1}={\mathcal {B}}_{h,k}\) holds on \(I^2\).

In fact, assertion (ii) of the above theorem is the corrected form of assertion (iv) of [11, Theorem 15], where, unfortunately, the condition \((f,g)\sim (h,k)\) was missing.

The equality problem of means in various classes of two-variable means has been solved. We refer here to Losonczi’s works [6,7,8,9,10] where the equality of two-variable means is characterized in several settings. A key idea in these papers, under appropriate order differentiability assumptions, is to calculate and then compare the partial derivatives of the means at points of the form (xx), where \(x\in I\). A similar problem, the mixed equality problem of quasiarithmetic and Lagrangian means was solved by Páles [13]. The equality problem of generalized Bajraktarević means was solved by Grünwald and Páles in [4].

The main goal of this paper is to solve one of the open problems listed in the paper [12]. We show that conditions (i) and (iii)–(vii) of Theorem 1 are equivalent to each other under first-order continuous differentiability assumptions and thus, we substantially weaken the regularity requirements of Theorem 1. The main difficulty in proving our result comes from the fact that the validity of equality (1) does not imply the differentiability properties of the unknown functions fghk. Indeed, (1) can hold only if \((f,g)\sim (h,k)\). On the other hand, if (1) holds but \((f,g)\not \sim (h,k)\), then the functions \(p,q,\varphi ,\psi :J\rightarrow {\mathbb {R}}\) which are constructed in Lemma 2 are infinitely many times differentiable.

The pairwise equivalence of conditions (i) and (iii)–(vii) suggests that the statement of Theorem 1 (without assertion (ii)) could be true even if we do not assume first-order continuous differentiability.

2 Reduction of the equality problem and auxiliary results

In what follows, we reduce the equality problem of two-variable Bajraktarević means to the equality of a two-variable Bajraktarević mean and an arithmetic mean weighted by a weight function.

Lemma 2

Let \(f,g,h,k:I\rightarrow {\mathbb {R}}\) be continuous functions such that \(g,k\in {{\mathcal {C}}}{{\mathcal {P}}}(I)\), \(f/g,h/k\in {{\mathcal {C}}}{{\mathcal {M}}}(I)\). Then the equality (1) holds if and only if

$$\begin{aligned} {\mathcal {B}}_{q,p}(u,v)={\mathcal {B}}_{\varphi ,\psi }(u,v)\qquad (u,v\in J), \end{aligned}$$
(3)

where \(J:=\big (\tfrac{h}{k}\big )(I)\) and

$$\begin{aligned} p:=k\circ \bigg (\frac{h}{k}\bigg )^{-1}, \quad q(u):=p(u)u, \quad \varphi :=f\circ \bigg (\frac{h}{k}\bigg )^{-1}, \quad \psi :=g\circ \bigg (\frac{h}{k}\bigg )^{-1}. \end{aligned}$$

Proof

Equation (1) is equivalent to the functional equation

$$\begin{aligned} \bigg (\frac{f}{g}\bigg )^{-1}\bigg (\frac{f(x)+f(y)}{g(x)+g(y)}\bigg ) =\bigg (\frac{h}{k}\bigg )^{-1}\bigg (\frac{h(x)+h(y)}{k(x)+k(y)}\bigg ) \qquad (x,y\in I). \end{aligned}$$
(4)

Then, with the substitutions \(x:=\big (\frac{h}{k}\big )^{-1}(u)\) and \(y:=\big (\frac{h}{k}\big )^{-1}(v)\), (4) implies

$$\begin{aligned} \bigg (\frac{\varphi }{\psi }\bigg )^{-1} \bigg (\frac{\varphi (u)+\varphi (v)}{\psi (u)+\psi (v)}\bigg )= & {} \bigg (\frac{h}{k}\bigg )\circ \bigg (\frac{f}{g}\bigg )^{-1} \bigg (\frac{f(x)+f(y)}{g(x)+g(y)}\bigg )\nonumber \\= & {} \frac{h(x)+h(y)}{k(x)+k(y)} =\frac{p(u)u+p(v)v}{p(u)+p(v)} \end{aligned}$$
(5)

for all \(u,v\in J:=\big (\tfrac{h}{k}\big )(I)\). This proves that (3) is valid.

The proof of the reverse implication is similar. \(\square \)

Lemma 3

Let \(n\in {\mathbb {N}}\) and \(\varphi ,\psi :J\rightarrow {\mathbb {R}}\) be n-times continuously differentiable functions such that \(\psi \in {{\mathcal {C}}}{{\mathcal {P}}}(J)\) and \(\big (\frac{\varphi }{\psi }\big )'\) is nowhere vanishing. Then \({\mathcal {B}}_{\varphi ,\psi }\) is n-times continuously differentiable on \(J^2\).

Proof

Due to the assumptions, the function \(\big (\frac{\varphi }{\psi }\big )^{-1}\) is n-times continuously differentiable on \(\frac{\varphi }{\psi }(J)\). By the chain rule, this implies that the mean \({\mathcal {B}}_{\varphi ,\psi }\) is n-times continuously differentiable on \(J^2\). \(\square \)

Lemma 4

Let \(n\in {\mathbb {N}}\) and \(\varphi ,\psi :J\rightarrow {\mathbb {R}}\) be n-times continuously differentiable functions such that \(\psi \in {{\mathcal {C}}}{{\mathcal {P}}}(J)\) and \(\big (\frac{\varphi }{\psi }\big )'\) is nowhere vanishing. Let \(p\in {{\mathcal {C}}}{{\mathcal {P}}}(J)\) and define \(q:J\rightarrow {\mathbb {R}}\) by \(q(u):=p(u)u\). If (3) holds, then p is n-times continuously differentiable.

Proof

To prove the n-times continuous differentiability of p at an arbitrarily fixed element \(u_0\in J\), let \(v_0\in J\) be another fixed element which is distinct from \(u_0\). Then, due to the strict mean property of Bajraktarević means, it follows that \({\mathcal {B}}_{\varphi ,\psi }(u_0,v_0)\ne u_0\). Hence, for some neighborhood \(U_0\) of \(u_0\), we have that \({\mathcal {B}}_{\varphi ,\psi }(u,v_0)\ne u\) holds for all \(u\in U_0\). By the equality (3), for \(u\in U_0\), we get

$$\begin{aligned} p(u)=p(v_0)\cdot \frac{v_0-{\mathcal {B}}_{\varphi ,\psi } (u,v_0)}{{\mathcal {B}}_{\varphi ,\psi }(u,v_0)-u}. \end{aligned}$$
(6)

Using this formula, and applying Lemma 3, we can see that p is n-times continuously differentiable on \(U_0\), in particular, at \(u_0\). \(\square \)

3 Main results

First, we are going to establish various consequences of the equality (3).

Lemma 5

Let \(p:J\rightarrow {\mathbb {R}}\) and let \(\varphi ,\psi :J\rightarrow {\mathbb {R}}\) be continuously differentiable functions such that \(\psi ,p\in {{\mathcal {C}}}{{\mathcal {P}}}(J)\) and \(\big (\frac{\varphi }{\psi }\big )'\) is nowhere vanishing. Define \(q:J\rightarrow {\mathbb {R}}\) by \(q(u):=p(u)u\). If (3) holds, then p is continuously differentiable and, for all \((u,v)\in J^2\),

$$\begin{aligned}&[\varphi '(u)(\psi (u)+\psi (v))-(\varphi (u)+\varphi (v))\psi '(u)] [p'(v)p(u)(v-u)+p(v)(p(u)+p(v))]\nonumber \\&\quad =[\varphi '(v)(\psi (u)+\psi (v))-(\varphi (u) +\varphi (v))\psi '(v)] [p'(u)p(v)(u-v)+p(u)(p(u)+p(v))].\nonumber \\ \end{aligned}$$
(7)

Furthermore, there exists a nonzero constant \(\gamma \in {\mathbb {R}}\) such that

$$\begin{aligned} W_{\varphi ,\psi }=\gamma p^2. \end{aligned}$$
(8)

Proof

By Lemmas 3 and 4, p and \({\mathcal {B}}_{\varphi ,\psi }\) are continuously differentiable on J and \(J^2\), respectively. Differentiating Eq. (3) with respect to the first and second variables, for all \((u,v)\in J^2\), we obtain

$$\begin{aligned}&\bigg (\bigg (\frac{\varphi }{\psi }\bigg )^{-1}\bigg )' \bigg (\frac{\varphi (u)+\varphi (v)}{\psi (u)+\psi (v)}\bigg ) \frac{\varphi '(u)(\psi (u)+\psi (v))-(\varphi (u)+\varphi (v))\psi '(u)}{(\psi (u)+\psi (v))^2}\\&\quad =\frac{p'(u)p(v)(u-v)+p(u)(p(u)+p(v))}{(p(u)+p(v))^2},\\&\bigg (\bigg (\frac{\varphi }{\psi }\bigg )^{-1}\bigg )' \bigg (\frac{\varphi (u)+\varphi (v)}{\psi (u)+\psi (v)}\bigg ) \frac{\varphi '(v)(\psi (u)+\psi (v))-(\varphi (u)+\varphi (v))\psi '(v)}{(\psi (u)+\psi (v))^2}\\&\quad =\frac{p'(v)p(u)(v-u)+p(v)(p(u)+p(v))}{(p(u)+p(v))^2}. \end{aligned}$$

These equalities easily yield that (7) is true for all \((u,v)\in J^2\).

Now, using the definition of \(W_{\varphi ,\psi }\), the equality (7) can be rewritten as

$$\begin{aligned}&\Big (2W_{\varphi ,\psi }(u)+\varphi '(u)(\psi (v)-\psi (u)) -(\varphi (v)-\varphi (u))\psi '(u)\Big )\\&\quad \times \Big (p'(v)p(u)(v-u)+p(v)(p(u)+p(v))\Big )\\&\quad =\Big (2W_{\varphi ,\psi }(v)+\varphi '(v)(\psi (u)-\psi (v) )-(\varphi (u)-\varphi (v))\psi '(v)\Big )\\&\qquad \times \Big (p'(u)p(v)(u-v)+p(u)(p(u)+p(v))\Big ). \end{aligned}$$

After rearranging this equality, we arrive at

$$\begin{aligned}&\frac{\big (W_{\varphi ,\psi }/p\big )(v)-\big (W_{\varphi ,\psi }/p\big )(u)}{v-u}\\&\quad =W_{\varphi ,\psi }(u)\frac{p'(v)}{p(v)(p(u)+p(v))} +W_{\varphi ,\psi }(v)\frac{p'(u)}{p(u)(p(u)+p(v))}\\&\qquad -\frac{\varphi '(v)(\psi (u)-\psi (v))-(\varphi (u)-\varphi (v))\psi '(v)}{2(v-u)} \Big (\frac{p'(u)(u-v)}{p(u)(p(u)+p(v))}+\frac{1}{p(v)}\Big )\\&\qquad +\frac{\varphi '(u)(\psi (v)-\psi (u))-(\varphi (v)-\varphi (u))\psi '(u)}{2(v-u)} \Big (\frac{p'(v)(v-u)}{p(v)(p(u)+p(v))}+\frac{1}{p(u)}\Big ). \end{aligned}$$

Observe now that each term on the right hand side of this equality has a limit as v tends to u. Therefore, the limit of the left hand side must exist, showing that the function \(w:=W_{\varphi ,\psi }/p\) is differentiable at J. Upon taking the limit as \(v\rightarrow u\), we obtain

$$\begin{aligned} w'(u) =\frac{p'}{p}(u)w(u), \end{aligned}$$

which implies that w/p is constant on J. Consequently, there exists \(\gamma \in {\mathbb {R}}\) such that (8) holds on J. The constant \(\gamma \) cannot be zero, otherwise \(W_{\varphi ,\psi }\) is identically zero, which contradicts that the derivative \(\big (\frac{\varphi }{\psi }\big )'\) is nowhere vanishing. \(\square \)

Lemma 6

Let \(\varphi ,\psi ,p:J\rightarrow {\mathbb {R}}\) be continuously differentiable functions such that \(\psi ,p\in {{\mathcal {C}}}{{\mathcal {P}}}(J)\) and \(\big (\frac{\varphi }{\psi }\big )'\) is nowhere vanishing. Assume that the equality (7) is satisfied for all \((u,v)\in J^2\). Then there exists an open (possibly empty) subset \(H\subseteq J\) such that \(\varphi ,\psi ,p\) are infinitely many times differentiable on H and

$$\begin{aligned} \gamma W_{q',p'}-W_{\varphi ',\psi '}=\gamma \frac{r''}{r}p^2 \end{aligned}$$
(9)

holds on H, where \(r:=\psi /p\). If \(K:=J\setminus H\) is not a singleton then r is twice continuously differentiable on J and \(r''\) vanishes on K. Finally, if \(K=\{u_0\}\) is valid for some \(u_0\in J\), then r is twice continuously differentiable on \(J\setminus \{u_0\}\). If, additionally, \(r''\) has finite left and right limits at \(u_0\), then r is also twice continuously differentiable at \(u_0\) and \(r''(u_0)=0\).

Proof

Assume that (7) holds for all \((u,v)\in J^2\). In view of Lemma 5, it follows that there exists a nonzero constant \(\gamma \in {\mathbb {R}}\) such that (8) holds in J. Therefore,

$$\begin{aligned} \Big (\frac{\varphi }{\psi }\Big )' =\frac{W_{\varphi ,\psi }}{\psi ^2} =\frac{\gamma p^2}{\psi ^2}. \end{aligned}$$
(10)

Thus, for all \((u,v)\in J^2\), we get

$$\begin{aligned}&\varphi '(u)(\psi (u)+\psi (v))-(\varphi (u)+\varphi (v))\psi '(u)\\&\quad =\Big (\frac{\varphi }{\psi }\Big )'(u)\psi (u)(\psi (u)+\psi (v)) +\psi '(u)\psi (v)\int _v^u\Big (\frac{\varphi }{\psi }\Big )'\\&\quad =\gamma \bigg (\frac{p^2(u)(\psi (u)+\psi (v))}{\psi (u)}+\psi '(u)\psi (v) \int _v^u\frac{p^2}{\psi ^2}\bigg ). \end{aligned}$$

Using this formula, the equality (7) can equivalently be rewritten as

$$\begin{aligned}&\bigg (\frac{p^2(u)(\psi (u)+\psi (v))}{\psi (u)}+\psi '(u)\psi (v)\int _v^u \frac{p^2}{\psi ^2}\bigg ) \bigg (\frac{p'(v)(v-u)}{p(v)}+\frac{p(u)+p(v)}{p(u)}\bigg )\\&\quad =\bigg (\frac{p^2(v)(\psi (u)+\psi (v))}{\psi (v)}+\psi '(v)\psi (u)\int _u^v \frac{p^2}{\psi ^2}\bigg )\! \bigg (\frac{p'(u)(u-v)}{p(u)}+\frac{p(u)+p(v)}{p(v)}\bigg ). \end{aligned}$$

Therefore, for all \((u,v)\in J^2\) with \(u\ne v\), this is an equation of the following form:

$$\begin{aligned} A(u,v)\psi '(u)+B(u,v)p'(u)=C(u,v), \end{aligned}$$
(11)

where

$$\begin{aligned} A(u,v)&:=\bigg (\frac{(p(u)+p(v))\psi (v)}{p(u)(u-v)} -\frac{p'(v)\psi (v)}{p(v)}\bigg )\int _u^v \frac{p^2}{\psi ^2},\\ B(u,v)&:=\frac{p^2(v)(\psi (u)+\psi (v))}{p(u)\psi (v)} +\frac{\psi (u)\psi '(v)}{p(u)}\int _u^v \frac{p^2}{\psi ^2},\\ C(u,v)&:=\bigg (\frac{p(u)}{\psi (u)}-\frac{p(v)}{\psi (v)}\bigg ) \frac{(\psi (u)+\psi (v))(p(u)+p(v))}{u-v}\\&\quad -\frac{p'(v)p^2(u)(\psi (u)+\psi (v))}{p(v)\psi (u)} -\frac{(p(u)+p(v))\psi (u)\psi '(v)}{p(v)(u-v)}\int _u^v \frac{p^2}{\psi ^2}. \end{aligned}$$

For a fixed \(u\in J\), consider now the curve \(\Gamma (u)\) defined by

$$\begin{aligned} \Gamma (u):=\big \{(A(u,v),B(u,v)):v\in J\setminus \{u\}\big \}\subseteq {\mathbb {R}}^2 \end{aligned}$$

and define

$$\begin{aligned} K:=\{u\in J:\dim \Gamma (u)=1\}\qquad \text{ and }\qquad H:=\{u\in J:\dim \Gamma (u)=2\}. \end{aligned}$$

Obviously, \(\{H,K\}\) form a partition of J, i.e., they are disjoint and their union equals J. First, we are going to show that H is open and \(p,\psi ,\varphi \) are infinitely many times differentiable over H.

Let \(u_0\in H\) be fixed. Then there exist two independent elements of \(\Gamma (u_0)\), i.e., there exist \(v_1,v_2\in J\setminus \{u_0\}\) such that

$$\begin{aligned} A(u_0,v_1)B(u_0,v_2)\ne A(u_0,v_2)B(u_0,v_1). \end{aligned}$$

By the continuity of A and B, this implies that there exists a neighborhood \(U_0\subseteq J\setminus \{v_1,v_2\}\) of \(u_0\) such that

$$\begin{aligned} A(u,v_1)B(u,v_2)\ne A(u,v_2)B(u,v_1), \end{aligned}$$

which implies that \(\dim \Gamma (u)=2\) for all \(u\in U_0\). Therefore, \(U_0\subseteq H\) proving that H is open. Substituting \(v=v_i\) into (11) and solving the system of equations so obtained with respect to the pair \((\psi '(u),p'(u))\), we get

$$\begin{aligned} \psi '(u)= & {} \frac{C(u,v_1)B(u,v_2)-C(u,v_2)B(u,v_1)}{A(u,v_1)B(u,v_2)-A(u,v_2)B(u,v_1)},\\ p'(u)= & {} \frac{A(u,v_1)C(u,v_2)-A(u,v_2)C(u,v_1)}{A(u,v_1)B(u,v_2)-A(u,v_2)B(u,v_1)} \end{aligned}$$

for all \(u\in U_0\). Assume that we have proved that \(\psi \) and p are n-times continuously differentiable on \(U_0\). Then \(A(\cdot ,v_i)\), \(B(\cdot ,v_i)\), and \(C(\cdot ,v_i)\) are also n-times continuously differentiable on \(U_0\). Thus, the above equalities imply that \(\psi '\) and \(p'\) are n-times continuously differentiable on \(U_0\), too. That is, \(\psi \) and p are \((n+1)\)-times continuously differentiable on \(U_0\) and hence on H. Having proved the infinitely many times differentiability of \(\psi \) and p on H, the equality (10) implies that \(\varphi \) is also infinitely many times differentiable on H.

We have that \(q(u)=up(u)\). Therefore, for all \(u\in H\),

$$\begin{aligned} W_{q,p}(u)= & {} q'(u)p(u)-q(u)p'(u)\\= & {} (p(u)+up'(u))p(u)-up(u)p'(u)=p^2(u),\\ W_{q',p'}(u)= & {} q''(u)p'(u)-q'(u)p''(u)\\= & {} (2p'(u)+up''(u))p'(u)-(p(u)+up'(u))p''(u) =(2p'^2-pp'')(u).\\ \end{aligned}$$

On the other hand,

$$\begin{aligned} \gamma p^2=W_{\varphi ,\psi }=\varphi '\psi -\varphi \psi ' \qquad \text{ and }\qquad 2\gamma p'p =\big (W_{\varphi ,\psi }\big )'=\varphi ''\psi -\varphi \psi ''. \end{aligned}$$

Hence,

$$\begin{aligned} \varphi '=\frac{\gamma p^2+\varphi \psi '}{\psi }\qquad \text{ and }\qquad \varphi ''=\frac{2\gamma p'p+\varphi \psi ''}{\psi }. \end{aligned}$$

Therefore, using also that \(\psi =rp\), we get

$$\begin{aligned} W_{\varphi ',\psi '}= & {} \varphi ''\psi '-\varphi '\psi '' =\frac{2\gamma p'p+\varphi \psi ''}{\psi }\psi '-\frac{\gamma p^2+\varphi \psi '}{\psi }\psi ''\\= & {} \frac{2\gamma p'p}{\psi }\psi '-\frac{\gamma p^2}{\psi }\psi '' =\frac{\gamma }{r}(2p'\psi '-p\psi '')\\= & {} \frac{\gamma }{r}\big (2p'(r'p+rp')-p(r''p+2r'p'+rp'')\big )\\= & {} \gamma \Big (2p'^2-p''p-\frac{r''}{r}p^2\Big ) =\gamma \Big (W_{q',p'}-\frac{r''}{r}p^2\Big ). \end{aligned}$$

This implies that the identity (9) holds on H.

Let now \(u\in K\) be arbitrarily fixed. Then there exists \((\lambda (u),\mu (u))\ne (0,0)\) such that

$$\begin{aligned} \lambda (u)A(u,v)+\mu (u) B(u,v)=0 \qquad (v\in J\setminus \{u\}). \end{aligned}$$

This gives, for all \(v\in J\setminus \{u\}\) that

$$\begin{aligned}&\lambda (u)\bigg (\frac{(p(u)+p(v))\psi (v)}{p(u)(u-v)} -\frac{p'(v)\psi (v)}{p(v)}\bigg )\int _u^v \frac{p^2}{\psi ^2}\nonumber \\&\quad +\mu (u)\bigg (\frac{p^2(v)(\psi (u)+\psi (v))}{p(u)\psi (v)} +\frac{\psi (u)\psi '(v)}{p(u)}\int _u^v \frac{p^2}{\psi ^2}\bigg )=0. \end{aligned}$$
(12)

Taking the limit \(v\rightarrow u\), we get

$$\begin{aligned} -2\lambda (u)\frac{p^2(u)}{\psi (u)} +2\mu (u)p(u)=0, \end{aligned}$$

which implies that \(\lambda (u)p(u)=\mu (u)\psi (u)\). Therefore, \(\lambda (u)\ne 0\ne \mu (u)\) and thus (12), for all \(v\in J\setminus \{u\}\), can be rewritten as

$$\begin{aligned} \bigg (\frac{p(u)+p(v)}{p(u)(v-u)}+\frac{p'(v)}{p(v)} -\frac{\psi '(v)}{\psi (v)}\bigg )\int _u^v \frac{p^2}{\psi ^2} =p^2(v)\frac{\psi (u)+\psi (v)}{\psi (u)\psi (v)^2}. \end{aligned}$$

Let us substitute \(\psi =rp\) into this equality. Then we obtain

$$\begin{aligned} \bigg (\frac{p(u)+p(v)}{p(u)(v-u)}-\frac{r'(v)}{r(v)} \bigg )\int _u^v \frac{1}{r^2} =\frac{p(u)r(u)+p(v)r(v)}{p(u)r(u)r(v)^2}. \end{aligned}$$
(13)

Solving this equation with respect to \(r'(v)\) (when \(u\ne v\in J\)), we get

$$\begin{aligned} r'(v)=\frac{r(v)(p(u)+p(v))}{p(u)(v-u)} -\bigg (\frac{1}{r(v)}+\frac{p(v)}{p(u)r(u)} \bigg )\bigg (\int _u^v \frac{1}{r^2}\bigg )^{-1}, \end{aligned}$$

from where we can see that \(r'\) is continuously differentiable at every \(v\in J\) which is different from u. The equality (13) implies that

$$\begin{aligned} \int _u^v \frac{1}{r^2} =\frac{(v-u)(p(u)r(u)+p(v)r(v))}{r(v)r(u)\big (r(v)(p(u)+p(v))-p(u)r'(v)(v-u)\big )} \qquad (v\in J\setminus \{u\}). \end{aligned}$$

Differentiating this equality with respect to \(v\in J\setminus \{u\}\), we get

$$\begin{aligned}&\big (r(v)r(u)(p(u)+p(v))-p(u)r'(v)r(u)(v-u)\big )^2\\&\quad =\big (p(u)r(u)+p(v)r(v)+(v-u)(p'(v)r(v)+p(v)r'(v))\big )\\&\qquad \times \, r(v)r(u)\big (r(v)(p(u)+p(v))-p(u)r'(v)(v-u)\big )\\&\qquad -\,(v-u)(p(u)r(u)+p(v)r(v))\big (r'(v)r(v)r(u)(p(u)+2p(v))\\&\qquad +\,r(v)^2r(u)p'(v)-p(u)(r''(v)r(v)+r'(v)^2)r(u)(v-u)\big ), \end{aligned}$$

whence we get

$$\begin{aligned} r''(v)= & {} \frac{r(v)\big (p(v)(p(u)+p(v)) +(v-u)p'(v)p(u)\big )}{(p(u)r(u)+p(v)r(v))p(u)}\nonumber \\&\quad \times \frac{r(u)-r(v)+r'(v)(v-u)}{(v-u)^2}. \end{aligned}$$
(14)

By the Cauchy Mean Value Theorem, there exists a point \(w=w(v,u)\) between u and v such that

$$\begin{aligned} \frac{r(u)-r(v)+r'(v)(v-u)}{(v-u)^2} =\frac{r''(w)(w-u)}{2(w-u)}=\frac{1}{2}r''(w). \end{aligned}$$
(15)

Consider first the case when K is not a singleton. Then there exist at least two distinct elements of K, say \(u_1\) and \(u_2\). As we have proved, \(r'\) is continuously differentiable both on \(J\setminus \{u_1\}\) and on \(J\setminus \{u_2\}\). Therefore, it follows that \(r'\) is continuously differentiable on \((J\setminus \{u_1\})\cup (J\setminus \{u_2\})=J\) and hence \(r''\) is continuous on J. Let \(u\in K\) be arbitrary. Upon taking the limit \(v\rightarrow u\) in (14) and using (15), it follows that

$$\begin{aligned} r''(u)=\frac{1}{2} r''(u), \end{aligned}$$

and hence \(r''(u)=0\) for all \(u\in K\).

Consider now the case when K is a singleton, say \(K=\{u_0\}\). Then \(r'\) is continuously differentiable on \(J\setminus \{u_0\}\) and hence \(r''\) is continuous on \(J\setminus \{u_0\}\). Assume now that \(r''\) has finite left and right limits at \(u_0\) and denote them by \(r''_-(u_0)\) and \(r''_+(u_0)\), respectively. Observe that if \(v<u_0\), then \(v<w(v,u_0)<u_0\) and if \(v>u_0\) then \(v>w(v,u_0)>u_0\), therefore, upon taking the left and right limits \(v\uparrow u_0\) and \(v\downarrow u_0\) in (14) and using (15) (with \(u=u_0\)), it follows that

$$\begin{aligned} r_-''(u_0)=\frac{1}{2} r_-''(u_0)\qquad \text{ and }\qquad r_+''(u_0)=\frac{1}{2} r_+''(u_0). \end{aligned}$$

These equalities imply that \(r_-''(u_0)=r_+''(u_0)=0\) and hence the limit of \(r''\) at \(u_0\) exists and equals zero. Finally, we show that \(r'\) is differentiable at \(u_0\). If \(v\in J\setminus \{u_0\}\), then, by the Lagrange Mean Value Theorem, there exists an element \(z=z(v)\) between v and \(u_0\) such that

$$\begin{aligned} \frac{r'(v)-r'(u_0)}{v-u_0}=r''(z(v)). \end{aligned}$$

By passing the limit \(v\rightarrow u_0\), we can see that z(v) tends to \(u_0\), and hence

$$\begin{aligned} \lim _{v\rightarrow u_0}\frac{r'(v)-r'(u_0)}{v-u_0} =\lim _{v\rightarrow u_0}r''(z(v))=0. \end{aligned}$$

This equality shows that \(r'\) is differentiable at \(u_0\) and \(r''(u_0)=0\) and hence \(r'\) is continuously differentiable at \(u_0\). \(\square \)

One of our main results is contained in the next statement.

Theorem 7

Let \(p:J\rightarrow {\mathbb {R}}\) and let \(\varphi ,\psi :J\rightarrow {\mathbb {R}}\) be continuously differentiable functions such that \(\psi ,p\in {{\mathcal {C}}}{{\mathcal {P}}}(J)\) and \(\big (\frac{\varphi }{\psi }\big )'\) is nowhere vanishing. Define \(q:J\rightarrow {\mathbb {R}}\) by \(q(u):=up(u)\). Then the equality (3) is satisfied if and only if either \((\varphi ,\psi )\sim (q,p)\), i.e., there exist four real constants abcd with \(ad-bc\ne 0\) such that, for all \(u\in J\),

$$\begin{aligned} \varphi (u)=p(u)(au+b) \qquad \text{ and }\qquad \psi (u)=p(u)(cu+d), \end{aligned}$$
(16)

or \(\varphi ,\psi ,p\) are infinitely many times differentiable and there exist three real constants \(\alpha ,\beta ,\gamma \) such that (8) and

$$\begin{aligned} W_{q',p'}=\alpha \big (W_{q,p}\big )^3 \qquad \text{ and }\qquad W_{\varphi ',\psi '}=\beta \big (W_{\varphi ,\psi }\big )^3 \end{aligned}$$
(17)

hold on J.

Proof

Assume that (3) holds. In view of Lemma 4, we have that p is continuously differentiable. By Lemma 5, it follows that the equality (7) is valid for all \((u,v)\in J^2\) and there exists a nonzero constant \(\gamma \in {\mathbb {R}}\) such that (8) holds in J.

By Lemma 6, there exists an open (possibly empty) subset \(H\subseteq J\) such that \(\varphi ,\psi ,p\) are infinitely many times differentiable on H and (9) holds on H, where \(r:=\psi /p\). If \(K:=J\setminus H\) is not a singleton then r is twice continuously differentiable on J and \(r''\) vanishes on K. On the other hand, if \(K=\{u_0\}\) is valid for some \(u_0\in J\), then r is twice continuously differentiable on \(J\setminus \{u_0\}\). If, additionally, \(r''\) has finite left and right limits at \(u_0\), then r is also twice continuously differentiable at \(u_0\) and \(r''(u_0)=0\).

Let \(R\subseteq J\) denote the set of those points where r is twice continuously differentiable. Summarizing the above possibilities, we can see that \(J\setminus R\) is either empty or a singleton.

In what follows we shall distinguish two cases:

Case 1: The function \(r''\) vanishes everywhere on R.

Then we show that \(R=J\) holds. Indeed, if this were not true, then \(J\setminus R=\{u_0\}\) for some \(u_0\in J\). The function \(r''\) trivially has finite left and right limits at \(u_0\), hence r is also twice continuously differentiable at \(u_0\). This contradicts that \(u_0\not \in R\) and proves that \(R=J\) must be valid. Consequently, there exist two real constants cd such that

$$\begin{aligned} r(u)=cu+d \qquad (u\in J), \end{aligned}$$

which implies that \(\psi (u)=p(u)(cu+d)\) for all \(u\in J\). Then (10) yields that

$$\begin{aligned} \Big (\frac{\varphi }{\psi }\Big )'=\frac{\gamma p^2}{\psi ^2}=\frac{\gamma }{r^2}. \end{aligned}$$

Thus, for some real constant \(\delta \) and for all \(u\in J\), we get

$$\begin{aligned} \varphi (u)= & {} \psi (u)\bigg (\int \frac{\gamma }{r(u)^2}du\bigg ) =p(u)(cu+d)\bigg (\int \frac{\gamma }{(cu+d)^2}du\bigg )\\= & {} p(u)(cu+d)\bigg (\delta -\frac{\gamma }{c(cu+d)}\bigg ) =p(u)\Big (\delta (cu+d)-\frac{\gamma }{c}\Big )\\= & {} p(u)(au+b), \end{aligned}$$

where \(a:=\delta c\) and \(b:=\delta d-\gamma /c\), which also implies that \(ad-bc=\gamma \ne 0\). Thus (16) holds for all \(u\in J\).

Case II: There exists a point \(u^*\in R\) such that \(r''(u^*)\ne 0\).

Then \(u^*\) cannot belong to the set K, and hence \(u^*\in H\). Let \(U\subseteq H\) be the largest open subinterval containing \(u^*\). By Lemma 6, the functions \(\varphi ,\psi ,p\) are infinitely many times differentiable on U, the equality (9) is valid on U, and (3) holds for all \((u,v)\in U^2\). Therefore, by the implication (i)\(\Rightarrow \)(iv) of [11, Theorem 15], we have that either there exist \(a,b,c,d\in {\mathbb {R}}\) with \(ad-bc\ne 0\) such that (16) holds for all \(u\in U\) or there exist two constants \(\alpha ,\beta \in {\mathbb {R}}\) such that

$$\begin{aligned} \frac{W_{q',p'}}{(W_{q,p})^3}=\alpha \qquad \text{ and }\qquad \frac{W_{\varphi ',\psi '}}{(W_{\varphi ,\psi })^3}=\beta \end{aligned}$$
(18)

hold on U. In fact, if the first alternative were true, then \(r(u)=cu+d\) implying that \(r''(u)=0\) for all \(u\in U\), which cannot hold since \(r''(u^*)\ne 0\). Thus, the second alternative must be valid. In this case, using the identity (9), we have that the equality

$$\begin{aligned} \delta :=\gamma ^2\beta -\alpha =\frac{\gamma ^2W_{\varphi ',\psi '}}{(W_{\varphi ,\psi })^3} -\frac{W_{q',p'}}{(W_{q,p})^3} =\frac{W_{\varphi ',\psi '}-\gamma W_{q',p'}}{\gamma (W_{q,p})^3} =-\frac{r''}{rp^4} \end{aligned}$$
(19)

holds on U.

In what follows, we prove that \(U=J\). If U were a proper open subinterval of J, then one of the endpoints of U, say w, would belong to J. The point w cannot belong to H, therefore, we must have \(w\in K\).

If K is not a singleton, then r is twice continuously differentiable at w and \(r''(w)=0\). By the continuity of \(r''\) at w, we can see that (19) is also valid at the endpoint w of U. Therefore, \(\delta =0\), which implies that \(r''/(rp^4)\) is identically zero on U contradicting that \(r''(u^*)\ne 0\).

If \(K=\{u_0\}\) for some \(u_0\in J\), then \(w=u_0\) and H has two components: U and \(V:=J\setminus (\{u_0\}\cup U)\). We may assume that \(\sup U=u_0=\inf V\) (the other case is similar). From the equality (19), we can see that \(r''=-\delta rp^4\) holds on U, therefore, \(r''\) has a finite left limit at \(u_0\). On the other hand, by Lemma 6, the functions \(\varphi ,\psi ,p\) are infinitely many times differentiable on V, the equality (9) is valid on V, and (3) holds for all \((u,v)\in V^2\). Therefore, by the implication (i)\(\Rightarrow \)(iv) of [11, Theorem 15], we have that either there exist \(a^*,b^*,c^*,d^*\in {\mathbb {R}}\) with \(a^*d^*-b^*c^*\ne 0\) such that

$$\begin{aligned} \varphi (u)=p(u)(a^*u+b^*) \qquad \text{ and }\qquad \psi (u)=p(u)(c^*u+d^*) \end{aligned}$$

hold for all \(u\in V\) or there exist two constants \(\alpha ^*,\beta ^*\in {\mathbb {R}}\) such that

$$\begin{aligned} \frac{W_{q',p'}}{(W_{q,p})^3}=\alpha ^* \qquad \text{ and }\qquad \frac{W_{\varphi ',\psi '}}{(W_{\varphi ,\psi })^3}=\beta ^* \end{aligned}$$

hold on V. If the first alternative is valid, then we have that \(r''=0\) is valid on V. If the second alternative is true, then, repeating an argument as above, we get that \(r''=-\delta ^* rp^4\) holds on V with \(\delta ^*=\gamma ^2\beta ^*-\alpha ^*\). In each case we can see that \(r''\) has a finite right limit at \(u_0\). Hence, in view of Lemma 6, the function r is also twice continuously differentiable at \(u_0\) and \(r''(u_0)=0\). Therefore, \(\delta =0\) and hence \(r''\) is identically zero on U contradicting that \(r''(u^*)\ne 0\).

The contradictions so obtained show that the endpoints of U cannot belong to J, and hence, \(U=J\). Therefore the equalities in (18) are valid on J and, consequently, (17) is also valid.

The sufficiency of the conditions of the theorem directly follows from the implication (iv)\(\Rightarrow \)(i) of [11, Theorem 15]. \(\square \)

Corollary 8

Let \(p:J\rightarrow {\mathbb {R}}\) and let \(\varphi ,\psi :J\rightarrow {\mathbb {R}}\) be continuously differentiable functions such that \(\psi ,p\in {{\mathcal {C}}}{{\mathcal {P}}}(J)\) and \(\big (\frac{\varphi }{\psi }\big )'\) is nowhere vanishing. Define \(q:J\rightarrow {\mathbb {R}}\) by \(q(u):=up(u)\). Then the following assertions are equivalent:

  1. (i)

    The means \({\mathcal {B}}_{q,p}\) and \({\mathcal {B}}_{\varphi ,\psi }\) satisfy the functional Eq. (3).

  2. (ii)

    Either \((q,p)\sim (\varphi ,\psi )\) or \(\varphi ,\psi ,p\) are twice continuously differentiable and there exist real constants \(\alpha \), \(\beta \) and \(\gamma \) such that

    $$\begin{aligned} W_{q',p'}=\alpha \big (W_{q,p}\big )^3, \quad W_{\varphi ',\psi '}=\beta \big (W_{\varphi ,\psi }\big )^3 \quad \text{ and }\quad W_{\varphi ,\psi }=\gamma W_{q,p} \end{aligned}$$

    hold on J.

  3. (iii)

    Either \((q,p)\sim (\varphi ,\psi )\) or there exist real constants \(a,b,c,A,B,C,\gamma \) such that

    $$\begin{aligned} aq^2+bqp+cp^2=1, \quad A\varphi ^2+B\varphi \psi +C\psi ^2=1 \quad \text{ and }\quad W_{\varphi ,\psi }=\gamma W_{q,p}\nonumber \\ \end{aligned}$$
    (20)

    hold on J.

  4. (iv)

    Either \((q,p)\sim (\varphi ,\psi )\) or there exist two real polynomials P and Q of at most second degree which are positive on J and on the range of \(\varphi /\psi \), respectively, and there exist real constants \(\gamma \) and \(\delta \) such that

    $$\begin{aligned} p=\frac{1}{\sqrt{P}}, \quad \psi =\frac{1}{\sqrt{Q}}\circ \frac{\varphi }{\psi }, \quad \text{ and }\quad \bigg (\int \frac{1}{Q}\bigg )\circ \frac{\varphi }{\psi } =\gamma \int \frac{1}{P}+\delta . \end{aligned}$$
    (21)
  5. (v)

    Either \((q,p)\sim (\varphi ,\psi )\) or there exist a continuous strictly monotone function \(\omega :J\rightarrow {\mathbb {R}}\) and real constants \(\alpha \) and \(\beta \) such that

    $$\begin{aligned} (q,p)\sim (S_\alpha \circ \omega ,C_\alpha \circ \omega ) \qquad \text{ and }\qquad (\varphi ,\psi )\sim (S_\beta \circ \omega ,C_\beta \circ \omega ). \end{aligned}$$
  6. (vi)

    Either \((q,p)\sim (\varphi ,\psi )\) or \({\mathcal {B}}_{q,p}={\mathcal {B}}_{\omega ,1}={\mathcal {B}}_{\varphi ,\psi }\) holds on \(J^2\) with \(\omega :=\int p^2\).

  7. (vii)

    Either \((q,p)\sim (\varphi ,\psi )\) or there exists a continuous strictly monotone function \(\omega :J\rightarrow {\mathbb {R}}\) such that \({\mathcal {B}}_{q,p}={\mathcal {B}}_{\omega ,1}={\mathcal {B}}_{\varphi ,\psi }\) holds on \(J^2\).

Proof

The implication (i)\(\Rightarrow \)(ii) is a consequence of Theorem 7 because the equality (8) can be rewritten as \(W_{\varphi ,\psi }=\gamma W_{q,p}\).

A careful investigation of the proof of Theorem 1 (which is the corrected form of Theorem 15 of the paper [11]) shows that the 6th-order differentiability assumption of this theorem was only to prove the implication (i)\(\Rightarrow \)(ii). Therefore, the proof for the rest of the implications can be obtained following the argument of the proof of Theorem 1 of the paper [11]. \(\square \)

Corollary 9

Let \(f,g,h,k:I\rightarrow {\mathbb {R}}\) be continuously differentiable functions such that \(g,k\in {{\mathcal {C}}}{{\mathcal {P}}}(I)\) and the derivatives \((f/g)'\), \((h/k)'\) do not vanish in I. Then the assertions (i), (iii)–(vii) of Theorem 1 are equivalent to each other. If, in addition, fghk are twice continuously differentiable, then also assertion (ii) is equivalent to the other ones.

Proof

Let us define the interval J and functions \(p,q,\varphi ,\psi :J\rightarrow {\mathbb {R}}\) as in Lemma 2. Then pq and \(\varphi ,\psi \) are continuously differentiable so that \(\psi ,p\in {{\mathcal {C}}}{{\mathcal {P}}}(J)\) and \(\big (\frac{\varphi }{\psi }\big )'\) is nowhere vanishing on J. In view of Corollary 8, we have the equivalence of assertions (i)–(vii) of this result. Furthermore, by Lemma 2, Eq. (1) is equivalent to (3), that is assertion (i) of Theorem 1 and Corollary 8 are equivalent to each other. It is not difficult to check that the same equivalence property is valid for assertions (ii)–(vii) of these two results. The details of these computations are simple therefore they are omitted. \(\square \)