1 Background and motivation

The question about an error one commits replacing an object possessing some properties by an object fulfilling them only approximately is natural and interesting not only in mathematics but also in many other scientific and applied investigations. One of the effective approaches to deal with this question is using the notion of the Ulam type stability.

Let us recall that, say, an equation is called Ulam stable in a class of functions provided each function from this class fulfilling our equation "approximately" is "near" to its actual solution.

The problem of the stability of homomorphisms of metric groups or, in other words, of the Cauchy functional equation

$$\begin{aligned} f(x+y)=f(x)+f(y) \end{aligned}$$
(1)

was posed by S.M. Ulam in 1940. A year later, D.H. Hyers in [36] gave its solution in the case of Banach spaces (the method he used is nowadays known as the direct/Hyers method; other approaches to proving the Ulam stability include, among others, the methods: of invariant means (see [56]), based on sandwich theorems (see [48]), using the concepts of shadowing (see [57]) and Banach limit (see [5])). In subsequent years, the result of Hyers was extended in the following way.

Theorem 1

Let \(E_1\) and \(E_2\) be normed spaces, \(E_2\) be complete, \(c>0\) and \(p\ne 1\). If \(f:E_1\rightarrow E_2\) satisfies

$$\begin{aligned} \Vert f(x+y)-f(x)-f(y)\Vert \le c\left( \Vert x\Vert ^p+\Vert y\Vert ^p\right) , \qquad x,y\in E_1, \end{aligned}$$

then there exists a unique additive mapping \(a:E_1\rightarrow E_2\) such that

$$\begin{aligned} \Vert f(x)-a(x)\Vert \le \frac{c\Vert x\Vert ^p}{|1-2^{p-1}|}, \qquad x\in E_1. \end{aligned}$$

Theorem 1 is composed of the classical outcomes obtained by T. Aoki in [3] and Th.M. Rassias in [53] (for \(0\le p<1\)), Z. Gajda in [30] (for \(p>1\)) and Th.M. Rassias in [54] (for \(p<0\)). Let us yet recall (see [30]) that for \(p=1\) an analogous result is not valid, and that a further generalization of Hyers’ outcome was suggested by D.G. Bourgin in [9].

More classical results on the stability of functional equations can be found for example in survey papers [10, 11, 17] and books [12, 39].

Let us also mention here about a very important and interesting example of such problems which is a question concerning the stability of isometries. It was studied for instance in [15, 25, 27, 31, 32, 37, 44, 47, 49, 58] (see also [46] for more information and references on this topic).

In recent years, the Ulam stability of various objects (for example functional equations and inequalities, differential, difference and integral equations, flows, groups, random dynamics, vector measures, and C*-algebras) has been studied by many researchers (for more information on this notion as well as its applications we refer the reader to papers [4, 7, 8, 10, 13, 14, 22, 23, 26, 28, 29, 33, 34, 40, 42, 45, 46] and books [12, 39]).

In this paper, we prove the generalized, in the spirit of Bourgin, Ulam stability of two general functional equations in several variables in Banach spaces. To do this, we use a variant of the fixed point method (see [52]), namely we apply a fixed point result of J.B. Diaz and B. Margolis from [24] (more information about the interplay between the fixed point theory and the Ulam stability one can find in survey papers [11, 17]).

We also get, as corollaries from our main results, several outcomes on the stability of a few important and studied for years equations.

Throughout the paper \(\mathbb {N}\) stands for the set of all positive integers and we put \(\mathbb {N}_0 :=\mathbb {N}\cup \{0\}\). Moreover, we assume that \(n\in \mathbb {N}\), X is a linear space over the field \(\mathbb {F}\), and Y is a linear space over the field \(\mathbb {K}\).

2 Perturbations of the first equation

2.1 Introduction

Let \(a_{11},a_{12},\ldots ,a_{n1},a_{n2}\in \mathbb {F}\) and \(A_{i_1,\ldots ,i_n}\in \mathbb {K}\) for \(i_1,\ldots ,i_n\in \{1,2\}\) be given scalars.

In this section, we deal with the following functional equation

$$\begin{aligned} \begin{array}{cc} f(a_{11}x_{11}+a_{12}x_{12},\ldots , a_{n1}x_{n1}+a_{n2}x_{n2})&{}\\ &{}\\ =\sum _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}f(x_{1{i_1}},\ldots ,x_{ni_n}). \end{array} \end{aligned}$$
(2)

Let us mention that every n-linear mapping is a solution of equation (2) (see [19]). The particular cases of (2) include:

– the functional equation

$$\begin{aligned} f(x_{11}+x_{12},\ldots , x_{n1}+x_{n2})=\sum _{i_1,\ldots ,i_n\in \{1,2\}} f(x_{1{i_1}},\ldots ,x_{ni_n}), \end{aligned}$$
(3)

which (see [16]) characterizes multi-additive mappings, introduced by S. Mazur and W. Orlicz (see for example [43], where one can also find their application to the representation of polynomial mappings). The stability of equation (3) was studied for example in [6, 16].

– the linear functional equation

$$\begin{aligned} f(a_1x_1+a_2x_2)=A_1f(x_1)+A_2f(x_2), \end{aligned}$$
(4)

whose special cases are, among others, the classical Cauchy and Jensen functional equations (a lot of information about them as well as their applications can be found in [41, 43]), i.e. equation (1) and the equation

$$\begin{aligned} f\Big (\frac{x+y}{2}\Big )=\frac{f(x)+f(y)}{2}, \end{aligned}$$
(5)

