1 Introduction

The problem of the stability of functional equations was formulated by S. M. Ulam. More precisely, in 1940 S. M. Ulam at the University of Wisconsin proposed the following problem: “Give conditions in order for a linear mapping near an approximately linear mapping to exist”. In 1968 S. U. Ulam proposed the more general problem: “When is it true that by changing a little the hypotheses of a theorem one can still assert that the thesis of the theorem remains true or approximately true?” (see [8]). In 1978, Gruber [4] reformulated his question by posing the following: “Suppose a mathematical object satisfies a certain property approximately. Is it then possible to approximate this object by objects, satisfying the property exactly?”. This initiated a broad research program on the stability problem in theory of functional equations; for more information the reader may consult [5]. In 1991, J. A. Baker [2] presented the first stability result concerning the nonlinear functional equation

$$\begin{aligned} \phi (t)=F(t,\phi (f(t))) \end{aligned}$$

and proved the following

Theorem 1

(Baker) Let S be a nonempty set and let (Xd) be a complete metric space. Assume that \(f:S\rightarrow S\) and the function \(F:S\times X\rightarrow X\) satisfies

$$\begin{aligned} d(F(t,x),F(t,y))\le \lambda d(x,y),\;\;t\in S,\;x,y\in X, \end{aligned}$$

where \(0\le \lambda <1\). Suppose that \(\phi :S\rightarrow X\) satisfies

$$\begin{aligned} d(\phi (t), F(t,\phi (f(t))))\le \varepsilon ,\;\;t\in S, \end{aligned}$$

where \(\varepsilon \ge 0\). Then there exists a unique function \(\varPhi :S\rightarrow X\) such that

$$\begin{aligned} \varPhi (t)=F(t,\varPhi (f(t))),\;\;t\in S \end{aligned}$$

and

$$\begin{aligned} d(\varPhi (t),\phi (t))\le \frac{\varepsilon }{1-\lambda },\;\;t\in S. \end{aligned}$$

Baker based his proof on Banach’s Fixed Point Theorem.

This studies was continued by many mathematicians. We will mention here the paper of L. Cădariu, V. Radu [3] where, based on the fixed point alternative of Margolis and Diaz, they proved

Theorem 2

(Cădariu - Radu) Let S be a nonempty set and let (Xd) be a complete metric space. Assume that \(f:S\rightarrow S\), \(g:S\rightarrow {\mathbb {R}}\) and the function \(F:S\times X\rightarrow X\) satisfies

$$\begin{aligned} d(F(t,x),F(t,y))\le \mid g(t) \mid d(x,y),\;\;t\in S,\;x,y\in X. \end{aligned}$$

If \(\phi :S\rightarrow X\) satisfies

$$\begin{aligned} d(\phi (t), F(t,\phi (f(t))))\le \varepsilon (t) ,\;\;t\in S, \end{aligned}$$

with a mapping \(\varepsilon :S\rightarrow [0,+\infty )\) for which there exists \(0\le L<1\) such that

$$\begin{aligned} \mid g(t)\mid \left( \varepsilon \circ f \right) (t)\le L\varepsilon (t),\;\;t\in S, \end{aligned}$$
(1)

then there exists a unique function \(\varPhi :S\rightarrow X\) which satisfies both the equation

$$\begin{aligned} \varPhi (t)=F(t,\varPhi (f(t))),\;\;t\in S \end{aligned}$$

and the estimation

$$\begin{aligned} d(\varPhi (t),\phi (t))\le \frac{\varepsilon (t)}{1-L},\;\;t\in S. \end{aligned}$$

The paper of D. Miheţ [6] where, using a fixed point theorem of Luxemburg and Jung, has been proven

Theorem 3

(Miheţ) Let S be a nonempty set and let (Xd) be a complete metric space. Assume that \(f:S\rightarrow S\) and the function \(F:S\times X\rightarrow X\) satisfies

$$\begin{aligned} d(F(t,x),F(t,y))\le \varphi \left( d(x,y)\right) ,\;\;t\in S,\;x,y\in X, \end{aligned}$$

