1 Introduction

The study of data dependence in the theory of differential equations grows by means of different concepts such as monotonity, continuity and differentiability of solutions with respect to parameters; asymptotic behavior and G-convergences of solutions; Liapunov stability and structural stability of solutions; analiticity and regularity of solutions, etc.. We refer to monographs [3, 11, 12, 30, 31] for those concepts of data dependence. In this paper we study the data dependence of differential equations on a relatively new concept, called Ulam Stability, which has been of an increasing interest in the last decades.

On a talk given at Wisconsin University in 1940, S. M. Ulam posed the following problem: “Under what conditions does there exists an homomorphism near an approximately homomorphism of a complete metric group?” More precisely: Given a metric group \(\left( G, \cdot , d \right) \), a number \(\varepsilon >0\) and a mapping \(f:G\rightarrow G\) satisfying the inequality

$$\begin{aligned} d\left( f(xy), f(x)f(y) \right) <\varepsilon \end{aligned}$$

for all \(x,y\in G\), does there exist a homomorphism g of G and a constant K, depending only on G, such that

$$\begin{aligned} d\left( f(x), g(x) \right) \le K\varepsilon \end{aligned}$$

for all \(x\in G\)? In the presence of affirmative answer, the equation \(g(xy)=g(x)g(y)\) of the homomorphism is called stable, see [29] for details. One year later, Hyers [13] gave an answer to this problem for linear functional equations on Banach spaces: Let \(E_1, E_2\) be real Banach spaces and \(\varepsilon >0\). Then, for each mapping \(f:E_1\rightarrow E_2\) satisfying

$$\begin{aligned} \left\| f(x+y)-f(x)-f(y) \right\| \le \varepsilon \end{aligned}$$

for all \(x,y\in E_1\), there exists a unique additive mapping \(g:E_1\rightarrow E_2\) such that

$$\begin{aligned} \left\| f(x)-g(x) \right\| \le \varepsilon \end{aligned}$$

holds for all \(x\in E_1\). After Hyers’ answer, a new concept of stability for functional equations established, called today Hyers–Ulam stability, and many papers devoted to this topic (see for example [6, 7, 10, 21]). In 1978, Rassias [24] provided a remarkable generalization, which known as Hyers–Ulam–Rassias stability today, by considering the constant \(\varepsilon \) as a variable in Ulam’s problem (see for example [2, 5, 14, 16, 22, 25]).