which is closely connected with the notion of a convex function. A lot of classical results on the Ulam type stability of equations (1) and (5) can be found in book [39], while some very recent stability outcomes on equation (4) were published for instance in [1, 2, 51].

For more examples of special cases of equation (2) we refer the reader to [18, 19, 39].

Let us yet put

$$\begin{aligned} A:=\sum _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n},\qquad a_i:=a_{i1}+a_{i2},\quad i\in \{1,\ldots ,n\} \end{aligned}$$

and assume that \(A\ne 0\).

2.2 Main result

In this section, the perturbations/approximate solutions/generalized Ulam stability of functional equation (2) is considered.

To do this, let us recall that a pair (Gd) is said to be a generalized metric space provided G is a nonempty set and \(d :G\times G\rightarrow [0,\, \infty ]\) is a function satisfying the standard metric axioms.

The following result from [24] plays a crucial role in the proof of the main results of this paper.

Proposition 2

Assume that \(({\mathcal {G}}, d)\) is a complete generalized metric space and \(T:{\mathcal {G}}\rightarrow {\mathcal {G}}\) is a strictly contractive operator with the Lipschitz constant \(L<1\). If there are \(n_0\in \mathbb {N}_0\) and \(x\in {\mathcal {G}}\) such that \(d(T^{n_{0}+1}x,\, T^{n_{0}}x)<\infty \), then:

(i) the sequence \((T^j x)_{j\in \mathbb {N}}\) is convergent, and its limit \(x^*\) is a fixed point of the operator T;

(ii) \(x^*\) is the unique fixed point of T in the set

$$\begin{aligned} {\mathcal {G}}^*:=\{y\in {\mathcal {G}}: d(T^{n_{0}}x, y)<\infty \}; \end{aligned}$$

(iii) if \(y\in {\mathcal {G}}^*\), then

$$\begin{aligned} d(y, x^*)\le \frac{1}{1-L}d(Ty, y). \end{aligned}$$

The main result of this section is the following.

Theorem 3

Assume that Y is a Banach space and \(\varphi :X^{2n}\rightarrow [0, \infty )\) is a mapping such that

$$\begin{aligned}&\lim _{j\rightarrow \infty }\frac{1}{|A|^{j}}\varphi (a_1^{j}x_{11} , a_1^{j}x_{12} , \ldots , a_n^{j}x_{n1}, a_n^{j}x_{n2})=0, \nonumber \\&\quad \qquad (x_{11}, x_{12}, \ldots , x_{n1}, x_{n2})\in X^{2n} \end{aligned}$$
(6)

and

$$\begin{aligned}&\varphi (a_1x_{11}, a_1x_{11}, \ldots , a_nx_{n1}, a_nx_{n1})\le |A|L\varphi (x_{11}, x_{11}, \ldots , x_{n1}, x_{n1}), \nonumber \\&\quad \qquad (x_{11} , \ldots , x_{n1})\in X^{n} \end{aligned}$$
(7)

for an \(L\in (0, 1)\). If \(f:X^{n} \rightarrow Y\) is a function satisfying

$$\begin{aligned}&\bigg \Vert f(a_{11}x_{11}+a_{12}x_{12},\ldots , a_{n1}x_{n1}+a_{n2}x_{n2})\nonumber \\&\qquad -\sum _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}f(x_{1{i_1}},\ldots ,x_{ni_n})\bigg \Vert \\&\quad \le \varphi (x_{11},\, x_{12},\, \ldots ,\, x_{n1},\, x_{n2})\nonumber \end{aligned}$$
(8)

for \((x_{11},\, x_{12},\, \ldots ,\, x_{n1},\, x_{n2})\in X^{2n}\), then there exists a unique solution \(F :X^{n}\rightarrow Y\) of equation (2) for which

$$\begin{aligned}&\Vert f(x_{1} , \ldots , x_{n})-F(x_{1} , \ldots , x_{n})\Vert \le \frac{1}{|A|(1-L)}\varphi (x_{1}, x_{1}, \ldots , x_{n}, x_{n}), \nonumber \\&\qquad (x_{1} , \ldots , x_{n})\in X^{n}. \end{aligned}$$
(9)

The mapping F is given by

$$\begin{aligned} F(x_{1},\ldots ,x_{n}):=\lim _{j\rightarrow \infty }\frac{f(a_1^jx_{1},\ldots ,a_n^jx_{n})}{A^{j}},\qquad (x_{1},\ldots ,x_{n})\in X^n. \end{aligned}$$
(10)

Proof

Let us consider a complete generalized metric space \(({\mathcal {G}}, d)\), where

$$\begin{aligned} {\mathcal {G}}:=Y^{X^{n}} \end{aligned}$$

and

$$\begin{aligned}&d (g, h):=\inf \{C\in [0, \infty ]: \Vert g(x_1 , \ldots , x_{n})-h(x_1 , \ldots , x_{n})\Vert \\&\le C\varphi (x_1 , x_1, \ldots , x_{n}, x_n ),\, (x_1 , \ldots , x_{n})\in X^{n}\},\qquad g, h\in {\mathcal {G}}. \end{aligned}$$

Put also

$$\begin{aligned} T g(x_1 , \ldots , x_{n}):=\frac{1}{A}g(a_1x_1 , \ldots , a_nx_{n}),\qquad g\in {\mathcal {G}},\, (x_1 , \ldots , x_{n})\in X^{n}. \end{aligned}$$