where \(\varphi :[0,\infty )\rightarrow [0,\infty )\) is nondecreasing, \(\lim _{u\rightarrow \infty }\varphi (u)=\infty \), \(\lim _{n\rightarrow \infty }\varphi ^{n}(u)=\infty \), for all \(u\in (0,\infty )\) and \(\lim _{u\rightarrow \infty }\left( u-\varphi (u)\right) =\infty \). Suppose that \(\phi :S\rightarrow X\) satisfies

$$\begin{aligned} d(\phi (t), F(t,\phi (f(t))))\le \varepsilon ,\;\;t\in S, \end{aligned}$$

where \(\varepsilon > 0\). Then there exists a unique function \(\varPhi :S\rightarrow X\) such that

$$\begin{aligned} \varPhi (t)=F(t,\varPhi (f(t))),\;\;t\in S \end{aligned}$$

and

$$\begin{aligned} d(\varPhi (t),\phi (t))\le \varepsilon (\varphi ),\;\;t\in S, \end{aligned}$$

where \(\varepsilon (\varphi ) =\sup \{ u\ge 0\; :\; u-\varphi (u)\le \varepsilon \}\).

The paper of M. Akkouchi [1] where, applying a fixed point theorem of Ćirić, shown

Theorem 4

(Akkouchi) Let S be a nonempty set and let (Xd) be a complete metric space. Assume that \(f:S\rightarrow S\) and the function \(F:S\times X\rightarrow X\) satisfies

$$\begin{aligned} d(F(t,x),F(t,y))\le & {} \alpha _{1} (x,y)d(x,y) + \alpha _{2} (x,y)d(x,F(t,x)) + \alpha _{3} (x,y)d(y,F(t,y)) \\&+ \alpha _{4} (x,y)d(x,F(t,y))+ \alpha _{5} (x,y)d(y,F(t,x)),\;\;t\in S,\;x,y\in X, \end{aligned}$$

where \(\alpha _{1}, \alpha _{2}, \alpha _{3}, \alpha _{4}, \alpha _{5} :X\times X\rightarrow [0,\infty )\) and

$$\begin{aligned} \alpha _{1} (x,y) + \alpha _{2} (x,y) + \alpha _{3} (x,y)+\alpha _{4} (x,y)+ \alpha _{5} (x,y)\le \lambda ,\;\;x,y\in X, \end{aligned}$$

for some \(\lambda \in [0,1)\). Suppose that \(\phi :S\rightarrow X\) satisfies

$$\begin{aligned} d(\phi (t), F(t,\phi (f(t))))\le \varepsilon ,\;\;t\in S, \end{aligned}$$

where \(\varepsilon > 0\). Then there exists a unique function \(\varPhi :S\rightarrow X\) such that

$$\begin{aligned} \varPhi (t)=F(t,\varPhi (f(t))),\;\;t\in S \end{aligned}$$

and

$$\begin{aligned} d(\varPhi (t),\phi (t))\le \frac{(2+\lambda )\varepsilon }{1(1-\lambda )},\;\;t\in S. \end{aligned}$$

Here are some interesting applications of the fixed point theorems. In this paper we will show that we can also obtain interesting results directly, without referring to the fixed point theorems. What is more, we will obtain a theorem which, after bringing to the case of a linear functional equation, will give us the result obtained by T. Trif [7], which could not be derived from the above-mentioned theorems.

2 Main Result

Our main result is the following stability theorem regarding nonlinear functional equation

Theorem 5

Let S be a nonempty set and let (Xd) be a complete metric space. Assume that \(f:S\rightarrow S\) and the function \(F:S\times X\rightarrow X\) satisfies

$$\begin{aligned} d(F(t,x),F(t,y))\le \lambda (t)d(x,y),\;\;t\in S,\;x,y\in X, \end{aligned}$$
(2)

where \(\lambda : S\rightarrow {\mathbb {R}}\). Suppose that \(\phi :S\rightarrow X\) satisfies

$$\begin{aligned} d(\phi (t), F(t,\phi (f(t))))\le \varepsilon (t),\;\;t\in S, \end{aligned}$$
(3)

where \(\varepsilon :S\rightarrow {\mathbb {R}}\) and

