## 1 Introduction

Throughout this paper, the symbols $$\mathbb {R}$$, $$\mathbb {R}_+$$, and $$\mathbb {N}$$ will stand for the sets of real, positive real, and natural numbers, respectively, and I will always denote a nonempty open real interval.

For $$n\in \mathbb {N}$$, define the set of n-dimensional weight vectors $$\Lambda _n$$ by

\begin{aligned} \Lambda _n:=\{(\lambda _1,\dots ,\lambda _n)\in \mathbb {R}^n\mid \lambda _1,\dots ,\lambda _n\ge 0,\,\lambda _1+\dots +\lambda _n>0\}. \end{aligned}

A function $$M:I^n\times \Lambda _n\rightarrow I$$ is called an n-variable weighted mean if, for all $$x=(x_1,\dots ,x_n)\in I^n$$ and $$\lambda =(\lambda _1,\dots ,\lambda _n)\in \Lambda _n$$,

\begin{aligned} \min \big \{x_i\mid \lambda _i>0\big \} \le M(x,\lambda )\le \max \big \{x_i\mid \lambda _i>0\big \}. \end{aligned}

The most classical class of weighted means is the class of power means, or more generally, quasi-arithmetic means. Their definition is recalled from the book [7].

Given a continuous strictly monotone function $$\varphi :I\rightarrow \mathbb {R}$$, the weighted quasi-arithmetic mean $$A_\varphi :\bigcup _{n=1}^\infty I^n\times \Lambda _n\rightarrow I$$ is defined by

\begin{aligned} A_\varphi (x,\lambda ) :=\varphi ^{-1}\left( \frac{\lambda _1\varphi (x_1)+\dots + \lambda _n\varphi (x_n)}{\lambda _1+\dots +\lambda _n}\right) \end{aligned}

for $$n\in \mathbb {N}$$, $$x=(x_1,\dots ,x_n)\in I^n$$, and $$\lambda =(\lambda _1,\dots ,\lambda _n)\in \Lambda _n$$. The restriction of $$A_\varphi$$ to the set $$I^n\times \Lambda _n$$ is called the n-variable weighted quasi-arithmetic mean. In the case when $$\lambda _1=\dots =\lambda _n=1$$, we speak about an n-variable (discrete) quasi-arithmetic mean and write $$A_\varphi (x)$$ instead of $$A_\varphi (x,\lambda )$$. The function $$\varphi$$ is called the generating function of the quasi-arithmetic mean $$A_\varphi$$.

By taking $$\varphi (x):=x$$ for $$x\in \mathbb {R}$$, the resulting mean $$A_\varphi$$ is the weighted arithmetic mean. Given $$p\in \mathbb {R}$$, $$p\ne 0$$, the function $$\varphi (x):=x^p$$ $$(x\in \mathbb {R}_+)$$ generates the pth weighted power mean. To obtain the weighted geometric mean, one should take the weighted quasi-arithmetic mean generated by $$\varphi (x):=\log (x)$$ $$(x\in \mathbb {R}_+)$$.

For the equality of quasi-arithmetic means, we have the following equivalence of six conditions.

### Theorem 1

([7]). Let $$\varphi ,\psi :I\rightarrow \mathbb {R}$$ be continuous strictly monotone functions. Then the following properties are pairwise equivalent:

1. (i)

$$A_\varphi (x,\lambda )=A_\psi (x,\lambda )$$ holds for all $$n\ge 2$$, $$x=(x_1,\dots ,x_n)\in I^n$$ and $$\lambda =(\lambda _1,\dots ,\lambda _n)\in \Lambda _n$$.

2. (ii)

$$A_\varphi (x)=A_\psi (x)$$ for all $$n\ge 2$$ and $$x=(x_1,\dots ,x_n)\in I^n$$.

3. (iii)

$$A_\varphi (x,\lambda )=A_\psi (x,\lambda )$$ holds for all $$x=(x_1,x_2)\in I^2$$ and $$\lambda =(\lambda _1,\lambda _2)\in \Lambda _2$$.

4. (iv)

$$A_\varphi (x)=A_\psi (x)$$ holds for all $$x=(x_1,x_2)\in I^2$$.

5. (v)