We show that \(T:{\mathcal {G}}\rightarrow {\mathcal {G}}\) is a strictly contractive operator with the Lipschitz constant L. To do this, fix \(g, h\in {\mathcal {G}}\), \((x_1 , \ldots , x_{n})\in X^{n}\) and \(C_{g,h}\in [0, \infty ]\) with \(d (g, h)\le C_{g,h}\). Then

$$\begin{aligned} \Vert g(x_1 , \ldots , x_{n})-h(x_1 , \ldots , x_{n})\Vert \le C_{g,h}\varphi (x_1 , x_1 , \ldots , x_{n}, x_n ), \end{aligned}$$
(11)

which together with (7) gives

$$\begin{aligned}&\Vert T g(x_1 , \ldots , x_{n})- T h(x_1 , \ldots , x_{n})\Vert \\&\quad =\frac{1}{|A|}\Vert g(a_1x_1 , \ldots , a_nx_{n})-h(a_1x_1 , \ldots , a_nx_{n})\Vert \\&\quad \le \frac{1}{|A|}C_{g,h}\varphi (a_1x_1 , a_1x_{1}, \ldots , a_nx_{n}, a_nx_n ) \\&\quad \le LC_{g,h}\varphi (x_1 , x_{1}, \ldots , x_{n}, x_n ), \end{aligned}$$

and consequently \(d (T g, T h)\le L C_{g,h}\). Therefore \(d (T g, T h)\le L d (g,h)\), as claimed.

Let us next observe that from (8) it follows that

$$\begin{aligned}&\Vert T f(x_1 , \ldots , x_{n})-f(x_1 , \ldots , x_{n})\Vert =\left\| \frac{1}{A}f(a_1x_1 , \ldots , a_nx_{n})-f(x_1 , \ldots , x_{n})\right\| \\&\quad \le \frac{1}{|A|}\varphi (x_1 , x_{1}, \ldots , x_{n}, x_n ), \end{aligned}$$

and thus

$$\begin{aligned} d(T f, f)\le \frac{1}{|A|}<\infty . \end{aligned}$$
(12)

We can now apply Proposition 2 for the space \(({\mathcal {G}}, d)\), the operator T, \(n_0=0\) and \(x=f\) to deduce that the sequence \((T ^j f)_{j\in \mathbb {N}}\) is convergent in \(({\mathcal {G}}, d)\) and its limit F is a fixed point of T.

Thus

$$\begin{aligned} F(x_1 , \ldots , x_{n})=\lim _{j\rightarrow \infty } T^j f(x_1 , \ldots , x_{n}) \end{aligned}$$
(13)

and

$$\begin{aligned} \frac{1}{A}F(a_1x_1 , \ldots , a_nx_{n})=F(x_1 , \ldots , x_{n}). \end{aligned}$$
(14)

Since, by induction, we also have

$$\begin{aligned} T^j f(x_1 , \ldots , x_{n})=\frac{1}{A^{j}}f\left( a_1^j x_1 , \ldots , a_n^j x_{n}\right) ,\qquad j\in \mathbb {N}, \end{aligned}$$

(10) follows.

Next, note that obviously \(f\in {\mathcal {G}}^*\), and therefore Proposition 2(iii) and (12) imply

$$\begin{aligned} d(f, F)\le \frac{1}{1-L}d(T f, f)\le \frac{1}{|A|(1-L)}, \end{aligned}$$

which proves (9).

Let us now observe that from (8) we get

$$\begin{aligned}&\Big \Vert \frac{f(a_1^j(a_{11}x_{11}+a_{12}x_{12}),\ldots , a_n^j(a_{n1}x_{n1}+a_{n2}x_{n2}))}{A^j} \\&\qquad -\sum _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}\frac{f(a_1^jx_{1{i_1}},\ldots ,a_n^jx_{ni_n})}{A^j}\Big \Vert \\&\quad \le \frac{\varphi (a_1^{j}x_{11} , a_1^{j}x_{12} , ..., a_n^{j}x_{n1}, a_n^{j}x_{n2})}{|A|^j} \end{aligned}$$

for \((x_{11},x_{12},\ldots , x_{n1},x_{n2})\in X^{2n}\) and \(j\in \mathbb {N}_0\). Letting \(j\rightarrow \infty \), and applying (6) and (10) we deduce hence that

$$\begin{aligned} \begin{array}{ll} \bigg \Vert F(a_{11}x_{11}+a_{12}x_{12},\ldots , a_{n1}x_{n1}+a_{n2}x_{n2})&{}\\ &{}\\ -\sum _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}F(x_{1{i_1}},\ldots ,x_{ni_n})\bigg \Vert \le 0 \end{array} \end{aligned}$$

for \((x_{11},x_{12},\ldots , x_{n1},x_{n2})\in X^{2n}\), and thus we see that the mapping \(F:X^n\rightarrow Y\) is a solution of functional equation (2).

Let us finally suppose that \(F' :X^{n}\rightarrow Y\) is a solution of equation (2) fulfilling inequality (9). Then \(F'\) satisfies (14), and therefore it is a fixed point of the operator T. Furthermore, by (9), we obtain