$$\begin{aligned} \sum _{n=2}^{\infty }\varepsilon (f^{n-1}(t))\prod _{i=0}^{n-2}\lambda (f^{i}(t))<+\infty ,\;\;t\in S. \end{aligned}$$
(4)

Then there exists a unique function \(\varPhi :S\rightarrow X\) such that

$$\begin{aligned} \varPhi (t)=F(t,\varPhi (f(t))) \end{aligned}$$
(5)

and

$$\begin{aligned} d(\varPhi (t),\phi (t))\le \varepsilon (t)+\sum _{n=2}^{\infty }\varepsilon (f^{n-1}(t))\prod _{i=0}^{n-2}\lambda (f^{i}(t)), \end{aligned}$$
(6)

for all \(t\in S\).

Proof

For a fixed \(t\in S\) let us recursively define the sequence \(F_{n}(t)\) taking

$$\begin{aligned} F_{0}(t)=\phi (t), \end{aligned}$$
$$\begin{aligned} F_{1}(t)=F(t,\phi (f(t))) \end{aligned}$$

and

$$\begin{aligned} F_{n+1}(t)=F(t,F_{n}(f(t))),\;\;n\in {\mathbb {N}} . \end{aligned}$$

Then we prove inductively that

$$\begin{aligned} d(F_{n}(t),F_{n-1}(t))\le \varepsilon (f^{n-1}(t))\varLambda _{n}(t),\;\;n\in {\mathbb {N}} , \end{aligned}$$
(7)

where