Stability problem of differential equations in the sense of Hyers–Ulam was initiated by the papers of Obloza [19, 20]. Later Alsina and Ger [1] proved that, with assuming I is an open interval of reals, every differentiable mapping \(y:I\rightarrow {\mathbb {R}}\) satisfying \(\left| y'(x)-y(x) \right| \le \varepsilon \) for all \(x\in I\) and for a given \(\varepsilon >0\), there exists a solution \(y_0\) of the differential equation \(y'(x)=y(x)\) such that \(\left| y(x)-y_0(x)\right| \le 3\varepsilon \) for all \(x\in I\). This result was later extended by Takahasi, Miura and Miyajima [27] to the equation \(y'(x)=\lambda y(x)\) in Banach spaces, and [17, 18] to higher order linear differential equations with constant coefficients. After these inspiring works, a large number of papers devoted to this subject have been published (see for example [8, 23, 26] and references therein).

Recently Jung [15] proved Hyers–Ulam stability as well as Hyers–Ulam–Rassias stability of the equation

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

which extends the above mentioned results to nonlinear case. Later Bojor [4] modified Jung’s [15] technique for the linear equation

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

and proved a stability result with some different assumptions. Jung’s [15] technique has been modified also for functional equations in the form

$$\begin{aligned} y'(x)=F\left( x,y(x), y(x-\tau )\right) \end{aligned}$$

by Tunç and Biçer [28].

In this paper, we will extend and improve these result by proving the stability results for differential equations with less assumptions. Examples to visualize improvement will be given.

2 Preliminaries

Let I be an open interval. For every \(\varepsilon \ge 0\) and \(y\in C^1(I)\) satisfying

$$\begin{aligned} \left| y'(x)-f\left( t,y(x)\right) \right| \le \varepsilon , \end{aligned}$$

if there esists a solution \(y_0\) of the Eq. (1) such that

$$\begin{aligned} \left| y(x)-y_0(x) \right| \le K\varepsilon , \end{aligned}$$

where K is a constant which does not depend on \(\varepsilon \) and y, then the differential equation (1) is said to be stable in the sense of Hyers–Ulam. If the above statement remains true after replacing the constants \(\varepsilon \) and K with the functions \(\varphi , \varPhi :I\rightarrow [0,\infty )\) respectively, where these functions does not depend on y and \(y_0\), then the differential equation (1) is said to be stable in the sense of Hyers–Ulam–Rassias. This definiton may be applied to different classes of differential equations, we refer to Jung [15] and references cited therein for more detailed definitions of Hyers–Ulam stability and Hyers–Ulam–Rassias stability.

We now introduce the concept of generalized metric which will be employed in proofs of our main results. For a nonempty set X, a function \(d:X\times X\rightarrow [0,\infty ]\) is called a generalized metric on X if and only if satisfies

M1:

\(d(x,y)=0\) if and only if \(x=y\),

M2:

\(d(x,y)=d(y,x)\) for all \(x,y\in X\),

M3:

\(d(x,z)\le d(x,y)+d(y,z)\) for all \(x,y,z\in X\).

It should be remarked that the only difference of the generalized metric from the usual metric is that the range of the former is permitted to be an unbounded interval.

We will use the following fixed point result as main tool in our proofs, we refer to [9] for the proof of this result.

Theorem 1

Let (Xd) is a generalized complete metric space. Assume that \(T:X\rightarrow X\) is a strictly contractive operator with the Lipschitz constant \(L<1\). If there is a nonnegative integer k such that \(d\left( T^{k+1}x,T^kx\right) <\infty \) for some \(x\in X\), then the following are true:

  1. (a)

    The sequence \(\left\{ T^nx\right\} \) converges to a fixed point \(x^*\) of T,

  2. (b)

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

    $$\begin{aligned} X^*=\left\{ y\in X \; : \; d\left( T^kx,y\right) <\infty \right\} , \end{aligned}$$
  3. (c)

    If \(y\in X^*\), then

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

3 Main Results

Throughout this section we define \(I:=\left[ x_0, x_0+r\right] \) for given real numbers \(x_0\) and r with \(r>0\). Further, we define the set X of all continuous functions on I by

$$\begin{aligned} X:=\left\{ f:I\rightarrow {\mathbb {R}}\;|\;f \text { is continuous}\right\} =C\left( I,{\mathbb {R}}\right) . \end{aligned}$$
(2)

Lemma 1

Define the function \(d:X\times X\rightarrow [0,\infty ]\) with

$$\begin{aligned} d\left( f,g\right) :=\inf \left\{ C\in \left[ 0,\infty \right] \;:\; \left| f(x)-g(x) \right| \mathrm{e}^{-M(x-x_0)} \le C\varPhi (x),\; x\in I \right\} \end{aligned}$$
(3)

where \(M>0\) is a given constant and \(\varPhi :I\rightarrow \left( 0,\infty \right) \) is a given continuous function. Then \(\left( X,d\right) \) is a generalized complete metric space.

Proof

First we will show that d is a generalized metric on X. Conditions M1 and M2 clearly hold, we will show that M3 also holds. Assume that \(d(f,g)>d(f,h)+d(h,g)\) for some \(f,g,h\in X\), then there would exist an \(x_1\in I\) such that

$$\begin{aligned} \left| f(x_1)-g(x_1) \right| \mathrm{e}^{-M(x_1-x_0)}> & {} \left[ d(f,h)+d(h,g)\right] \varPhi (x_1)\\= & {} d(f,h)\varPhi (x_1)+d(h,g)\varPhi (x_1)\\\ge & {} \left| f(x_1)-h(x_1) \right| \mathrm{e}^{-M(x_1-x_0)} \\&+\, \left| h(x_1)-g(x_1) \right| \mathrm{e}^{-M(x_1-x_0)} \end{aligned}$$

which is a contradiction.

We will now show that (Xd) is complete, let \(\left\{ h_n\right\} \) be a Cauchy sequence on (Xd). Then, for any \(\varepsilon >0\), there exists an integer \(N(\varepsilon )>0\) such that \(d\left( h_m,h_n\right) \le \varepsilon \) for all \(m,n\ge N(\varepsilon )\). In other words, for any \(\varepsilon >0\), there exists an integer \(N(\varepsilon )>0\) such that

$$\begin{aligned} \left| h_m(x)-h_n(x)\right| \mathrm{e}^{-M(x-x_0)}\le \varepsilon \varPhi (x) \end{aligned}$$
(4)

for all \(m,n\ge N(\varepsilon )\) and all \(x\in I\). This means that \(\left\{ h_n(x) \right\} \) is a Cauchy sequence in \({\mathbb {R}}\) for any fixed x. Since \({\mathbb {R}}\) is complete, \(\left\{ h_n(x)\right\} \) converges for all \(x\in I\) and we can define the function \(h:I\rightarrow {\mathbb {R}}\) by

$$\begin{aligned} h(x):=\lim \limits _{n\rightarrow \infty }h_n(x). \end{aligned}$$

Now letting \(m\rightarrow \infty \) in (4) we obtain, for any \(\varepsilon >0\), there exists an integer \(N(\varepsilon )>0\) such that

$$\begin{aligned} \left| h(x)-h_n(x) \right| \mathrm{e}^{-M(x-x_0)}\le \varepsilon \varPhi (x) \end{aligned}$$
(5)

for all \(n\ge N(\varepsilon )\) and all \(x\in I\). That is, for any \(\varepsilon >0\), there exists an integer \(N(\varepsilon )>0\) such that \(d\left( h,h_n\right) \le \varepsilon \) for all \(n>N(\varepsilon )\). Furthermore, since \(\varPhi \) is bounded on I, we conclude from (5) that \(\left\{ h_n(x)\right\} \) converges uniformly to h and so that \(h\in X\). The proof is now complete. \(\square \)

We are now ready to study stability of differential equation (1) in the sense of Hyers–Ulam.

Theorem 2

Assume that \(f:I\times {\mathbb {R}}\rightarrow {\mathbb {R}}\) is a continuous function which satisfies a Lipschitz condition

$$\begin{aligned} \left| f(x,y_1)-f(x,y_2) \right| \le L\left| y_1-y_2 \right| \end{aligned}$$

for all \(x\in I\) and all \(y_1, y_2\in {\mathbb {R}}\), where \(L>0\) is a Lipschitz constant. If a continuously differentiable function \(y:I\rightarrow {\mathbb {R}}\) satisfies

$$\begin{aligned} \left| y'(x)-f\left( x, y(x)\right) \right| \le \varepsilon \end{aligned}$$
(6)

for all \(x\in I\) and some \(\varepsilon \ge 0\), then there exists a unique solution \(y_0\) of (1) satisfying

$$\begin{aligned} \left| y(x)-y_0(x) \right| \le \left( 1+L\right) r\varepsilon \end{aligned}$$

for all \(x\in I\).

Proof

We consider the set X defined by (2) and introduce a function \(d:X\times X\rightarrow \left[ 0,\infty \right] \) with

$$\begin{aligned} d\left( f,g\right) :=\inf \left\{ C\in \left[ 0,\infty \right] \;:\; \left| f(x)-g(x) \right| \mathrm{e}^{-(L+1)(x-x_0)} \le C,\; x\in I \right\} . \end{aligned}$$

Note that \(\left( X,d\right) \) is a generalized complete metric space in view of Lemma 1. Now let us define the operator \(T:X\rightarrow X\) by

$$\begin{aligned} \left( Ty\right) \left( x\right) :=y(x_0)+\int _{x_0}^{x}f\left( s, y(s)\right) {\mathrm{d}}{s},\qquad x\in I \end{aligned}$$

for any \(y\in X\). It is obvious that any fixed point of T solves the differential equation (1).

It is obvious from Fundamental Theorem of Calculus that \(Ty\in X\) and thus we infer that

$$\begin{aligned} \left| \left( Tg_0\right) (x)-g_0(x) \right| \mathrm{e}^{-(L+1)(x-x_0)} <\infty \end{aligned}$$

for arbitrary \(g_0\in X\) and all \(x\in I\), which means \(d\left( Tg_0,g_0\right) <\infty \) for all \(g_0\in X\). Similarly

$$\begin{aligned} \left| g_0(x)-g(x) \right| \mathrm{e}^{-(L+1)(x-x_0)}<\infty \end{aligned}$$

for all \(g\in X\) and all \(x\in I\), which means \(d\left( g_0,g\right) <\infty \) for all \(g\in X\), i.e.

$$\begin{aligned} \left\{ g\in X \; : \; d\left( g_0,g\right) <\infty \right\} =X. \end{aligned}$$

We will now show that T is strictly contractive on X. For any \(g_1, g_2\in X\) we have

$$\begin{aligned} \left| \left( Tg_1\right) (x)-\left( Tg_2\right) (x) \right|= & {} \left| \int _{x_0}^{x}\left[ f\left( s, g_1(s)\right) -f\left( s, g_2(s)\right) \right] {\mathrm{d}}{s} \right| \\\le & {} \int _{x_0}^{x}\left| f\left( s, g_1(s)\right) -f\left( s, g_2(s)\right) \right| {\mathrm{d}}{s}\\\le & {} L\int _{x_0}^{x}\left| g_1(s)-g_2(s) \right| {\mathrm{d}}{s}\\= & {} L\int _{x_0}^{x}\left| g_1(s)-g_2(s) \right| \cdot \mathrm{e}^{-(L+1)(s-x_0)}\cdot \mathrm{e}^{(L+1)(s-x_0)}{\mathrm{d}}{s}\\\le & {} L d\left( g_1, g_2\right) \int _{x_0}^{x}\mathrm{e}^{(L+1)(s-x_0)}{\mathrm{d}}{s}\\\le & {} \frac{L}{L+1} d\left( g_1,g_2\right) \mathrm{e}^{(L+1)(x-x_0)} \end{aligned}$$

for all \(x\in I\). Thus, for any \(g_1, g_2\in X\) and for all \(x\in I\), we have

$$\begin{aligned} \left| \left( Tg_1\right) (x)-\left( Tg_2\right) (x) \right| \cdot \mathrm{e}^{-(L+1)(x-x_0)} \le \frac{L}{L+1} d\left( g_1,g_2\right) . \end{aligned}$$

Hence, for all \(g_1, g_2\in X\) we have

$$\begin{aligned} d\left( Tg_1, Tg_2 \right) \le \frac{L}{L+1}d\left( g_1, g_2\right) \end{aligned}$$

which means that T is stricly contractive on X. Now we have shown that all the conditions of Theorem 1 are satisfied with \(k=1\) and \(X^*=X\).

On the other hand, it follows from (6) that

$$\begin{aligned} -\varepsilon \le y'(x)-f\left( x, y(x)\right) \le \varepsilon \end{aligned}$$

for all \(x\in I\). Integrating this inequality from \(x_0\) to x, we obtain

$$\begin{aligned} \left| y(x)-\left( Ty\right) (x) \right| \le \varepsilon \left( x-x_0\right) \end{aligned}$$

for all \(x\in I\). Now multiplying this inequality with \(\mathrm{e}^{-(L+1)(x-x_0)}\) we obtain

$$\begin{aligned} \left| \left( Ty\right) (x) -y(x) \right| \mathrm{e}^{-(L+1)(x-x_0)}\le \varepsilon \left( x-x_0\right) \mathrm{e}^{-(L+1)(x-x_0)} \end{aligned}$$

for all \(x\in I\), which means

$$\begin{aligned} d\left( Ty, y\right) \le \varepsilon \left( x-x_0\right) \mathrm{e}^{-(L+1)(x-x_0)}\le \varepsilon r \mathrm{e}^{-(L+1)(x-x_0)} \end{aligned}$$

for each \(x\in I\).

Therefore, according to Theorem 1, there exists a unique solution \(y_0:I\rightarrow {\mathbb {R}}\) of differential equation (1) satisfying

$$\begin{aligned} d\left( y, y_0\right) \le \frac{1}{1-L/(L+1)}d\left( Ty, y\right) \le \left( L+1\right) \varepsilon r \mathrm{e}^{-(L+1)(x-x_0)} \end{aligned}$$

for each \(x\in I\). It follows from definition of \(d(y,y_0)\) that

$$\begin{aligned} \left| y(x)-y_0(x) \right| \mathrm{e}^{-(L+1)(x-x_0)}\le \left( L+1\right) \varepsilon r\mathrm{e}^{-(L+1)(x-x_0)} \end{aligned}$$

and thus we obtain

$$\begin{aligned} \left| y(x)-y_0(x)\right| \le \left( 1+L\right) r\varepsilon \end{aligned}$$

for all \(x\in I\). The proof is now complete. \(\square \)

Remark 1

Notice that we do not assume \(Lr<1\) in Theorem 2, while it is required in Theorem 4.1 of Jung’s paper [15].

Now we will give a result on Hyers–Ulam–Rassias stability of the differential equation (1) based on the same technique with Theorem 2. Interestingly we will see that this estimate is much better and can be extended to unbounded intervals.

Theorem 3

Assume that \(f:I\times {\mathbb {R}}\rightarrow {\mathbb {R}}\) is a continuous function which satisfies the Lipschitz condition

$$\begin{aligned} \left| f(x,y_1)-f(x,y_2) \right| \le L\left| y_1-y_2 \right| \end{aligned}$$

for all \(x\in I\) and all \(y_1, y_2\in {\mathbb {R}}\). If a continuously differentiable function \(y:I\rightarrow {\mathbb {R}}\) satisfies

$$\begin{aligned} \left| y'(x)-f\left( x, y(x)\right) \right| \le \varphi (x) \end{aligned}$$
(7)

for all \(x\in I\), where \(\varphi :I\rightarrow \left( 0,\infty \right) \) is a nondecreasing continuous function satisfying

$$\begin{aligned} \left| \int _{x_0}^{x}\varphi (s){\mathrm{d}}{s} \right| \le K\varphi (x) \end{aligned}$$
(8)

for each \(x\in I\), then there exists a unique solution \(y_0\) of the differential equation (1) satisfying

$$\begin{aligned} \left| y(x)-y_0(x) \right| \le K\left( 1+L\right) \varphi (x) \end{aligned}$$

for all \(x\in I\).

Proof

We consider the set X defined by (2) and introduce a function \(d:X\times X\rightarrow \left[ 0,\infty \right] \) with

$$\begin{aligned} d\left( f,g\right) :=\inf \left\{ C\in \left[ 0,\infty \right] \;:\; \left| f(x)-g(x) \right| \mathrm{e}^{-(L+1)(x-x_0)} \le C\varphi (x),\; x\in I \right\} . \end{aligned}$$

Note that \(\left( X,d\right) \) is again a generalized complete metric space in view of Lemma 1. Now let us define the operator \(T:X\rightarrow X\) by

$$\begin{aligned} \left( Ty\right) \left( x\right) :=y(x_0)+\int _{x_0}^{x}f\left( s, y(s)\right) {\mathrm{d}}{s},\qquad x\in I \end{aligned}$$

for any \(y\in X\). Note that fixed points of T solve the differential equation (1). Also, as in proof of Theorem 2, it can be shown that \(T\left( Tg_0, g_0\right) <\infty \) for all \(g_0\in X\) and \(\left\{ g\in X \,:\; d\left( g_0,g\right) <\infty \right\} =X\).

We will show now that T is a strictly contractive operator on X. With integrating by parts

$$\begin{aligned} \int _{x_0}^{x}\varphi (s)\mathrm{e}^{(L+1)(s-x_0)}{\mathrm{d}}{s}\le & {} \frac{1}{L+1}\varphi (x)\mathrm{e}^{(L+1)(x-x_0)}\\&-\,\frac{1}{L+1}\int _{x_0}^{x}\varphi '(s)\mathrm{e}^{(L+1)(s-x_0)}{\mathrm{d}}{s} \end{aligned}$$

and using the monotonoity of \(\varphi \), we obtain

$$\begin{aligned} \int _{x_0}^{x}\varphi (s)\mathrm{e}^{(L+1)(s-x_0)}{\mathrm{d}}{s}\le \frac{1}{L+1}\varphi (x)\mathrm{e}^{(L+1)(x-x_0)} \end{aligned}$$

for all \(x\in I\). Now, for any \(g_1, g_2\in X\), let \(C_{g_1,g_2}\in \left[ 0,\infty \right] \) be an arbitrary constant with \(d\left( g_1,g_2\right) \le C_{g_1,g_2}\), that is

$$\begin{aligned} \left| g_1(x)-g_2(x) \right| \mathrm{e}^{-(L+1)(x-x_0)}\le C_{g_1,g_2}\varphi (x) \end{aligned}$$

for all \(x\in I\). It then follows, for any \(g_1, g_2\in X\),

$$\begin{aligned} \left| \left( Tg_1\right) (x)-\left( Tg_2\right) (x) \right|= & {} \left| \int _{x_0}^{x}\left[ f\left( s, g_1(s)\right) -f\left( s, g_2(s)\right) \right] {\mathrm{d}}{s} \right| \\\le & {} \int _{x_0}^{x}\left| f\left( s, g_1(s)\right) -f\left( s, g_2(s)\right) \right| {\mathrm{d}}{s}\\\le & {} L\int _{x_0}^{x}\left| g_1(s)-g_2(s) \right| {\mathrm{d}}{s}\\= & {} L \int _{x_0}^{x}\left| g_1(s)-g_2(s) \right| \cdot \mathrm{e}^{-(L+1)(s-x_0)}\cdot \mathrm{e}^{(L+1)(s-x_0)}{\mathrm{d}}{s}\\\le & {} LC_{g_1,g_2}\int _{x_0}^{x}\varphi (s)\mathrm{e}^{(L+1)(s-x_0)}{\mathrm{d}}{s}\\\le & {} \frac{L}{L+1}C_{g_1,g_2} \varphi (x)\mathrm{e}^{(L+1)(x-x_0)} \end{aligned}$$

for all \(x\in I\). Thus, for any \(g_1, g_2\in X\) and for all \(x\in I\), we have

$$\begin{aligned} \left| \left( Tg_1\right) (x)-\left( Tg_2\right) (x) \right| \cdot \mathrm{e}^{-(L+1)(x-x_0)} \le \frac{L}{L+1} C_{g_1,g_2}\ \varphi (x). \end{aligned}$$

Hence, for all \(g_1, g_2\in X\) we have

$$\begin{aligned} d\left( Tg_1, Tg_2 \right) \le \frac{L}{L+1}d\left( g_1, g_2\right) \end{aligned}$$

and we note that \(L/\left( L+1\right) <1\). Now it is shown that T is stricly contractive on X and that all the conditions of Theorem 1 are satisfied with \(k=1\), \(X^*=X\).

On the other hand, it follows form (7) that

$$\begin{aligned} -\varphi (x)\le y'(x)-f\left( x, y(x)\right) \le \varphi (x) \end{aligned}$$

for all \(x\in I\). Integrating this inequality from \(x_0\) to x and using the inequality (8), we obtain

$$\begin{aligned} \left| y(x)-\left( Ty\right) (x) \right| \le K\varphi (x) \end{aligned}$$

for all \(x\in I\). Multiplying this inequality with \(\mathrm{e}^{-(L+1)(x-x_0)}\) we obtain

$$\begin{aligned} \left| y(x)-\left( Ty\right) (x) \right| \mathrm{e}^{-(L+1)(x-x_0)}\le K\varphi (x)\mathrm{e}^{-(L+1)(x-x_0)} \end{aligned}$$

which means that

$$\begin{aligned} d\left( Ty, y\right) \le K\varphi (x)\mathrm{e}^{-(L+1)(x-x_0)} \end{aligned}$$

for all \(x\in I\).

Therefore, according to Theorem 1, there exists a unique solution \(y_0:I\rightarrow {\mathbb {R}}\) of differential equation (1) satisfying

$$\begin{aligned} d\left( y,y_0\right) \le \frac{1}{1-L/(L+1)}d\left( Ty,y\right) \le K\left( 1+L\right) \varphi (x)\mathrm{e}^{-(L+1)(x-x_0)} \end{aligned}$$

for all \(x\in I\). It follows from definition of \(d\left( y,y_0\right) \) that

$$\begin{aligned} \left| y(x)-y_0(x) \right| \mathrm{e}^{-(L+1)(x-x_0)}\le K\left( 1+L\right) \varphi (x)\mathrm{e}^{-(L+1)(x-x_0)} \end{aligned}$$

and thus we obtain

$$\begin{aligned} \left| y(x)-y_0(x) \right| \le K\left( 1+L\right) \varphi (x) \end{aligned}$$

for all \(x\in I\), which completes the proof. \(\square \)

Remark 2

Notice that we do not assume \(KL<1\) in Theorem 3, which it is a required condition in Theorem 3.1 and 3.2 of Jung’s paper [15].

Remark 3

By employing the same method with Jung [15], It can be easily shown that Theorem 3 remains valid if we replace the interval I with an unbounded interval. We refer to Theorem 3.2 of Jung [15] for proof.

4 Examples

Example 1

Consider the differential equation

$$\begin{aligned} y'(x)+\lambda y(x)=q(x) \end{aligned}$$
(9)

on the interval \(I:=\left[ 0, 4/\lambda \right] \), where \(\lambda >0\) is any constant and q is any continuous function on I. In this case we have \(f(x,y)=q(x)-\lambda y(x)\) and it obviously satisfies Lipschitz condition with the Lipschitz constant \(L=\lambda \) since

$$\begin{aligned} \left| f(x,y_1)-f(x,y_2) \right| =\lambda \left| y_1(x)-y_2(x) \right| . \end{aligned}$$

Therefore, in view of Theorem 2, Eq. (9) is stable in the sense of Hyers–Ulam on I.

It should be remarked that Theorem 4.1 of Jung [15] does not work in this problem since

$$\begin{aligned} I:=\left[ c-r, c+r\right] =\left[ 0,\frac{4}{\lambda }\right] \quad \Rightarrow \quad c=r=\frac{2}{\lambda } \end{aligned}$$

in their setting and thus

$$\begin{aligned} Lr=\lambda \cdot \frac{2}{\lambda }=2>1. \end{aligned}$$

Thus \(Lr<1\) condition of Jung’s work does not hold in this problem.

Example 2

Consider the differential equation (9) of Example 1 on the interval \(I:=\left[ 0, r\right] \) for any given real number \(r>0\). We have shown, in Example 1, that the function f satisfies the condition (7) with the Lipschitz constant \(L=\lambda \). If we define the function \(\varphi :I\rightarrow {\mathbb {R}}\) with \(\varphi (x):=\mathrm{e}^{(\lambda -1) x}\), (\(\lambda >1\)), we have

$$\begin{aligned} \left| \int _{x_0}^{x}\varphi (s){\mathrm{d}}{s}\right|= & {} \int _{0}^{x}\mathrm{e}^{(\lambda -1)s}{\mathrm{d}}{s}=\frac{1}{\lambda -1}\left( \mathrm{e}^{(\lambda -1)x}-1\right) \\\le & {} \frac{1}{\lambda -1}\mathrm{e}^{(\lambda -1) x} =\frac{1}{\lambda -1}\varphi (x) \end{aligned}$$

and the condition (8) hold with \(K=1/(\lambda -1)\). Therefore, according to Theorem 3, differential equation (9) is stable in the sense of Hyers–Ulam–Rassias.

We remark that Theorem 3.1 of Jung [15] does not work in this problem since

$$\begin{aligned} KL=\lambda \left( \frac{\lambda }{\lambda -1}\right) =1+\frac{\lambda }{\lambda -1}>1. \end{aligned}$$

Remark 4

Bojor [4] considered the stability problem of the linear equation

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

and proved the stability of this equation without a restriction on Lipschitz constant but replacing the condition (8) with a more restrictive condition

$$\begin{aligned} \int _{x_0}^{x}\left| f(s)\right| \varphi (s){\mathrm{d}}{s}\le P\varphi (x), \quad P\in \left( 0,1\right) . \end{aligned}$$

In Example 2, for the Eq. (9) with \(\varphi (x):=\mathrm{e}^{(\lambda -1)x}\) and \(\lambda >1\), we showed that

$$\begin{aligned} \int _{x_0}^{x}\left| f(s)\right| \varphi (s){\mathrm{d}}{s}=\lambda \int _{x_0}^{x}\varphi (s){\mathrm{d}}{s}\le \frac{\lambda }{\lambda -1}\varphi (x) \end{aligned}$$

in any interval [0, r]. It is apparent that Bojor’s [4] result does not apply to this problem since

$$\begin{aligned} P=\frac{\lambda }{\lambda -1}>1 \end{aligned}$$

in this case.

Remark 5

Tunç and Biçer [28] proved a stability result for the functional equation

$$\begin{aligned} y'(x)=F\left( x,y(x), y(x-\tau )\right) \end{aligned}$$

by modifying the technique of Jung [15]. If we cancel the delay, i.e. if we choose \(\tau =0\), we obtain the Eq. (1) which is considered in this paper. In this case the results Theorem 1 and Theorem 2 of Tunç and Biçer [28] still assume the condition \(Lr<1\), hence their results also do not apply to our example given above.