$$\begin{aligned} d(f, F')\le \frac{1}{|A|(1-L)}<\infty , \end{aligned}$$

and consequently \(F'\in {\mathcal {G}}^*\). Proposition 2(ii) now shows that \(F' =F\). \(\square \)

2.3 Corollaries

Now, we present some consequences of Theorem 3.

First, consider the case \(a_{11}=a_{12}=\ldots =a_{n1}=a_{n2}=1\) and \(A_{i_1,\ldots ,i_n}=1\) for \(i_1,\ldots ,i_n\in \{1,2\}\). Then from Theorem 3 we get the following outcome on the generalized Ulam stability of functional equation (3).

Corollary 4

Assume that Y is a Banach space and \(\varphi :X^{2n}\rightarrow [0, \infty )\) is a mapping such that

$$\begin{aligned}&\lim _{j\rightarrow \infty }\frac{1}{2^{jn}}\varphi \left( 2^{j}x_{11} , 2^{j}x_{12} , \ldots , 2^{j}x_{n1}, 2^{j}x_{n2}\right) =0, \\&\qquad \left( x_{11}, x_{12}, \ldots , x_{n1}, x_{n2}\right) \in X^{2n} \end{aligned}$$

and

$$\begin{aligned}&\varphi \left( 2x_{11}, 2x_{11}, \ldots , 2x_{n1}, 2x_{n1}\right) \le 2^nL\varphi \left( x_{11}, x_{11}, \ldots , x_{n1}, x_{n1}\right) ,\\&\qquad (x_{11} , \ldots , x_{n1})\in X^{n} \end{aligned}$$

for an \(L\in (0, 1)\). If \(f:X^{n} \rightarrow Y\) is a function satisfying

$$\begin{aligned} \begin{array}{ll} \bigg \Vert f(x_{11}+x_{12},\ldots , x_{n1}+x_{n2})-\sum _{i_1,\ldots ,i_n\in \{1,2\}} f(x_{1{i_1}},\ldots ,x_{ni_n})\bigg \Vert \\ &{}\\ \le \varphi (x_{11},\, x_{12},\, \ldots ,\, x_{n1},\, x_{n2}) \end{array} \end{aligned}$$

for \((x_{11},\, x_{12},\, \ldots ,\, x_{n1},\, x_{n2})\in X^{2n}\), then there exists a unique solution \(F :X^{n}\rightarrow Y\) of equation (3) for which

$$\begin{aligned}&\Vert f(x_{1} , \ldots , x_{n})-F(x_{1} , \ldots , x_{n})\Vert \le \frac{1}{2^n(1-L)}\varphi (x_{1}, x_{1}, \ldots , x_{n}, x_{n}), \\&(x_{1} , \ldots , x_{n})\in X^{n}. \end{aligned}$$

The mapping F is given by

$$\begin{aligned} F(x_{1},\ldots ,x_{n}):=\lim _{j\rightarrow \infty }\frac{f\left( 2^jx_{1},\ldots ,2^jx_{n}\right) }{2^{jn}},\qquad (x_{1},\ldots ,x_{n})\in X^n. \end{aligned}$$
(15)

Theorem 3 (for \(L:=\frac{1}{|A|}\)) and Corollary 4 (for \(L:=\frac{1}{2^n}\)) with \(\varphi :\equiv \varepsilon \) for an \(\varepsilon >0\) immediately give the following two results on the classical Ulam stability of equations (2) and (3).

Corollary 5

Assume that Y is a Banach space, \(|A|>1\) and \(\varepsilon >0\). If \(f:X^n\rightarrow Y\) is a function satisfying

$$\begin{aligned} \begin{array}{ll} \bigg \Vert f(a_{11}x_{11}+a_{12}x_{12},\ldots , a_{n1}x_{n1}+a_{n2}x_{n2})&{}\\ &{}\\ -\sum _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}f(x_{1{i_1}},\ldots ,x_{ni_n})\bigg \Vert \le \varepsilon \end{array} \end{aligned}$$

for \((x_{11},x_{12},\ldots , x_{n1},x_{n2})\in X^{2n}\), then there is a unique solution \(F:X^n\rightarrow Y\) of equation (2) such that

$$\begin{aligned} \Vert f(x_1,\ldots ,x_n)-F(x_1,\ldots ,x_n)\Vert \le \frac{\varepsilon }{|A|-1} ,\qquad (x_{1},\ldots , x_{n})\in X^n. \end{aligned}$$
(16)

The mapping F is given by (10).

Corollary 6

Assume that Y is a Banach space and \(\varepsilon >0\). If \(f:X^n\rightarrow Y\) is a function satisfying

$$\begin{aligned} \Vert f(x_{11}+x_{12},\ldots , x_{n1}+x_{n2})-\sum _{i_1,\ldots ,i_n\in \{1,2\}} f(x_{1{i_1}},\ldots ,x_{ni_n})\Vert \le \varepsilon \end{aligned}$$

for \((x_{11},x_{12},\ldots , x_{n1},x_{n2})\in X^{2n}\), then there is a unique solution \(F:X^n\rightarrow Y\) of equation (3) such that

$$\begin{aligned} \Vert f(x_1,\ldots ,x_n)-F(x_1,\ldots ,x_n)\Vert \le \frac{\varepsilon }{2^n-1} ,\qquad (x_{1},\ldots , x_{n})\in X^n. \end{aligned}$$

The mapping F is given by (15).

Let us next note that Corollary 5 is a generalization of Theorem 2.1 in [18], and thus a few further known results (see [18] for the details).

Remark 7

Theorem 3 and Corollary 5 with \(n=1\) give obviously the stability outcomes on functional equations (1), (4) and (5), including the classical ones from [9, 36].

3 Perturbations of the second equation

3.1 Introduction