There exists $$t\in \,]0,1[\,$$, such that $$A_\varphi (x,\lambda )=A_\psi (x,\lambda )$$ holds for all $$x=(x_1,x_2)\in I^2$$ with $$\lambda =(t,1-t)\in \Lambda _2$$.

6. (vi)

There exist $$a,b\in \mathbb {R}$$ such that $$\psi =a\varphi +b$$.

Generalizing the notion of quasi-arithmetic means, Mahmud Bajraktarević in 1958 introduced a new class of means in the following way: Let $$\varphi :I\rightarrow \mathbb {R}$$ be a continuous strictly monotone function, let $$f:I\rightarrow \mathbb {R}_+$$ be a positive function and define $$A_{\varphi ,f}:\bigcup _{n=1}^\infty I^n\times \Lambda _n\rightarrow I$$ by

\begin{aligned} A_{\varphi ,f}(x,\lambda ) :=\varphi ^{-1}\left( \frac{\lambda _1f(x_1)\varphi (x_1) +\dots +\lambda _nf(x_n)\varphi (x_n)}{\lambda _1f(x_1)+\dots +\lambda _nf(x_n)}\right) \end{aligned}

for $$n\in \mathbb {N}$$, $$x=(x_1,\dots ,x_n)\in I^n$$, and $$\lambda =(\lambda _1,\dots ,\lambda _n)\in \Lambda _n$$. Due to the identity

\begin{aligned} A_{\varphi ,f}((x_1,\dots ,x_n),(\lambda _1,\dots ,\lambda _n))=A_{\varphi }((x_1,\dots ,x_n),(\lambda _1 f(x_1),\dots ,\lambda _n f(x_n))), \end{aligned}

one can immediately see that the restriction of the function $$A_{\varphi ,f}(x,\lambda )$$ to the set $$I^n\times \Lambda _n$$ is an n-variable weighted mean.

Denoting $$g:=\varphi \cdot f$$, we can rewrite $$A_{\varphi ,f}(x,\lambda )$$ in the following more symmetric form:

\begin{aligned} B_{g,f}(x,\lambda ) :=\Big (\frac{g}{f}\Big )^{-1}\left( \frac{\lambda _1g(x_1)+\dots +\lambda _ng(x_n)}{\lambda _1f(x_1)+\dots +\lambda _nf(x_n)}\right) . \end{aligned}

In fact, if g is also nowhere zero, then one can see that $$B_{g,f}\equiv B_{f,g}$$. It is also clear that the expression for $$B_{g,f}$$ is well defined if f is positive and g / f is strictly monotone and continuous.

In order to describe necessary and sufficient conditions for the equality of Bajraktarević means, we introduce the following terminology. We say that two pairs of functions $$(f,g):I\rightarrow \mathbb {R}^2$$ and $$(h,k):I\rightarrow \mathbb {R}^2$$ are equivalent (and we write $$(f,g)\sim (h,k)$$) if there exist constants abcd with $$ad\ne cb$$ such that

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

One can easily check that $$\sim$$ is an equivalence relation, indeed.

For two given functions $$f,g:I\rightarrow \mathbb {R}$$, we define the two-variable function $$\Delta _{f,g}:I^2\rightarrow \mathbb {R}$$ as follows

\begin{aligned} \Delta _{f,g}(x,y):=\left| \begin{array}{ll} f(x) &{}\quad f(y) \\ g(x) &{}\quad g(y) \end{array}\right| \qquad (x,y\in I). \end{aligned}

For the equality of Bajraktarević means, we have the following equivalence of four conditions.

### Theorem 2

([1, 6]). Let $$f,g,h,k:I\rightarrow \mathbb {R}$$ such that f and h are positive functions and g / f, k / h are continuous and strictly monotone. Then the following properties are pairwise equivalent:

1. (I)

$$B_{g,f}(x,\lambda )=B_{k,h}(x,\lambda )$$ holds for all $$n\ge 2$$, $$x=(x_1,\dots ,x_n)\in I^n$$ and $$\lambda =(\lambda _1,\dots ,\lambda _n)\in \Lambda _n$$.

2. (II)

$$B_{g,f}(x)=B_{k,h}(x)$$ for all $$n\ge 2$$ and $$x=(x_1,\dots ,x_n)\in I^n$$.

3. (III)

$$B_{g,f}(x,\lambda )=B_{k,h}(x,\lambda )$$ holds for all $$x=(x_1,x_2)\in I^2$$ and $$\lambda =(\lambda _1,\lambda _2)\in \Lambda _2$$.

4. (VI)

$$(f,g)\sim (h,k)$$.

The proof of the above theorem is partly based on the following lemma that we will also need in the sequel.

### Lemma 3

Let $$(f,g):I\rightarrow \mathbb {R}^2$$ and $$(h,k):I\rightarrow \mathbb {R}^2$$ be equivalent pairs. Then, for some nonzero real constant $$\gamma$$,

\begin{aligned} \Delta _{h,k}=\gamma \Delta _{f,g}. \end{aligned}
(2)

### Proof

By the assumption, there exist constants abcd with $$ad\ne cb$$ such that (1) holds. Then, using the product theorem of determinants, for all $$x,y\in I$$,

\begin{aligned} \Delta _{h,k}(x,y) =\left| \begin{array}{cc} h(x) &{}\quad h(y) \\ k(x) &{}\quad k(y) \end{array}\right| =\left| \begin{array}{cc} a &{}\quad b \\ c &{}\quad d \end{array}\right| \!\cdot \!\left| \begin{array}{cc} f(x) &{}\quad f(y) \\ g(x) &{}\quad g(y) \end{array}\right| =(ad-bc)\Delta _{f,g}(x,y). \end{aligned}

Therefore, (2) holds with $$\gamma :=ad-bc\ne 0$$.$$\square$$

When comparing the characterizations of the equality for quasi-arithmetic and Bajraktarević means, one can observe that two conditions are missing from the list of Theorem 2 (which would correspond to assertions (iv) and (v) in Theorem 1):

(IV):

$$B_{g,f}(x)=B_{k,h}(x)$$ holds for all $$x=(x_1,x_2)\in I^2$$.

(V):

there exists $$t\in \,]0,1[\,$$, such that $$B_{g,f}(x,\lambda )=B_{k,h}(x,\lambda )$$ holds for all $$x=(x_1,x_2)\in I^2$$ with $$\lambda =(t,1-t)\in \Lambda _2$$.

It is obvious that each of the equivalent assertions (I), or (II), or (III), or (VI) implies (IV). It is also evident that (IV) implies (V) (with $$t:=\frac{1}{2}$$). As it has been pointed out in our paper [13], assertion (V) with $$t\in \,]0,\frac{1}{2}[\,\cup \,]\frac{1}{2},1[\,$$ implies (VI) (and hence also (I) and (II) and (III)) under three times differentiability of the generating functions fgh, and k. On the other hand, as it was shown by Losonczi [9], assertion (IV) is not equivalent to any of the assertions (I), (II), (III), and (VI). More precisely, under six times differentiability, Losonczi completely described the solutions of the equality problem of two-variable Bajraktarević means and established 32 cases of the equality beyond the standard equivalence of the generating pairs.

Similar problems have been considered in the literature by several authors. Bajraktarević [2, 3] solved the equality problem of two Bajraktarević means with at least three variables under three times differentiability. He also found sufficient conditions for the equality of the two-variable means. Aczél and Daróczy [1] described the necessary and sufficient conditions of the equality for all number of variables but without imposing any additional regularity properties. Daróczy and Losonczi [4] solved the comparison problem assuming first-order differentiability. Losonczi [9] solved the equality problem of two-variable Bajraktarević means assuming a certain algebraic conditions and six times differentiability of the unknown functions. Later, he [10] investigated the equality problem of more general means under the same regularity assumptions, but he removed the algebraic conditions required in his earlier papers. In a recent paper by Losonczi and Páles [11], the equality of two-variable Bajraktarević means generated via two different measures has been investigated. Until now, the weakening of the regularity assumptions has not been succeeded in the general case, only in the particular case when the equality problem of (symmetric) two-variable Bajraktarević mean with a quasi-arithmetic mean was considered. Matkowski [12] solved this question supposing first-order differentiability. He did not notice however, that the same goal was accomplished 8 years ago in 2004 by Daróczy et al. [5] where no additional differentiability condition was assumed.

The goal of this paper to solve the above mentioned equality problem in a particular case but without additional unnatural regularity assumptions. More precisely, we will solve the equality problem of Bajraktarević means to quasi-arithmetic means in two settings: in the class of two-variable symmetric means and in the class of two-variable nonsymmetrically weighted or more than two-variable weighted means. After an obvious substitution, these equality problems can be reduced to the functional equation

\begin{aligned}&\big (tf(x)+(1-t)f(y)\big )\varphi (tx+(1-t)y)\nonumber \\&\quad =tf(x)\varphi (x)+(1-t)f(y)\varphi (y) \qquad (x,y\in I), \end{aligned}
(3)

where $$f,\varphi :I\rightarrow \mathbb {R}$$ and $$t\in \,]0,1[\,$$ is fixed. This equation was considered and solved in the case $$t=\frac{1}{2}$$ in [5] under strict monotonicity and continuity of $$\varphi$$ and in [8] under continuity of $$\varphi$$, respectively. In Theorem 4 and Theorem 5 below, we completely solve (3) assuming only the strict monotonicity of $$\varphi$$ and also including the case $$t\ne \frac{1}{2}$$. Applying these solutions, the main results are stated in Theorem 10 and Theorem 11, which provide various equivalent conditions for a Bajraktarević mean to be quasi-arithmetic.

## 2 Solution of the Fundamental Functional Equation (3)

### Theorem 4

Let $$\varphi :I\rightarrow \mathbb {R}$$ be a strictly monotone function, $$f:I\rightarrow \mathbb {R}$$ be an arbitrary function, and $$t\in \,]0,1[\,$$. Assume that the functional equation (3) holds. Then either f is identically zero, or f is nowhere zero, f and $$\varphi$$ are infinitely many times differentiable and there exists a nonzero constant $$\gamma \in \mathbb {R}$$ such that

\begin{aligned} f^2\varphi '=\gamma . \end{aligned}
(4)

### Proof

If f is identically zero, then (3) holds, therefore no information can be obtained for $$\varphi$$.

Assume now that there exists a point $$y_0$$ such that f does not vanish at $$y_0$$. Then, for $$x\in I$$, $$x\ne y_0$$, the convex combination $$tx+(1-t)y_0$$ is strictly between the values x and $$y_0$$. Therefore, by the strict monotonicity of $$\varphi$$, we have that $$(\varphi (tx+(1-t)y_0)-\varphi (x))(\varphi (y_0)-\varphi (tx+(1-t)y_0))>0$$. Then, it follows from the functional equation (3), that

\begin{aligned} f(x)=\frac{1-t}{t} f(y_0)\frac{\varphi (y_0)-\varphi (tx+(1-t)y_0)}{\varphi (tx+(1-t)y_0)-\varphi (x)}. \end{aligned}
(5)

This implies that f(x) is nonzero for all $$x\in I$$, furthermore, f(x) has the same sign as $$f(y_0)$$, i.e., the sign of f is constant.

In what follows, we prove that, at every point of I, the function f has left and right limits and it is continuous at every point where $$\varphi$$ is continuous. Denote by $$D_\varphi$$ the set of discontinuity points of $$\varphi$$. Then the monotonicity of $$\varphi$$ implies that $$D_\varphi$$ is countable.

Let $$x_0\in I$$ be fixed. Then $$tx_0+(1-t)I$$ is a subinterval of I, hence $$I{\setminus }D_\varphi$$ intersects $$tx_0+(1-t)I$$. Therefore, there exists an element $$y_0\in I$$ such that $$tx_0+(1-t)y_0\in I{\setminus } D_\varphi$$. Thus, $$\varphi$$ is continuous at $$tx_0+(1-t)y_0$$. Now, upon taking the left or right limits as x tends to $$x_0$$ of the right hand side of equality (5), we can see that these limits exist because $$\varphi (tx+(1-t)y_0)$$ tends to $$\varphi (tx_0+(1-t)y_0)$$ and $$\varphi (x)$$ has a left and right limit (by the monotonicity of $$\varphi$$). Therefore, (5) yields that f has left and right limits at $$x_0$$. In addition, if $$\varphi$$ is continuous at $$x_0$$, then its left and right limits are the same, hence f has to be continuous at $$x_0$$.

From what we have proved it follows that f is continuous everywhere except at countably many points, hence f is continuous almost everywhere. On the other hand, f is bounded on every compact subinterval of I. Indeed, if f were unbounded on a compact subinterval $$[a,b]\subseteq I$$, then there would exist a subsequence $$(x_n)$$ in [ab] converging to some element $$x_0\in [a,b]$$, such that $$|f(x_n)|\rightarrow +\infty$$. We can extract a subsequence $$(x_{n_k})$$ which is either converging from the left or from the right to $$x_0$$. Then the limit of $$f(x_{n_k})$$ is the left or right limit of f at $$x_0$$, which is finite, contradicting $$|f(x_{n_k})|\rightarrow +\infty$$. Having the local boundedness of f, it follows that f is Riemann integrable on every compact subinterval of I.

Let $$0<\alpha <\frac{1}{2}|I|$$ and $$I_\alpha :=(I-\alpha )\cap (I+\alpha )$$. Then $$I_\alpha$$ is a nonempty interval and $$I_\alpha +[-\alpha ,\alpha ]\subseteq I$$. Let $$u\in I_\alpha$$, $$v\in [-\alpha ,\alpha ]$$ and substituting $$x:=u-(1-t)v$$ and $$y:=u+tv$$ into (3), we obtain that

\begin{aligned}&\big (tf\big (u-(1-t)v\big )+(1-t)f\big (u+tv\big )\big )\varphi (u)\\&\quad =tf\big (u-(1-t)v\big )\varphi \big (u-(1-t)v\big )+(1-t)f \big (u+tv\big )\varphi \big (u+tv\big ) \end{aligned}

holds for all $$u\in I_\alpha$$ and for all $$v\in [-\alpha ,\alpha ]$$. Integrating both sides of the previous equation on $$v\in [-\alpha ,\alpha ]$$ it follows that

\begin{aligned}&\varphi (u)\int _{-\alpha }^{\alpha }\big (tf\big (u-(1-t)v\big ) +(1-t)f\big (u+tv\big )\big )dv\\&\quad =t\int _{-\alpha }^{\alpha }f\big (u-(1-t)v\big )\varphi \big (u-(1-t)v\big )dv\\&\qquad +\,(1-t)\int _{-\alpha }^{\alpha }f \big (u+tv\big )\varphi \big (u+tv\big )dv. \end{aligned}

After simple change of the variable transformations, for all $$u\in I_\alpha$$, we get

\begin{aligned}&\varphi (u)\bigg (\frac{t}{1-t}\int _{u-(1-t)\alpha }^{u+(1-t)\alpha }f +\frac{1-t}{t}\int _{u-t\alpha }^{u+t\alpha }f\bigg )\nonumber \\&\quad =\frac{t}{1-t}\int _{u-(1-t)\alpha }^{u+(1-t)\alpha }f\cdot \varphi +\frac{1-t}{t}\int _{u-t\alpha }^{u+t\alpha }f\cdot \varphi . \end{aligned}
(6)

Having that f is either positive everywhere or negative everywhere, it follows that $$\varphi (u)$$ is the ratio of two expressions that are continuous with respect to u. Therefore, $$\varphi$$ and hence f are continuous everywhere in $$I_\alpha$$. This, together with (6), implies that $$\varphi (u)$$ is the ratio of two expressions that are continuously differentiable with respect to u. Hence $$\varphi$$ is continuously differentiable on $$I_\alpha$$. Since $$0<\alpha <\frac{1}{2}|I|$$ is arbitrary, it follows that $$\varphi$$ is continuously differentiable and f is continuous on $$\bigcup _{\alpha >0} I_\alpha =I$$. Going back to formula (5), the continuous differentiability of $$\varphi$$ implies that f is also continuously differentiable.

Now, we show that $$\varphi$$ and f are twice continuously differentiable. Differentiating (3) with respect to x, we have

\begin{aligned}&f'(x)\varphi (tx+(1-t)y)+(tf(x)+(1-t)f(y))\varphi '(tx+(1-t)y)\nonumber \\&\quad =(f\varphi )'(x)\qquad (x,y\in I). \end{aligned}
(7)

By substituting $$x:=u-(1-t)v$$ and $$y:=u+tv$$ into the previous equation and integrating both sides on $$v\in [0,\alpha ]$$, we get

\begin{aligned}&\varphi '(u)\int _{-\alpha }^{\alpha }\big (tf(u-(1-t)v)+(1-t)f(u+tv)\big )dv\\&\quad =-\varphi (u)\int _{-\alpha }^{\alpha }f'(u-(1-t)v)dv +\int _{-\alpha }^{\alpha }(f\varphi )'(u-(1-t)v)dv\qquad (u\in I_\alpha ). \end{aligned}

After similar change of the variable transformations as (6), for all $$u\in I_\alpha$$, we obtain

\begin{aligned}&\varphi '(u)\bigg (\frac{t}{1-t}\int _{u-(1-t)\alpha }^{u+(1-t)\alpha }f +\frac{1-t}{t}\int _{u-t\alpha }^{u+t\alpha }f\bigg )\\&\quad =-\frac{1}{1-t}\varphi (u)\int _{u-(1-t)\alpha }^{u+(1-t)\alpha }f' +\frac{1}{1-t}\int _{u-(1-t)\alpha }^{u+(1-t)\alpha }(f\varphi )'. \end{aligned}

From here it follows that $$\varphi '$$ is the ratio of two continuously differentiable functions on $$I_\alpha$$. Thus $$\varphi$$ is twice continuously differentiable on $$I_\alpha$$ and hence on I. This result, combined with (5), implies that f is two times continuously differentiable on I.

To prove that $$\varphi$$ and f are infinitely many times differentiable, differentiate (7) with respect to y, to get

\begin{aligned} (f'(x)+f'(y))\varphi '(tx+(1-t)y)+(tf(x)+(1-t)f(y))\varphi ''(tx+(1-t)y)=0.\nonumber \\ \end{aligned}
(8)

Substituting $$y:=x$$, we arrive at

\begin{aligned} 2f'\varphi '+f\varphi ''=0, \end{aligned}
(9)

or equivalently,

\begin{aligned} (f^2\varphi ')'=0. \end{aligned}

Hence there exists a real constant $$\gamma$$ such that $$f^2\varphi '=\gamma$$. If $$\gamma$$ were zero, then this equation would imply that $$\varphi '$$ is identically zero, which contradicts the strict monotonicity of $$\varphi$$. As a consequence, (4) holds. Finally, applying (4) and (5) repeatedly, we get that $$\varphi$$ and f are infinitely many times differentiable. $$\square$$

In order to describe the solution of functional equation (3), we introduce the following notation.

For a real parameter $$p\in \mathbb {R}$$, introduce the sine and cosine type functions $$S_p,C_p:\mathbb {R}\rightarrow \mathbb {R}$$ by

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

It is easily seen that the functions $$S_p$$ and $$C_p$$ form the fundamental system of solutions for the second-order homogeneous linear differential equation $$h''=ph$$.

### Theorem 5

Let $$\varphi :I\rightarrow \mathbb {R}$$ be a strictly monotone function, $$f:I\rightarrow \mathbb {R}$$ be a non-identically-zero function, and $$t\in \,]0,1[\,$$. Then the following assertions are equivalent:

1. (i)

$$(\varphi ,f)$$ solves (3);

2. (ii)

f is nowhere zero, f and $$\varphi$$ are twice differentiable such that (9) holds and there exists $$p\in \mathbb {R}$$ with $$(t-\frac{1}{2})p=0$$ such that $$f''=pf$$;

3. (iii)

f is nowhere zero and there exists $$p\in \mathbb {R}$$ with $$(t-\frac{1}{2})p=0$$ such that

\begin{aligned} (f,f\!\cdot \!\varphi )\sim (S_p,C_p). \end{aligned}
(10)

### Proof

Assume that $$(\varphi ,f)$$ solves (3). Then, as we have proved in Theorem 4, our conditions imply that f is nowhere zero, f and $$\varphi$$ are infinitely many times differentiable, and there exists a nonzero $$\gamma \in \mathbb {R}$$ such that (4) holds. As in the proof of Theorem 4, differentiating (3) with respect to x and then with respect to y, we get Eqs. (7) and (8), respectively. Substituting $$y:=x$$ into the last equality, (9) follows immediately.

Differentiating (8) with respect to x, we obtain

\begin{aligned}&f''(x)\varphi '(tx+(1-t)y)+(2tf'(x)+tf'(y))\varphi ''(tx+(1-t)y)\nonumber \\&\quad +\,t(tf(x)+(1-t)f(y))\varphi '''(tx+(1-t)y)=0. \end{aligned}
(11)

Inserting $$y:=x$$, it follows that

\begin{aligned} f''\varphi '+t\big (3f'\varphi ''+f\varphi '''\big )=0. \end{aligned}

On the other hand, differentiating (9) with respect x, we obtain

\begin{aligned} 2f''\varphi '+3f'\varphi ''+f\varphi '''=0. \end{aligned}
(12)

Combining the above equalities, we conclude that

\begin{aligned} (1-2t)f''\varphi '=0. \end{aligned}
(13)

Due to (4), $$\varphi '$$ is nowhere zero. Consequently, either $$t=\frac{1}{2}$$ or $$f''=0$$ on I.

In the case when $$t\ne \frac{1}{2}$$, then $$f''=0$$, and hence, assertion (ii) holds with $$p=0$$.

In the case $$t=\frac{1}{2}$$, Eq. (13) does not provide any information on f and $$\varphi$$. Therefore, we substitute $$t=\frac{1}{2}$$ into (11), to get

\begin{aligned}&f''(x)\varphi '\Big (\dfrac{x+y}{2}\Big )+(f'(x)+\frac{1}{2} f'(y))\varphi ''\Big (\dfrac{x+y}{2}\Big )\\&\quad +\,\frac{1}{4}(f(x)+f(y))\varphi '''\Big (\dfrac{x+y}{2}\Big )=0. \end{aligned}

Differentiating this equality with respect to y, we obtain

\begin{aligned}&\frac{1}{2}(f''(x)+f''(y))\varphi ''\Big (\dfrac{x+y}{2}\Big ) +\frac{1}{2}(f'(x)+f'(y))\varphi '''\Big (\dfrac{x+y}{2}\Big )\\&\quad +\,\frac{1}{8} (f(x)+f(y))\varphi ''''\Big (\dfrac{x+y}{2}\Big )=0. \end{aligned}

Substituting $$y:=x$$ and multiplying by 4, we arrive at

\begin{aligned} 4f''\varphi ''+4f'\varphi '''+ f\varphi ''''=0. \end{aligned}
(14)

However, differentiating (12), we obtain

\begin{aligned} 2f'''\varphi '+5f''\varphi ''+4f'\varphi '''+f\varphi ''''=0. \end{aligned}

Subtracting (14) from this equality side by side, we get

\begin{aligned} 2f'''\varphi '+f''\varphi ''=0. \end{aligned}

Using (4) and (9), we can eliminate $$\varphi '$$ and $$\varphi ''$$, and thus we get

\begin{aligned} \dfrac{f'''f-f''f'}{f^2}=0. \end{aligned}

Equivalently,

\begin{aligned} \Big (\dfrac{f''}{f}\Big )'=0, \end{aligned}

which implies that there exists a constant $$p\in \mathbb {R}$$ such that $$f''=pf$$. This proves the last part of statement (ii).

Assume now that assertion (ii) holds, i.e., f is nowhere zero, Eq. (9) and $$f''=pf$$ hold for some constant $$p\in \mathbb {R}$$ with $$(t-\frac{1}{2})p=0$$. Therefore, there exist constants $$a,b\in \mathbb {R}$$ such that

\begin{aligned} f=a S_p+b C_p. \end{aligned}
(15)

On the other hand, using Eq. (9), it follows that

\begin{aligned} (f\!\cdot \!\varphi )'' =f''\!\cdot \!\varphi +2f'\!\cdot \!\varphi '+f\!\cdot \!\varphi '' =f''\!\cdot \!\varphi =p f\!\cdot \!\varphi , \end{aligned}

which means that $$g:=f\!\cdot \!\varphi$$ satisfies the differential equation $$g''=pg$$. Hence, there exist constants $$c,d\in \mathbb {R}$$ such that

\begin{aligned} f\!\cdot \!\varphi = cS_p+dC_p. \end{aligned}
(16)

From the two equalities (15) and (16), it follows that $$(f,f\!\cdot \!\varphi )\sim (S_p,C_p)$$, that is, assertion (iii) holds.

Finally, assume that (iii) is valid. Then f is nowhere zero on I and the equivalence (10) holds on I for some $$p\in \mathbb {R}$$ with $$(t-\frac{1}{2})p=0$$. This, in view of Lemma 3, implies that there exists a nonzero constant $$\gamma$$ such that

\begin{aligned} \Delta _{f,f\cdot \varphi }=\gamma \Delta _{S_p,C_p}. \end{aligned}

On the other hand, the functional equation (3) holds if and only if

\begin{aligned} t\Delta _{f,f\cdot \varphi }(x,tx+(1-t)y) +(1-t)\Delta _{f,f\cdot \varphi }(y,tx+(1-t)y)=0 \qquad (x,y\in I). \end{aligned}

Therefore, to complete the proof, it is sufficient to prove that

\begin{aligned} t\Delta _{S_p,C_p}(x,tx+(1-t)y) +(1-t)\Delta _{S_p,C_p}(y,tx+(1-t)y)=0 \qquad (x,y\in I).\nonumber \\ \end{aligned}
(17)

In the case $$p=0$$, we have that

\begin{aligned}&t\Delta _{S_0,C_0}(x,tx+(1-t)y)+(1-t)\Delta _{S_0,C_0}(y,tx+(1-t)y)\\&\quad =\left| \begin{array}{cc} tx+(1-t)y &{}\quad tx+(1-t)y \\ 1&{}\quad 1 \end{array}\right| =0. \end{aligned}

In the case $$t=\frac{1}{2}$$ and $$p<0$$, denote $$q:=\sqrt{-p}$$. Using well-known identities for trigonometric functions, we get

\begin{aligned}&\frac{1}{2}\Delta _{S_p,C_p}\Big (x,\dfrac{x+y}{2}\Big ) +\frac{1}{2}\Delta _{S_p,C_p}\Big (y,\dfrac{x+y}{2}\Big )\\&\quad =\left| \begin{array}{cc} \dfrac{\sin (qx)+\sin (qy)}{2} &{}\quad \sin \Big (q\dfrac{x+y}{2}\Big ) \\ \dfrac{\cos (qx)+\cos (qy)}{2}&{}\quad \cos \Big (q\dfrac{x+y}{2}\Big ) \end{array}\right| \\&\quad =\left| \begin{array}{cc} \sin \Big (q\dfrac{x+y}{2}\Big )\cos \Big (q\dfrac{x-y}{2}\Big ) &{}\quad \sin \Big (q\dfrac{x+y}{2}\Big ) \\ \cos \Big (q\dfrac{x+y}{2}\Big )\cos \Big (q\dfrac{x-y}{2}\Big )&{}\quad \cos \Big (q\dfrac{x+y}{2}\Big ) \end{array}\right| =0. \end{aligned}

Similar arguments apply to the case $$p>0$$ by using identities for hyperbolic functions, and therefore we leave it to the reader to verify (17). $$\square$$

Given an at most second-degree polynomial $$P(u):=\alpha +\beta u+\gamma u^2$$, where $$\alpha ,\beta ,\gamma \in \mathbb {R}$$, we call the value $$D_P:=\beta ^2-4\alpha \gamma$$ the discriminant ofP.

### Lemma 6

If P is an at most second-degree polynomial, then $$D_P=(P')^2-2P''P$$.

### Proof

Let P be of the form $$P(u):=\alpha +\beta u+\gamma u^2$$, where $$\alpha ,\beta ,\gamma \in \mathbb {R}$$. Then

\begin{aligned} ((P')^2-2P''P)(u)=(\beta +2\gamma u)^2-4\gamma (\alpha +\beta u+\gamma u^2) =\beta ^2-4\alpha \gamma =D_P, \end{aligned}

which was to be proved. $$\square$$

The following result is instrumental for our main results.

### Lemma 7

Let P be an at most second-degree polynomial which is positive on I let $$D_P$$ denote its discriminant and let $$t\in \,]0,1[\,$$ with $$(t-\frac{1}{2})D_P=0$$. Let $$\psi$$ be a primitive function of 1 / P and $$\ell :=1/\sqrt{P}$$. Then the functions $$\varphi :=\psi ^{-1}$$ and $$f:=\ell \circ \varphi$$ satisfy Eq. (3) on the interval $$\psi (I)$$.

### Proof

In order to prove that $$(\varphi ,f)$$ solves (3), we show that Theorem 5 part (ii) is valid. An easy computation shows that

\begin{aligned} \varphi '= & {} \frac{1}{\psi '\circ \psi ^{-1}}=\frac{1}{\psi '\circ \varphi }, \qquad \varphi ''=-\frac{\psi ''\circ \psi ^{-1}}{(\psi '\circ \psi ^{-1})^3} =-\frac{\psi ''\circ \varphi }{(\psi '\circ \varphi )^3},\qquad \text{ and }\nonumber \\ \psi '= & {} \frac{1}{P}=\ell ^2. \end{aligned}
(18)

Therefore, it is obvious that

\begin{aligned} f^2\cdot \varphi '=(\ell ^2\circ \varphi )\cdot \frac{1}{\psi '\circ \varphi }=1. \end{aligned}

As a consequence, after differentiating both sides, we get that (9) holds. Now, we only need to show that there exists $$p\in \mathbb {R}$$ such that $$(t-\frac{1}{2})p=0$$ and $$f''=pf$$. After simple calculations, using (18) and Lemma 6, we get

\begin{aligned} f''= & {} (\ell \circ \varphi )''=(\ell ''\circ \varphi )\varphi '^2 +(\ell '\circ \varphi )\varphi ''=\bigg (\ell ''\cdot \frac{1}{(\psi ')^2} -\ell '\cdot \frac{\psi ''}{(\psi ')^3}\bigg )\circ \varphi \\= & {} \bigg (\dfrac{\ell ''\ell -2\ell '^2}{\ell ^5}\bigg )\circ \varphi =\bigg (\frac{P'^2-2P''P}{4\sqrt{P}}\bigg )\circ \varphi =\bigg (\frac{D_P}{4\sqrt{P}}\bigg )\circ \varphi =\frac{D_P}{4}f. \end{aligned}

Consequently, with $$p:=D_P/4$$ the equality $$f''=pf$$ holds on $$\psi (I)$$ and hence assertion (ii) of Theorem 5 is satisfied. $$\square$$

## 3 Main Results

For simplicity, we introduce the following regularity classes for the generating functions of Bajraktarević means as follows: Let the class $$\mathscr {B}_0(I)$$ contain all pairs (fg) such that

1. (i)

f is everywhere positive on I.

2. (ii)

g / f is strictly monotone and continuous on I.

For $$n\ge 1$$, let $$\mathscr {B}_n(I)$$ denote the class of all pairs (fg) such that

1. (+i)

f is everywhere positive on I and $$f,g:I\rightarrow \mathbb {R}$$ are n times continuously differentiable functions.

2. (+ii)

$$(g/f)'$$ is nowhere zero on I.

For $$(f,g)\in \mathscr {B}_n(I)$$ and for $$i,j\in \{0,\dots ,n\}$$, we introduce the following notations:

\begin{aligned} W^{i,j}_{f,g}:=\left| \begin{array}{cc} f^{(i)} &{}\quad f^{(j)} \\ g^{(i)} &{}\quad g^{(j)} \end{array}\right| \qquad \text{ and }\qquad \Phi _{f,g}:=\frac{W^{2,0}_{f,g}}{W^{1,0}_{f,g}},\qquad \Psi _{f,g}:=-\frac{W^{2,1}_{f,g}}{W^{1,0}_{f,g}}. \end{aligned}
(19)

The following lemma was stated and verified in [14].

### Lemma 8

Let $$(f,g)\in \mathscr {B}_2(I)$$. Then fg form a fundamental system of solutions of the second-order homogeneous linear differential equation

\begin{aligned} Y''=\Phi _{f,g}Y'+\Psi _{f,g}Y. \end{aligned}
(20)

As a consequence of Theorem 5, we can immediately obtain a characterization of the equality between two-variable weighted Bajraktarević means and two-variable weighted quasi-arithmetic means.

### Corollary 9

Let $$t\in \,]0,1[\,$$, $$(f,g)\in \mathscr {B}_0(I)$$, and let $$h:I\rightarrow \mathbb {R}$$ be a continuous strictly monotone function. Then

\begin{aligned} {B_{g,f}((x,y),(t,1-t))=A_h((x,y),(t,1-t)) \qquad (x,y\in I) } \end{aligned}
(21)

holds if and only if there exists $$p\in \mathbb {R}$$ with $$(t-\frac{1}{2})p=0$$ such that

\begin{aligned} (f,g)\sim (S_p\circ h,C_p\circ h). \end{aligned}
(22)

### Proof

Applying g / f to the both sides of (21) and substituting $$F:=f\circ h^{-1}$$, $$G:=g\circ h^{-1}$$, and $$\varphi :=\dfrac{G}{F}$$, we get an equivalent formulation of (21) as follows:

\begin{aligned}&\big (tF(u)+(1-t)F(v)\big )\varphi (tu+(1-t)v)\nonumber \\&\quad = tF(u)\varphi (u) +(1-t)F(v)\varphi (v) \qquad (u,v\in h(I)). \end{aligned}
(23)

Thus, the pair $$(\varphi ,F)$$ satisfies (3) on the interval h(I). Therefore, by Theorem 5, $$p\in \mathbb {R}$$ with $$(t-\frac{1}{2})p=0$$ such that $$(F,G)=(F,F\!\cdot \!\varphi )\sim (S_p,C_p)$$ holds on h(I). After substitution, this yields that (22) holds on the interval I. $$\square$$

The last two theorems contain the main results of our paper. They offer various characterizations of the equality of a Bajraktarević mean to a quasi-arithmetic mean. In the first result we consider such an equality for the (symmetric) two-variable setting.

### Theorem 10

Let $$(f,g)\in \mathscr {B}_0(I)$$. Then the following statements are equivalent.

1. (i)

There exists a continuous strictly monotone function $$h:I\rightarrow \mathbb {R}$$ such that

\begin{aligned} B_{g,f}(x,y)=A_h(x,y)\qquad (x,y\in I). \end{aligned}
(24)
2. (ii)

There exist real constants $$\alpha ,\beta ,\gamma$$ such that

\begin{aligned} \alpha f^2+\beta fg+\gamma g^2=1. \end{aligned}
(25)

In addition, if $$(f,g)\in \mathscr {B}_1(I)$$, then the statements (i) and (ii) are also equivalent to:

1. (iii)

Equation (24) holds with $$h=\int W^{1,0}_{f,g}$$.

Furthermore, if $$(f,g)\in \mathscr {B}_2(I)$$, then any of the statements (i) – (iii) is also equivalent to each of the following two conditions:

1. (iv)

There exists a real constant $$\delta$$ such that

\begin{aligned} W^{2,1}_{f,g}=\delta (W^{1,0}_{f,g})^3. \end{aligned}
(26)
2. (v)

$$\Psi _{f,g}$$ is differentiable and

\begin{aligned} { \Psi '_{f,g}=2\Phi _{f,g}\Psi _{f,g}. } \end{aligned}
(27)

### Proof

We will prove first the equivalence of statements (i) and (ii).

Assume first that (i) holds, i.e., there exists a continuous strictly monotone function $$h:I\rightarrow \mathbb {R}$$ such that (24) is valid. Then, applying Corollary 9 for $$t=\frac{1}{2}$$, it follows that there exists $$p\in \mathbb {R}$$ such that the equivalence in (22) holds. Therefore, there exist $$a,b,c,d\in \mathbb {R}$$ with $$ad\ne bc$$ such that

\begin{aligned} S_p\circ h=af+bg \qquad \text{ and }\qquad C_p\circ h=cf+dg. \end{aligned}
(28)

Using well-known trigonometric and hyperbolic identities, we have that

\begin{aligned} C_p^2-{{\,\mathrm{sign}\,}}(p)\!\cdot \!S_p^2=1 \end{aligned}

holds on $$\mathbb {R}$$, and hence $$C_p^2\circ h-{{\,\mathrm{sign}\,}}(p)\!\cdot \!S_p^2\circ h=1$$ holds on I. Combining this identity with the equalities in (28), we get

\begin{aligned} (cf+dg)^2-{{\,\mathrm{sign}\,}}(p)\!\cdot \!(af+bg)^2=1 \end{aligned}

on I. Therefore, statement (ii) holds with

\begin{aligned} \alpha:= & {} c^2-{{\,\mathrm{sign}\,}}(p)a^2,\qquad \beta :=2cd-2{{\,\mathrm{sign}\,}}(p)\!\cdot \!ab, \qquad \text{ and }\qquad \\ \gamma:= & {} d^2-{{\,\mathrm{sign}\,}}(p)b^2. \end{aligned}

Assume now that assertion (ii) is valid, i.e., (25) holds with some real constants $$\alpha ,\beta ,\gamma$$. Denote $$\varphi :=g/f$$. Then, by $$(f,g)\in \mathscr {B}_0(I)$$, we have that $$\varphi$$ is strictly monotone and continuous. Replacing g by $$f\!\cdot \!\varphi$$ in (25), we get

\begin{aligned} \alpha +\beta \varphi +\gamma \varphi ^2=\frac{1}{f^2}. \end{aligned}
(29)

Hence

\begin{aligned} P(u):=\alpha +\beta u+\gamma u^2=\frac{1}{f^2\circ \varphi ^{-1}(u)} \qquad (u\in \varphi (I)). \end{aligned}
(30)

Thus, P is an at most second-degree polynomial which is positive on the interval $$J:=\varphi (I)$$. Now, we are in the position to apply Lemma 7 in the case $$t=\frac{1}{2}$$. Let $$\psi$$ be a primitive function of 1 / P and $$\ell :=1/\sqrt{P}$$. Then the functions $$\varphi ^*:=\psi ^{-1}$$ and $$f^*:=\ell \circ \varphi ^*$$ satisfy Eq. (3) on $$\psi (J)$$. This immediately implies that the two-variable Bajraktarević mean $$B_{f^*\!\cdot \!\varphi ^*,f^*}$$ equals the two-variable arithmetic mean on $$\psi (J)$$, that is, for all $$u,v\in \psi (J)$$,

\begin{aligned} (\varphi ^*)^{-1}\bigg (\frac{f^*(u)\varphi ^*(u)+f^*(v)\varphi ^*(v)}{f^*(u)+f^*(v)}\bigg )=\frac{u+v}{2}. \end{aligned}

Now substituting $$u:=(\varphi ^*)^{-1}\circ \varphi (x)$$ and $$v:=(\varphi ^*)^{-1}\circ \varphi (y)$$ where $$x,y\in I$$, and observing that

\begin{aligned} f^*\circ (\varphi ^*)^{-1}\circ \varphi =\ell \circ \varphi =\frac{1}{\sqrt{P\circ \varphi }} =\sqrt{f^2\circ \varphi ^{-1}\circ \varphi }=f, \end{aligned}

the above equality, for all $$x,y\in I$$, implies that

\begin{aligned} (\varphi ^*)^{-1}\bigg (\frac{f(x)\varphi (x)+f(y)\varphi (y)}{f(x)+f(y)}\bigg ) =\frac{(\varphi ^*)^{-1}\circ \varphi (x)+(\varphi ^*)^{-1}\circ \varphi (y)}{2}. \end{aligned}

Applying the function $$\varphi ^{-1}\circ \varphi ^*$$ to this equation side by side, it follows that the two-variable Bajraktarević mean $$B_{f\!\cdot \!\varphi ,f}$$ equals the two-variable quasi-arithmetic mean $$A_h$$ on I, where $$h:=(\varphi ^*)^{-1}\circ \varphi$$.

The implication (iii)$$\Rightarrow$$(i)$$\sim$$(ii) is obvious. Therefore, it remains to prove the implication (ii)$$\Rightarrow$$(iii). Assume that $$(f,g)\in \mathscr {B}_1(I)$$. If (ii) holds for some $$\alpha ,\beta ,\gamma \in \mathbb {R}$$, then define the polynomial P by (30) and let $$\psi :=\int (1/P)$$. As we have seen it before, then (i) holds with $$h:=-(\varphi ^*)^{-1}\circ \varphi =-\psi \circ \varphi$$. Therefore,

\begin{aligned} h'=-(\psi '\circ \varphi )\!\cdot \!\varphi ' =-\bigg (\frac{1}{P}\circ \varphi \bigg )\!\cdot \!\bigg (\frac{g}{f}\bigg )' =\frac{W_{f,g}^{1,0}}{(P\circ \varphi )\!\cdot \!f^2}=W_{f,g}^{1,0}. \end{aligned}

This completes the proof of assertion (iii).

To prove the implication (ii)$$\Rightarrow$$(iv), assume that $$(f,g)\in \mathscr {B}_2(I)$$. If (ii) holds for some $$\alpha ,\beta ,\gamma \in \mathbb {R}$$, then Eq. (29) is satisfied, where P is the polynomial defined in (30) and hence $$\frac{1}{f^2}=P\circ \varphi$$. Differentiating this equality once and twice, it follows that

\begin{aligned} -2\frac{f'}{f^3}=(P'\circ \varphi )\!\cdot \!\varphi ' \qquad \text{ and }\qquad \frac{6(f')^2-2ff''}{f^4} =(P''\circ \varphi )\!\cdot \!(\varphi ')^2+(P'\circ \varphi )\!\cdot \!\varphi ''. \end{aligned}

Solving this system of equations with respect to $$P'\circ \varphi$$ and $$P''\circ \varphi$$, we obtain

\begin{aligned} P'\circ \varphi =-2\frac{f'}{f^3\varphi '} \qquad \text{ and }\qquad P''\circ \varphi =\frac{6(f')^2\varphi '-2ff''\varphi '+2ff'\varphi ''}{f^4(\varphi ')^3}. \end{aligned}

On the other hand, we have the following two equalities

\begin{aligned} \varphi '=\bigg (\frac{g}{f}\bigg )'=\frac{fg'-f'g}{f^2} =-\frac{W_{f,g}^{1,0}}{f^2} \end{aligned}

and

\begin{aligned} W^{2,1}_{f,g}=W^{2,1}_{f,f\cdot \varphi } =\left| \begin{array}{ll} f'' &{}\quad f' \\ (f\varphi )'' &{}\quad (f\varphi )' \end{array}\right| =-2(f')^2\varphi '+ff''\varphi '-ff'\varphi ''. \end{aligned}

Therefore, using Lemma 6, we get

\begin{aligned} D_P= & {} (P'\circ \varphi )^2-2(P''\circ \varphi )(P\circ \varphi )\\= & {} \frac{-8(f')^2\varphi '+4ff''\varphi '-4ff'\varphi ''}{(f^2\varphi ')^3} =\frac{4W_{f,g}^{2,1}}{\big (-W_{f,g}^{1,0}\big )^3}, \end{aligned}

which shows that (iv) holds with $$\delta :=-D_P/4$$.

To prove the implication (iv)$$\Rightarrow$$(i), let $$(f,g)\in \mathscr {B}_2(I)$$. If (iv) holds for some real constant $$\delta$$, then

\begin{aligned} \Psi _{f,g}=-\delta (W^{1,0}_{f,g})^2. \end{aligned}
(31)

Let $$Y\in \{f,g\}$$. Then, as we have stated it in Lemma 8, Y is a solution of the second-order homogeneous linear differential equation (20). In view of (31), this differential equation is now of the form

\begin{aligned} Y''=\Phi _{f,g} Y'-\delta (W^{1,0}_{f,g})^2Y. \end{aligned}
(32)

In order to solve this equation, let $$\xi$$ be an arbitrarily fixed point of the interval I, define $$h:I\rightarrow \mathbb {R}$$ by $$h(x):=\int _\xi ^x W^{1,0}_{f,g}$$. Then h is twice differentiable and strictly monotone with a nonvanishing first derivative, hence its inverse is also twice differentiable. Now define $$Z:=Y\circ h^{-1}$$. Then $$Z:h(I)\rightarrow \mathbb {R}$$ is a twice differentiable function and we have $$Y=Z\circ h$$. Differentiating Y once and twice, we get

\begin{aligned} Y'=(Z'\circ h)h'\qquad \text{ and }\qquad Y''=(Z''\circ h)(h')^2+(Z'\circ h)h''. \end{aligned}

On the other hand Y satisfies (32), $$h'=W_{f,g}^{1,0}$$ and $$h''=(W_{f,g}^{1,0})'=W_{f,g}^{2,0}$$ hold on I, hence it follows that

\begin{aligned} (Z''\circ h)\!\cdot \!(W^{1,0}_{f,g})^2+(Z'\circ h)\!\cdot \!W^{2,0}_{f,g} =\frac{W^{2,0}_{f,g}}{W^{1,0}_{f,g}}\!\cdot \!(Z'\circ h)\!\cdot \!W^{1,0}_{f,g}-\delta (W^{1,0}_{f,g})^2\!\cdot \!(Z\circ h). \end{aligned}

This reduces to the equality $$Z''\circ h=-\delta (Z\circ h)$$ on I, which, on the interval h(I), is equivalent to

\begin{aligned} Z''=-\delta Z. \end{aligned}

Thus, we have proved that $$Z:=f\circ h^{-1}$$ and $$Z:=g\circ h^{-1}$$ are solutions to this second-order homogeneous linear differential equation. The functions $$S_{-\delta }$$ and $$C_{-\delta }$$ form a fundamental system of solutions for this differential equation, therefore,

\begin{aligned} (f\circ h^{-1},g\circ h^{-1})\sim (S_{-\delta },C_{-\delta }). \end{aligned}

This shows that the relation (22) is satisfied with $$p:=-\delta$$, hence, from Corollary 9, we conclude that the assertion (i) holds.

To complete the proof of the theorem it suffices to show that (iv) and (v) are equivalent in the class $$\mathscr {B}_2(I)$$. If (iv) holds for some $$\delta \in \mathbb {R}$$, then the differentiability of $$W^{1,0}_{f,g}$$ implies that $$W^{2,1}_{f,g}$$ and hence $$\Psi _{f,g}$$ are differentiable, furthermore,

\begin{aligned} \frac{\Psi _{f,g}}{(W^{1,0}_{f,g})^2}=-\delta . \end{aligned}

Differentiating this equation side by side, we obtain

\begin{aligned} \frac{(W^{1,0}_{f,g})^2\Psi '_{f,g}-2 \Psi _{f,g}W^{1,0}_{f,g}W^{2,0}_{f,g}}{(W^{1,0}_{f,g})^4}=0. \end{aligned}

Simplifying this equality, we can see that (v) must be valid.

Conversely, if $$\Psi _{f,g}$$ is differentiable and (27) holds, that is, $$Y=\Psi _{f,g}$$ solves the first-order homogeneous linear differential equation $$Y'=2\Phi _{f,g}Y$$, then there exists a constant $$\delta$$ such that

\begin{aligned} \Psi _{f,g} =\delta \exp \bigg (2\int \Phi _{f,g}\bigg ) =\delta \exp \bigg (2\int \frac{(W^{1,0}_{f,g})'}{W^{1,0}_{f,g}}\bigg ) =\delta (W^{1,0}_{f,g})^2, \end{aligned}

which implies assertion (iv) immediately. $$\square$$

### Theorem 11

Let $$(f,g)\in \mathscr {B}_0(I)$$. Then the following six assertions are equivalent.

1. (i)

There exists a continuous strictly monotone function $$h:I\rightarrow \mathbb {R}$$ such that, for all $$n\in \mathbb {N}$$, $$x\in I^n$$ and $$\lambda \in \Lambda _n$$,

\begin{aligned} B_{g,f}(x,\lambda )=A_h(x,\lambda ). \end{aligned}
(33)
2. (ii)

There exists a continuous strictly monotone function $$h:I\rightarrow \mathbb {R}$$ such that, for all $$n\in \mathbb {N}$$ and $$x\in I^n$$,

\begin{aligned} B_{g,f}(x)=A_h(x). \end{aligned}
(34)
3. (iii)

There exists a continuous strictly monotone function $$h:I\rightarrow \mathbb {R}$$ and $$n\ge 3$$ such that, for all $$x\in I^n$$, Eq. (34) holds.

4. (iv)

There exists a continuous strictly monotone function $$h:I\rightarrow \mathbb {R}$$ such that Eq. (33) holds for all $$x\in I^2$$ and $$\lambda \in \Lambda _2$$.

5. (v)

There exist $$t\in \,]0,\frac{1}{2}[\,\cup \,]\frac{1}{2},1[\,$$ and a continuous strictly monotone function $$h:I\rightarrow \mathbb {R}$$ such that Eq. (33) holds for all $$x\in I^2$$ with $$\lambda :=(t,1-t)$$.

6. (vi)

There exist constants $$a,b\in \mathbb {R}$$ such that

\begin{aligned} af+bg=1. \end{aligned}
(35)

Furthermore, if $$(f,g)\in \mathscr {B}_2(I)$$, then any of the statements (i) – (vi) is also equivalent to the condition:

1. (vii)

$$\Psi _{f,g}=0$$.

### Proof

The implications (i)$$\Rightarrow$$(ii), (ii)$$\Rightarrow$$(iii), (i)$$\Rightarrow$$(iv), and (iv)$$\Rightarrow$$(v) are obvious. To see that (iii)$$\Rightarrow$$(v), assume that there exists a continuous strictly monotone function $$h:I\rightarrow \mathbb {R}$$ and $$n\ge 3$$ such that Eq. (34) is satisfied for all $$x\in I^n$$. Let $$y_1,y_2\in I$$ be arbitrary and let $$x_1:=y_1$$, $$(x_2,\dots ,x_n):=(y_2,\dots ,y_2)$$. Applying inequality (34) to the n-tuple $$x=(x_1,\dots ,x_n)$$, we get that

\begin{aligned} \displaystyle B_{g,f}\big ((y_1,y_2),\big (\tfrac{1}{n},\tfrac{n-1}{n}\big )\big ) =A_h\big ((y_1,y_2),\big (\tfrac{1}{n},\tfrac{n-1}{n}\big )\big ) \end{aligned}

is valid for all $$y_1,y_2\in I$$. Therefore, assertion (v) holds with $$t:=\frac{1}{n}$$.

To prove the implication (v)$$\Rightarrow$$(vi), assume that assertion (v) is valid for some continuous strictly monotone function h and $$t\in \,]0,\frac{1}{2}[\,\cup \,]\frac{1}{2},1[\,$$. Then we have that (21) holds, hence, using Corollary 9, we get the existence of constants $$a,b,c,d\in \mathbb {R}$$ with $$ad\ne bc$$ such that (22) holds with $$p=0$$, therefore,

\begin{aligned} 1=C_0\circ h=af+bg \qquad \text{ and }\qquad S_0\circ h=cf+dg. \end{aligned}
(36)

This proves that assertion (vi) is valid.

Now assume that (vi) holds, i.e., there exist constants $$a,b\in \mathbb {R}$$ satisfying (35). This equation yields that $$a^2+b^2>0$$. Define $$h:=-bf+ag$$. Then we have that $$(1,h)\sim (f,g)$$, which implies that the Bajraktarević mean $$B_{g,f}$$ is identical with the Bajraktarević mean $$B_{h,1}$$, which is equal to the quasi-arithmetic mean $$A_h$$. Therefore, (i) holds, and hence all the assertions from (i) to (vi) are equivalent.

To obtain the implication (vi)$$\Rightarrow$$(vii), assume that $$(f,g)\in \mathscr {B}_2(I)$$ and that (vi) holds for some constants $$a,b\in \mathbb {R}$$. Then $$af'+bg'=0$$ such that $$(a,b)\ne (0,0)$$. Therefore, $$f'$$ and $$g'$$ are linearly dependent. Consequently, we get

\begin{aligned} W^{2,1}_{f,g}=W^{1,0}_{f',g'}=0. \end{aligned}

Thus, assertion (vii) is valid.

Finally, it remains to prove the implication (vii)$$\Rightarrow$$(vi). Let (vii) be satisfied. Then f and g form a system of fundamental solutions of the second-order homogeneous linear differential equation (20). In light of assertion (vii), this differential equation reduces to the form

\begin{aligned} Y''=\Phi _{f,g}Y'. \end{aligned}

On the other hand, it is clear that $$Y=1$$ is a solution of this differential equation, therefore it has to be a linear combination of f and g. Hence there exist constants $$a,b\in \mathbb {R}$$ such that (35) is satisfied. $$\square$$