$$\begin{aligned} \varLambda _{n}(t)=\left\{ \begin{array}{ll} 1, &{} n=1\\ \prod _{i=0}^{n-2}\lambda (f^{i}(t)), &{} n\ge 2 \end{array} \right. \end{aligned}$$

(with the symbol \(f^{n}\) we denote the nth iterate of the function f where \(f^{0}\) is the identity mapping).

For \(n=1\) using our assumption (3) we have

$$\begin{aligned} d(F_{1}(t),F_{0}(t))=d(F(t,\phi (f(t))), \phi (t))\le \varepsilon (t)=\varepsilon (f^{1-1}(t))\varLambda _{1}(t),\;\; t\in S. \end{aligned}$$

Let us fix \(n\ge 1\). Assuming that our inequality (7) is true for all k not greater than n for \(n+1\), by (2), we have

$$\begin{aligned} d(F_{n+1}(t),F_{n}(t))= & {} d(F(t,F_{n}(f(t))),F(t,F_{n-1}(f(t))))\\\le & {} \lambda (t)d(F_{n}(f(t)),F_{n-1}(f(t)))\le \lambda (t) \varepsilon (f^{n}(t))\varLambda _{n}(f(t))\\= & {} \varepsilon (f^{n}(t))\varLambda _{n+1}(t) ,\;\;t\in S. \end{aligned}$$

The proven inequality (7) together with the assumed convergence of the series (4) lead to the statement that for every \(t\in S\) the sequence \((F_{n}(t):n\in {\mathbb {N}})\) satisfies the Cauchy condition. By assumption, the space X is complete. So our sequence is convergent in X and we can define the function \(\varPhi :S\rightarrow X\) by taking

$$\begin{aligned} \varPhi (t)=\lim _{n\rightarrow \infty }F_{n}(t),\;\;t\in S. \end{aligned}$$
(8)

Further, the inequality of (2) also means that the function F is continuous with respect to the second variable. Going with n to infinity in the identity

$$\begin{aligned} F_{n+1}(t) = F(t,F_{n}(f(t))),\;\;t\in S,\;n\in {\mathbb {N}} \end{aligned}$$

we obtain

$$\begin{aligned} \varPhi (t)=F(t,\varPhi (f(t)),\;\;t\in S. \end{aligned}$$

So the function \(\varPhi \) satisfies Eq. (5). Also,

$$\begin{aligned} d(F_{n}(t),\phi (t))\le & {} d(F_{n}(t), F_{n-1}(t))+d(F_{n-1}(t),F_{n-2}(t))+\cdots +d(F_{1}(t), F_{0}(t))\\\le & {} \sum _{j=1}^{n}\varepsilon (f^{j-1}(t))\varLambda _{j}(t) \\\le & {} \sum _{k=1}^{\infty }\varepsilon (f^{k-1}(t))\varLambda _{k}(t),\;\;t\in S,\;n\in {\mathbb {N}}, \end{aligned}$$

which, after going with n to infinity, shows that the function \(\varPhi \) satisfies estimation (6).

It remains to prove the uniqueness of the function satisfying (5) and (6). Let us assume that we have two functions \(\varPhi \) and \(\varPsi \) from S into X that satisfy (5) and (6). Then, in relation to (5), (2) and (6),

$$\begin{aligned} d(\varPhi (t),\varPsi (t))= & {} d(F(t,\varPhi (f(t))),F(t,\varPsi (f(t)))) \le \lambda (t)d(\varPhi (f(t)), \varPsi (f(t)))\\= & {} \lambda (t)d(F(f(t),\varPhi (f^{2}(t))), F(f(t),\varPsi (f^{2}(t))))\\\le & {} \lambda (t)\lambda (f(t))d(\varPhi (f^{2}(t)),\varPsi (f^{2}(t)))\\&\ldots \\\le & {} \prod _{i=0}^{n-1}\lambda (f^{i}(t)) d(\varPhi (f^{n}(t)),\varPsi (f^{n}(t)))\\\le & {} \prod _{i=0}^{n-1}\lambda (f^{i}(t))\left( d ( \varPhi (f^{n}(t)), \phi (f^{n}(t)) ) +d ( \phi (f^{n}(t), \varPsi (f^{n}(t)) )\right) \\\le & {} 2\prod _{i=0}^{n-1}\lambda (f^{i}(t)) \sum _{k=1}^{\infty } \varepsilon (f^{k-1+n}(t))\varLambda _{k}(f^{n}(t))\\= & {} 2\sum _{k=n+1}^{\infty }\varepsilon (f^{k-1}(t))\varLambda _{k}(t) ,\;\; t\in S,\;n\in {\mathbb {N}} \end{aligned}$$

and the convergence of the series (4) means that

$$\begin{aligned} \sum _{k=n+1}^{\infty }\varepsilon (f^{k-1}(t))\varLambda _{k}(t) \mathop {\longrightarrow }_{n\rightarrow \infty }0,\;\;t\in S, \end{aligned}$$

which gives \(\varPsi = \varPhi \) and completes the proof of our theorem. \(\square \)

3 Concluding Remarks

We can compare our result with the Cădariu - Radu theorem (Theorem 2) where also \(\varepsilon \) is not a constant and there is a function of the variable t. Let

$$\begin{aligned} \lambda (t) = \mid g(t)\mid ,\;\;t\in S. \end{aligned}$$

Using \(n-1\) times the assumption (1) we get

$$\begin{aligned} \varepsilon (f^{n-1}(t))\prod _{i=0}^{n-2}\lambda (f^{i}(t))= & {} \lambda (t)\lambda (f(t))\cdots \lambda (f^{n-3}(t))\lambda (f^{n-2}(t)) \varepsilon (f^{n-1}(t))\\\le & {} \lambda (t)\lambda (f(t))\cdots \lambda (f^{n-3}(t))L \varepsilon (f^{n-2}(t))\\\le & {} \cdots \le L^{n-1}\varepsilon (t),\;\;t\in S \end{aligned}$$

and with \(0\le L <1\) the series from condition (4) converges. Thus, the assumptions of the theorem proved by us are weaker than those of the Cădariu - Radu result.

Further, Baker used his result (Theorem 1) to study the stability of a linear functional equation (with constant \(\varepsilon \)) and obtained the classic stability result. One of the most general stability results for a linear functional equations is the Trif result, which we will not derive from the theorems mentioned in the introduction to this paper.

Theorem 6

(Trif) Let S be a nonempty set and let X be a Banach space over the field \({\mathbb {K}}\in \{ {\mathbb {R}} ,{\mathbb {C}}\}\). Assume that \(f:S\rightarrow S\), \(\alpha :S\rightarrow {\mathbb {K}}\setminus \{ 0\}\), \(\beta :S\rightarrow X\) and \(\delta :S\rightarrow [0,\infty )\) be given functions such that

$$\begin{aligned} \omega (t)=\sum _{k=0}^{\infty }\frac{\delta (f^{k}(t))}{\prod _{j=0}^{k}\mid \alpha (f^{j}(t))\mid }< \infty \end{aligned}$$
(9)

for all \(t\in S\). If a function \(\phi :S\rightarrow X\) satisfies

$$\begin{aligned} \parallel \phi (f(t))-\alpha (t)\phi (t)-\beta (t)\parallel \le \delta (t) \end{aligned}$$
(10)

for all \(t\in S\), then there exists a unique function \(\varPhi :S\rightarrow X\) such that

$$\begin{aligned} \varPhi (f(t))=\alpha (t)\varPhi (t)+\beta (t) ,\;\;t\in S \end{aligned}$$
(11)

and

$$\begin{aligned} \parallel \varPhi (t) -\phi (t)\parallel \le \omega (t),\;\;t\in S. \end{aligned}$$
(12)

Let us see, however, that by acting similarly to Baker, from our proven result one can derive the Trif theorem. Indeed, to apply Theorem 5 we first have to divide the inequality (10) by \(\alpha (t)\) (which is assumed to be different from zero) to obtain

$$\begin{aligned} \parallel \frac{1}{\alpha (t)}\phi (f(t))-\phi (t)-\frac{\beta (t)}{\alpha (t)} \parallel \le \frac{\delta (t)}{\mid \alpha (t)\mid },\;\;t\in S. \end{aligned}$$

Therefore

$$\begin{aligned} \varepsilon (t)=\frac{\delta (t)}{\mid \alpha (t)\mid },\;\;t\in S \end{aligned}$$

and

$$\begin{aligned} F(t,x)= \frac{1}{\alpha (t)}x-\frac{\beta (t)}{\alpha (t)},\;\;t\in S,\;x\in X. \end{aligned}$$

Because

$$\begin{aligned} \parallel F(t,x)-F(t,y)\parallel = \frac{1}{\mid \alpha (t)\mid }\parallel x -y\parallel ,\;\;t\in S,\;x,y\in X \end{aligned}$$

so,

$$\begin{aligned} \lambda (t) = \frac{1}{\mid \alpha (t)\mid },\;\;t\in S \end{aligned}$$

and

$$\begin{aligned} \sum _{n=2}^{\infty }\varepsilon (f^{n-1}(t))\prod _{i=0}^{n-2}\lambda (f^{i}(t))= & {} \sum _{n=2}^{\infty }\frac{\delta (f^{n-1}(t))}{\mid \alpha (f^{n-1}(t))\mid } \cdot \frac{1}{\prod _{i=0}^{n-2}\mid \alpha (f^{i}(t))\mid }\\= & {} \sum _{n=2}^{\infty }\frac{\delta (f^{n-1}(t))}{\prod _{i=0}^{n-1}\mid \alpha (f^{i}(t))\mid } ,\;\;t\in S. \end{aligned}$$

In view of assumption (9) this series is convergent. Also,

$$\begin{aligned} \omega (t)= & {} \sum _{k=0}^{\infty }\frac{\delta (f^{k}(t))}{\prod _{j=0}^{k} \mid \alpha (f^{j}(t))\mid } \\= & {} \frac{\delta (t)}{\mid \alpha (t)\mid } + \sum _{k=1}^{\infty } \frac{\delta (f^{k}(t))}{\mid \alpha (f^{k}(t))\mid }\prod _{j=0}^{k-1} \frac{1}{\mid \alpha (f^{j}(t))\mid } \\= & {} \varepsilon (t)+\sum _{n=2}^{\infty }\varepsilon (f^{n-1}(t))\prod _{i=0}^{n-2}\lambda (f^{i}(t)), \;\; t\in S. \end{aligned}$$

So, as a result of such a specification, we obtain exactly the result obtained by Trif, which also shows that the theorem proved by us (Theorem 5) is in some way optimal.

It should also be noted that the presented method of proof allows the search for regular solutions of the equation close to regular approximate solutions. For example, looking for continuous solutions close to continuous approximative solutions of the equation, we consider a topological space S, continuous mappings f and F and then, assuming that \(\phi \) is continuous and the series 4 is uniformly convergent, we get \(\varPhi \) continuous (as a uniform limit of a sequence of continuous functions).