Now, assume that \(a_{1,j_1,\ldots ,j_n},\ldots ,a_{n,j_1,\ldots ,j_n}\in \mathbb {F}\) for \(j_1,\ldots ,j_n \in \{-1,1\}\) and \(A_{i_1,\ldots ,i_n}\in \mathbb {K}\) for \(i_1,\ldots ,i_n\in \{1,2\}\) are given scalars. Moreover, let

$$\begin{aligned} A:=\sum _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}\ne 0. \end{aligned}$$

In the second part of the paper, we deal with the following functional equation

$$\begin{aligned} \begin{array}{cc} \sum _{j_1,\ldots ,j_n \in \{-1,1\}} f\left( a_{1,j_1,\ldots ,j_n}(x_{11}+j_1 x_{12}),\ldots , a_{n,j_1,\ldots ,j_n}(x_{n1}+j_n x_{n2})\right) &{}\\ &{}\\ =\sum _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}f(x_{1{i_1}},\ldots ,x_{ni_n}). \end{array} \end{aligned}$$
(17)

Its special cases are for example:

– the well-known Jordan-von Neumann equation

$$\begin{aligned} q(x+y)+q(x-y)=2q(x)+2q(y), \end{aligned}$$
(18)

which is useful, among others, in some characterizations of inner product spaces. Solutions of (18) are called quadratic mappings (for more information about these mappings, other applications and the Ulam stability of equation (18) we refer the reader for example to books [39, 41]).

– the functional equation

$$\begin{aligned} \begin{array}{cc} \sum _{j_1,\ldots ,j_n \in \{-1,1\}} Q(x_{11}+j_1 x_{12},\ldots , x_{n1}+j_n x_{n2})&{}\\ &{}\\ =\sum _{i_1,\ldots ,i_n\in \{1,2\}} 2^n Q(x_{1{i_1}},\ldots ,x_{ni_n}), \end{array} \end{aligned}$$
(19)

which (see [38, 59], where its Ulam type stability is also investigated) characterizes the so-called n-quadratic mappings.

3.2 Main result

In this section, we prove the generalized Ulam stability of functional equation (17).

Theorem 8

Assume that Y is a Banach space and \(\varphi :X^{2n}\rightarrow [0, \infty )\) is a mapping such that

$$\begin{aligned} \begin{array}{cc} \lim _{j\rightarrow \infty }\frac{1}{|A|^{j}}\varphi \big ((2a_{1,1,\ldots ,1})^{j}x_{11} , (2a_{1,1,\ldots ,1})^{j}x_{12} , \ldots ,&{}\\ &{}\\ (2a_{n,1,\ldots ,1})^{j}x_{n1}, (2a_{n,1,\ldots ,1})^{j}x_{n2}\big )=0,&{}\\ &{}\\ (x_{11}, x_{12}, \ldots , x_{n1}, x_{n2})\in X^{2n} \end{array} \end{aligned}$$
(20)

and

$$\begin{aligned} \begin{array}{cc} \varphi (2a_{1,1,\ldots ,1}x_{11}, 2a_{1,1,\ldots ,1}x_{11}, \ldots , 2a_{n,1,\ldots ,1}x_{n1}, 2a_{n,1,\ldots ,1}x_{n1})&{}\\ &{}\\ \le |A|L\varphi (x_{11}, x_{11}, \ldots , x_{n1}, x_{n1}),\qquad (x_{11} , \ldots , x_{n1})\in X^{n} \end{array} \end{aligned}$$
(21)

for an \(L\in (0, 1)\). If \(f:X^n\rightarrow Y\) is a function such that \(f(x_{1},\ldots ,x_{n})=0\) for any \((x_{1},\ldots ,x_{n})\in X^n\) with at least one component which is equal to zero and

$$\begin{aligned}&\Big \Vert \sum _{j_1,\ldots ,j_n \in \{-1,1\}} f(a_{1,j_1,\ldots ,j_n}(x_{11}+j_1 x_{12}),\ldots , a_{n,j_1,\ldots ,j_n}(x_{n1}+j_n x_{n2})) \nonumber \\&\qquad -\sum _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}f(x_{1{i_1}},\ldots ,x_{ni_n})\Big \Vert \nonumber \\&\quad \le \varphi (x_{11},\, x_{12},\, \ldots ,\, x_{n1},\, x_{n2}) \end{aligned}$$
(22)

for \((x_{11},\, x_{12},\, \ldots ,\, x_{n1},\, x_{n2})\in X^{2n}\), then there exists a unique solution \(F :X^{n}\rightarrow Y\) of equation (17) such that inequality (9) holds and \(F(x_{1},\ldots ,x_{n})=0\) for any \((x_{1},\ldots ,x_{n})\in X^n\) with at least one component which is equal to zero. The mapping F is given by

$$\begin{aligned} \begin{array}{cc} F(x_{1},\ldots ,x_{n})=\lim _{j\rightarrow \infty }\frac{1}{A^{j}}f\big ((2a_{1,1,\ldots ,1})^jx_{1},\ldots , (2a_{n,1,\ldots ,1})^jx_{n}\big ),&{}\\ &{}\\ (x_{1},\ldots ,x_{n})\in X^n. \end{array} \end{aligned}$$
(23)

Proof

Let us consider a complete generalized metric space \(({\mathcal {G}}, d)\), where

$$\begin{aligned} {\mathcal {G}}:=\{f:X^n\rightarrow Y: f(x_{1},\ldots ,x_{n})=0\; \mathrm{for \; any} \; (x_{1},\ldots ,x_{n})\in X^n \\ \mathrm{with \; at \; least \; one \; component}\; \mathrm{which \; is \; equal \; to \; zero}\} \end{aligned}$$

and d is as in the proof of Theorem 3. Put also

$$\begin{aligned}&T g(x_1 , \ldots , x_{n}):=\frac{1}{A}g(2a_{1,1,\ldots ,1}x_1 , \ldots , 2a_{n,1,\ldots ,1}x_{n}), \\&\qquad g\in {\mathcal {G}},\, (x_1 , \ldots , x_{n})\in X^{n}. \end{aligned}$$

We show that \(T:{\mathcal {G}}\rightarrow {\mathcal {G}}\) is a strictly contractive operator with the Lipschitz constant L. To do this, fix \(g, h\in {\mathcal {G}}\), \((x_1 , \ldots , x_{n})\in X^{n}\) and \(C_{g,h}\in [0, \infty ]\) with \(d (g, h)\le C_{g,h}\). Then (11) holds, which together with (21) gives

$$\begin{aligned}&\Vert T g(x_1 , \ldots , x_{n})- T h(x_1 , \ldots , x_{n})\Vert \\&\quad =\frac{1}{|A|}\bigg \Vert g(2a_{1,1,\ldots ,1}x_1 , \ldots , 2a_{n,1,\ldots ,1}x_{n})-h(2a_{1,1,\ldots ,1}x_1 , \ldots , 2a_{n,1,\ldots ,1}x_{n})\bigg \Vert \\&\quad \le \frac{1}{|A|}C_{g,h}\varphi (2a_{1,1,\ldots ,1}x_1, 2a_{1,1,\ldots ,1}x_{1}, \ldots , 2a_{n,1,\ldots ,1}x_{n}, 2a_{n,1,\ldots ,1}x_n ) \\&\quad \le LC_{g,h}\varphi (x_1 , x_{1}, \ldots , x_{n}, x_n ), \end{aligned}$$

and thus T is strictly contractive with the constant L.

Let us next observe that from (22) and the fact that \(f(x_{1},\ldots ,x_{n})=0\) for any \((x_{1},\ldots ,x_{n})\in X^n\) with at least one component which is equal to zero it follows that

$$\begin{aligned}&\Vert T f(x_1 , \ldots , x_{n})-f(x_1 , \ldots , x_{n})\Vert \\&\quad =\bigg \Vert \frac{1}{A}f(2a_{1,1,\ldots ,1}x_1 , \ldots , 2a_{n,1,\ldots ,1}x_{n})-f(x_1 , \ldots , x_{n})\bigg \Vert \\&\quad \le \frac{1}{|A|}\varphi (x_1 , x_{1}, \ldots , x_{n}, x_n ), \end{aligned}$$

and thus (12) holds true. From Proposition 2 we see that the sequence \((T ^j f)_{j\in \mathbb {N}}\) is convergent in \(({\mathcal {G}}, d)\) and its limit F is a fixed point of T.

Therefore, we get (13) and

$$\begin{aligned} \frac{1}{A}F\left( 2a_{1,1,\ldots ,1}x_1 , \ldots , 2a_{n,1,\ldots ,1}x_{n}\right) =F(x_1 , \ldots , x_{n}). \end{aligned}$$
(24)

Since, by induction, we also have

$$\begin{aligned} T^j f(x_1 , \ldots , x_{n})=\frac{1}{A^{j}}f\left( (2a_{1,1,\ldots ,1})^j x_1 , \ldots , (2a_{n,1,\ldots ,1})^j x_{n}\right) ,\qquad j\in \mathbb {N}, \end{aligned}$$

(23) follows.

Let us now observe that inequality (9) can be shown as in the proof of Theorem 3.

Next, from (22) we get

$$\begin{aligned}&\Big \Vert \sum _{j_1,\ldots ,j_n \in \{-1,1\}} \frac{1}{A^j}f\big ((2a_{1,1,\ldots ,1})^{j}a_{1,j_1,\ldots ,j_n}(x_{11}+j_1 x_{12}),\ldots ,\\&(2a_{n,1,\ldots ,1})^{j}a_{n,j_1,\ldots ,j_n}(x_{n1}+j_n x_{n2})\big )\\&\qquad -\sum _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}\frac{1}{A^j}f\big ((2a_{1,1,\ldots ,1})^jx_{1{i_1}},\ldots ,(2a_{n,1,\ldots ,1})^jx_{ni_n}\big )\Big \Vert \\&\quad \le \frac{1}{|A|^j}\varphi \big ((2a_{1,1,\ldots ,1})^{j}x_{11} , (2a_{1,1,\ldots ,1})^{j}x_{12} , \ldots ,\\&(2a_{n,1,\ldots ,1})^{j}x_{n1}, (2a_{n,1,\ldots ,1})^{j}x_{n2}\big ) \end{aligned}$$

for \((x_{11},x_{12},\ldots , x_{n1},x_{n2})\in X^{2n}\) and \(j\in \mathbb {N}_0\). Letting \(j\rightarrow \infty \), and applying (20) and (23) we deduce hence that the mapping \(F:X^n\rightarrow Y\) is a solution of functional equation (17).

Let us finally suppose that \(F' :X^{n}\rightarrow Y\) is a solution of equation (17) such that inequality (9) holds and \(F'(x_{1},\ldots ,x_{n})=0\) for any \((x_{1},\ldots ,x_{n})\in X^n\) with at least one component which is equal to zero. Then \(F'\) satisfies (24), and therefore it is a fixed point of the operator T. As in the proof of Theorem 3 we now conclude that \(F' =F\).

\(\square \)

3.3 Corollaries

Now, we present some consequences of Theorem 8.

First, consider the case \(a_{1,j_1,\ldots ,j_n}=\ldots =a_{n,j_1,\ldots ,j_n}=1\) for \(j_1,\ldots ,j_n \in \{-1,1\}\) and \(A_{i_1,\ldots ,i_n}=2^n\) for \(i_1,\ldots ,i_n\in \{1,2\}\). Then from Theorem 8 we get the following outcome on the generalized Ulam stability of functional equation (19).

Corollary 9

Assume that Y is a Banach space and \(\varphi :X^{2n}\rightarrow [0, \infty )\) is a mapping such that

$$\begin{aligned} \begin{array}{cc} \lim _{j\rightarrow \infty }\frac{1}{4^{jn}}\varphi \big (2^{j}x_{11} , 2^{j}x_{12} , \ldots , 2^{j}x_{n1}, 2^{j}x_{n2}\big )=0,&{}\\ &{}\\ (x_{11}, x_{12}, \ldots , x_{n1}, x_{n2})\in X^{2n} \end{array} \end{aligned}$$

and

$$\begin{aligned} \begin{array}{cc} \varphi (2x_{11}, 2x_{11}, \ldots , 2x_{n1}, 2x_{n1})\le 4^nL\varphi (x_{11}, x_{11}, \ldots , x_{n1}, x_{n1}),&{}\\ &{}\\ (x_{11} , \ldots , x_{n1})\in X^{n} \end{array} \end{aligned}$$

for an \(L\in (0, 1)\). If \(f:X^n\rightarrow Y\) is a function such that \(f(x_{1},\ldots ,x_{n})=0\) for any \((x_{1},\ldots ,x_{n})\in X^n\) with at least one component which is equal to zero and

$$\begin{aligned} \begin{array}{cc} \Big \Vert \sum _{j_1,\ldots ,j_n \in \{-1,1\}} f(x_{11}+j_1 x_{12},\ldots , x_{n1}+j_n x_{n2})&{}\\ &{}\\ -\sum _{i_1,\ldots ,i_n\in \{1,2\}} 2^nf(x_{1{i_1}},\ldots ,x_{ni_n})\Big \Vert \le \varphi (x_{11},\, x_{12},\, \ldots ,\, x_{n1},\, x_{n2}) \end{array} \end{aligned}$$

for \((x_{11},\, x_{12},\, \ldots ,\, x_{n1},\, x_{n2})\in X^{2n}\), then there exists a unique solution \(F :X^{n}\rightarrow Y\) of equation (19) such that \(F(x_{1},\ldots ,x_{n})=0\) for any \((x_{1},\ldots ,x_{n})\in X^n\) with at least one component which is equal to zero and

$$\begin{aligned} \begin{array}{cc} \Vert f(x_{1} , \ldots , x_{n})-F(x_{1} , \ldots , x_{n})\Vert \le \frac{1}{4^n(1-L)}\varphi (x_{1}, x_{1}, \ldots , x_{n}, x_{n}),&{}\\ &{}\\ (x_{1} , \ldots , x_{n})\in X^{n}. \end{array} \end{aligned}$$

The mapping F is given by

$$\begin{aligned} F(x_{1},\ldots ,x_{n}):=\lim _{j\rightarrow \infty }\frac{f(2^jx_{1},\ldots ,2^jx_{n})}{4^{jn}},\qquad (x_{1},\ldots ,x_{n})\in X^n. \end{aligned}$$
(25)

Theorem 8 (for \(L:=\frac{1}{|A|}\)) and Corollary 9 (for \(L:=\frac{1}{4^n}\)) with \(\varphi :\equiv \varepsilon \) for an \(\varepsilon >0\) immediately give the following two results on the classical Ulam stability of equations (17) and (19).

Corollary 10

Assume that Y is a Banach space, \(|A|>1\) and \(\varepsilon >0\). If \(f:X^n\rightarrow Y\) is a function such that \(f(x_{1},\ldots ,x_{n})=0\) for any \((x_{1},\ldots ,x_{n})\in X^n\) with at least one component which is equal to zero and

$$\begin{aligned} \begin{array}{ll} \Big \Vert \sum _{j_1,\ldots ,j_n \in \{-1,1\}} f(a_{1,j_1,\ldots ,j_n}(x_{11}+j_1 x_{12}),\ldots , a_{n,j_1,\ldots ,j_n}(x_{n1}+j_n x_{n2}))&{}\\ &{}\\ -\sum _{i_1,\ldots ,i_n\in \{1,2\}} A_{i_1,\ldots ,i_n}f(x_{1{i_1}},\ldots ,x_{ni_n})\Big \Vert \le \varepsilon \end{array} \end{aligned}$$

for \((x_{11},\, x_{12},\, \ldots ,\, x_{n1},\, x_{n2})\in X^{2n}\), then there exists a unique solution \(F :X^{n}\rightarrow Y\) of equation (17) such that inequality (16) holds and \(F(x_{1},\ldots ,x_{n})=0\) for any \((x_{1},\ldots ,x_{n})\in X^n\) with at least one component which is equal to zero. The mapping F is given by (23).

Corollary 11

Assume that Y is a Banach space and \(\varepsilon >0\). If \(f:X^n\rightarrow Y\) is a function such that \(f(x_{1},\ldots ,x_{n})=0\) for any \((x_{1},\ldots ,x_{n})\in X^n\) with at least one component which is equal to zero and

$$\begin{aligned} \begin{array}{cc} \Big \Vert \sum _{j_1,\ldots ,j_n \in \{-1,1\}} f(x_{11}+j_1 x_{12},\ldots , x_{n1}+j_n x_{n2})&{}\\ &{}\\ -\sum _{i_1,\ldots ,i_n\in \{1,2\}} 2^nf(x_{1{i_1}},\ldots ,x_{ni_n})\Big \Vert \le \varepsilon \end{array} \end{aligned}$$

for \((x_{11},\, x_{12},\, \ldots ,\, x_{n1},\, x_{n2})\in X^{2n}\), then there exists a unique solution \(F :X^{n}\rightarrow Y\) of equation (19) such that \(F(x_{1},\ldots ,x_{n})=0\) for any \((x_{1},\ldots ,x_{n})\in X^n\) with at least one component which is equal to zero and

$$\begin{aligned} \Vert f(x_1,\ldots ,x_n)-F(x_1,\ldots ,x_n)\Vert \le \frac{\varepsilon }{4^n-1} ,\qquad (x_{1},\ldots , x_{n})\in X^n. \end{aligned}$$

The mapping F is given by (25).

Let us next note that Corollary 10 is a generalization of Theorem 1 in [20], and thus the main result in [50] too.

Theorem 8 with \(n=2\), \(a_{1,1,1}=a_{2,1,1}=a_{1,-1,-1}=a_{2,-1,-1}=1\), \(a_{1,1,-1}=a_{2,1,-1}=a_{1,-1,1}=a_{2,-1,1}=0\), \(A_{1,1}=A_{1,2}=2\) and \(A_{2,1}=A_{2,2}=0\) gives also the following outcomes on the Ulam stability of functional equation (27) (let us mention that the stability of this equation was very recently studied in [35]).

Corollary 12

Assume that Y is a Banach space and \(\varphi :X^{4}\rightarrow [0, \infty )\) is a mapping such that

$$\begin{aligned} \begin{array}{cc} \lim _{j\rightarrow \infty }\frac{1}{4^{j}}\varphi \big (2^{j}x_{11} , 2^{j}x_{12} , 2^{j}x_{21}, 2^{j}x_{22}\big )=0,\qquad (x_{11}, x_{12}, x_{21}, x_{22})\in X^{4} \end{array} \end{aligned}$$

and

$$\begin{aligned} \begin{array}{cc} \varphi (2x_{11}, 2x_{11}, 2x_{21}, 2x_{21})\le 4L\varphi (x_{11}, x_{11}, x_{21}, x_{21}),\qquad (x_{11} , x_{21})\in X^{2} \end{array} \end{aligned}$$

for an \(L\in (0, 1)\). If \(f:X^2\rightarrow Y\) is a function such that

$$\begin{aligned} f(x_{1}, 0)=0=f(0, x_{2}), \qquad (x_{1}, x_{2})\in X^2 \end{aligned}$$
(26)

and

$$\begin{aligned}&\Big \Vert f(x_{11}+x_{12}, x_{21}+x_{22})+f(x_{11}-x_{12}, x_{21}-x_{22}) \\&-2f(x_{11}, x_{21})-2f(x_{11}, x_{22})\Big \Vert \le \varphi (x_{11},\, x_{12},\, x_{21},\, x_{22}) \end{aligned}$$

for \((x_{11},\, x_{12},\, x_{21},\, x_{22})\in X^{4}\), then there exists a unique solution \(F :X^{2}\rightarrow Y\) of equation

$$\begin{aligned} \begin{array}{cc} f(x_{11}+x_{12}, x_{21}+x_{22})+f(x_{11}-x_{12}, x_{21}-x_{22})&{}\\ &{}\\ =2f(x_{11}, x_{21})+2f(x_{11}, x_{22}) \end{array} \end{aligned}$$
(27)

fullfiling (26) and

$$\begin{aligned} \Vert f(x_{1}, x_{2})-F(x_{1}, x_{2})\Vert \le \frac{1}{4(1-L)}\varphi (x_{1}, x_{1}, x_{2}, x_{2}),\qquad (x_{1}, x_{2})\in X^2. \end{aligned}$$

The mapping F is given by

$$\begin{aligned} \begin{array}{cc} F(x_{1}, x_{2})=\lim _{j\rightarrow \infty }\frac{1}{4^{j}}f\big (2^jx_{1}, 2^jx_{2}\big ),\qquad (x_{1}, x_{2})\in X^2. \end{array} \end{aligned}$$
(28)

Corollary 13

Assume that Y is a Banach space and \(\varepsilon >0\). If \(f:X^2\rightarrow Y\) is a function such that (26) holds and

$$\begin{aligned}&\Big \Vert f(x_{11}+x_{12}, x_{21}+x_{22})+f(x_{11}-x_{12}, x_{21}-x_{22}) \\&-2f(x_{11}, x_{21})-2f(x_{11}, x_{22})\Big \Vert \le \varepsilon \end{aligned}$$

for \((x_{11},\, x_{12},\, x_{21},\, x_{22})\in X^{4}\), then there exists a unique solution \(F :X^{2}\rightarrow Y\) of equation (27) fullfiling (26) and

$$\begin{aligned} \Vert f(x_{1}, x_{2})-F(x_{1}, x_{2})\Vert \le \frac{\varepsilon }{3},\qquad (x_{1}, x_{2})\in X^2. \end{aligned}$$

The mapping F is given by (28).

Finally, we have the following.

Remark 14

Corollary 11 with \(n=1\) gives obviously the stability outcomes on functional equation (18), including the classical ones from [21, 55].