Throughout this paper, let $C(J,\mathbb{R})$ be the Banach space of all continuous functions from *J* into ℝ with the norm ${\parallel x\parallel}_{C}:=sup\{|x(t)|:t\in J\}$ for $x\in C(J,\mathbb{R})$. We introduce the Banach space $PC(J,\mathbb{R})$ := {$x:J\to \mathbb{R}:x\in C(({t}_{k},{t}_{k+1}],\mathbb{R})$, $k=0,1,\dots ,m$, and there exist $x({t}_{k}^{-})$ and $x({t}_{k}^{+})$, $k=1,\dots ,m$, with $x({t}_{k}^{-})=x({t}_{k})$} with the norm ${\parallel x\parallel}_{PC}:=sup\{|x(t)|:t\in J\}$. Meanwhile, we set $P{C}^{1}(J,\mathbb{R}):=\{x\in PC(J,\mathbb{R}):{x}^{\prime}\in PC(J,\mathbb{R})\}$ with ${\parallel x\parallel}_{P{C}^{1}}:=max\{{\parallel x\parallel}_{PC},{\parallel {x}^{\prime}\parallel}_{PC}\}$. Clearly, $P{C}^{1}(J,\mathbb{R})$ endowed with the norm ${\parallel \cdot \parallel}_{P{C}^{1}}$ is also a Banach space.

By virtue of the concept about the solutions in [1], we can introduce the following definition.

**Definition 2.1** A function

$x\in P{C}^{1}(J,\mathbb{R})$ is called a classical solution of the problem

$\{\begin{array}{l}{x}^{\prime}(t)=f(t,x(t)),\phantom{\rule{1em}{0ex}}t\in ({s}_{i},{t}_{i+1}],i=0,1,2,\dots ,m,\\ x(t)={g}_{i}(t,x(t)),\phantom{\rule{1em}{0ex}}t\in ({t}_{i},{s}_{i}],i=1,2,\dots ,m,\\ x(0)={x}_{0}\in \mathbb{R},\end{array}$

(3)

if

*x* satisfies

$\begin{array}{c}x(0)={x}_{0};\hfill \\ x(t)={g}_{i}(t,x(t)),\phantom{\rule{1em}{0ex}}t\in ({t}_{i},{s}_{i}],i=1,2,\dots ,m;\hfill \\ x(t)={x}_{0}+{\int}_{0}^{t}f(s,x(s))\phantom{\rule{0.2em}{0ex}}ds,\phantom{\rule{1em}{0ex}}t\in [0,{t}_{1}];\hfill \\ x(t)={g}_{i}({s}_{i},x({s}_{i}))+{\int}_{{s}_{i}}^{t}f(s,x(s))\phantom{\rule{0.2em}{0ex}}ds,\phantom{\rule{1em}{0ex}}t\in [{s}_{i},{t}_{i+1}],i=1,2,\dots ,m.\hfill \end{array}$

Next, we adopt the idea in [

12] and introduce a new Ulam-type stability concept for equation (

2). Set

$PC(J,{\mathbb{R}}_{+}):=\{x\in PC(J,\mathbb{R}):x(t)\ge 0\}$. Let

$\psi \ge 0$ and

$\phi \in PC(J,{\mathbb{R}}_{+})$. We consider the following inequality:

$\{\begin{array}{l}|{y}^{\prime}(t)-f(t,y(t))|\le \phi (t),\phantom{\rule{1em}{0ex}}t\in ({s}_{i},{t}_{i+1}],i=0,1,2,\dots ,m,\\ |y(t)-{g}_{i}(t,y(t))|\le \psi ,\phantom{\rule{1em}{0ex}}t\in ({t}_{i},{s}_{i}],i=1,2,\dots ,m.\end{array}$

(4)

**Definition 2.2** Equation (

2) is generalized Ulam-Hyers-Rassias stable with respect to

$(\phi ,\psi )$ if there exists

${c}_{f,{g}_{i},\phi ,m}>0$ such that for each solution

$y\in P{C}^{1}(J,\mathbb{R})$ of inequality (4), there exists a solution

$x\in P{C}^{1}(J,\mathbb{R})$ of equation (

2) with

$|y(t)-x(t)|\le {c}_{f,{g}_{i},\phi ,m}(\phi (t)+\psi ),\phantom{\rule{1em}{0ex}}t\in J.$

**Remark 2.3** Definition 2.2 has practical meaning in the following sense. Consider an evolution process with not sudden changes of states but acting on an interval, which can be modeled by equation (2). Assume that we can measure the state of the process at any time to get a function $x(\cdot )$. Putting this $x(\cdot )$ into equation (2), in general, we do not expect to get a precise solution of equation (2). All what is required is to get a function which satisfies the suitable approximation inequality (4). Our result of Section 3 will guarantee that there is a solution $y(\cdot )$ of inequality (4) close to the measured output $x(\cdot )$ and closeness is defined in the sense of generalized Ulam-Hyers-Rassias stability. This technique is quite useful in many applications such as numerical analysis, optimization, biology and economics, where it is quite difficult to find the exact solution.

**Remark 2.4** A function

$y\in P{C}^{1}(J,\mathbb{R})$ is a solution of inequality (4) if and only if there is

$G\in PC(J,\mathbb{R})$ and a sequence

${G}_{i}$,

$i=1,2,\dots ,m$ (which depend on

*y*) such that

- (i)
$|G(t)|\le \phi (t)$, $t\in J$ and $|{G}_{i}|\le \psi $, $i=1,2,\dots ,m$;

- (ii)
${y}^{\prime}(t)=f(t,y(t))+G(t)$, $t\in ({s}_{i},{t}_{i+1}]$, $i=0,1,2,\dots ,m$;

- (iii)
$y(t)={g}_{i}(t,y(t))+{G}_{i}$, $t\in ({t}_{i},{s}_{i}]$, $i=1,2,\dots ,m$.

**Remark 2.5** If

$y\in P{C}^{1}(J,\mathbb{R})$ is a solution of inequality (4), then

*y* is a solution of the following integral inequality:

$\{\begin{array}{l}|y(t)-{g}_{i}(t,y(t))|\le \psi ,\phantom{\rule{1em}{0ex}}t\in ({t}_{i},{s}_{i}],i=1,2,\dots ,m;\\ |y(t)-y(0)-{\int}_{0}^{t}f(s,y(s))\phantom{\rule{0.2em}{0ex}}ds|\le {\int}_{0}^{t}\phi (s)\phantom{\rule{0.2em}{0ex}}ds,\phantom{\rule{1em}{0ex}}t\in [0,{t}_{1}];\\ |y(t)-{g}_{i}({s}_{i},y({s}_{i}))-{\int}_{{s}_{i}}^{t}f(s,y(s))\phantom{\rule{0.2em}{0ex}}ds|\le \psi +{\int}_{{s}_{i}}^{t}\phi (s)\phantom{\rule{0.2em}{0ex}}ds,\phantom{\rule{1em}{0ex}}t\in [{s}_{i},{t}_{i+1}],i=1,2,\dots ,m.\end{array}$

(5)

In fact, by Remark 2.4 we get

$\{\begin{array}{l}{y}^{\prime}(t)=f(t,y(t))+G(t),\phantom{\rule{1em}{0ex}}t\in ({s}_{i},{t}_{i+1}],i=1,2,\dots ,m,\\ y(t)={g}_{i}(t,y(t))+{G}_{i},\phantom{\rule{1em}{0ex}}t\in ({t}_{i},{s}_{i}],i=1,2,\dots ,m.\end{array}$

(6)

Clearly, the solution of equation (

6) is given by

$\begin{array}{c}y(t)={g}_{i}(t,y(t))+{G}_{i},\phantom{\rule{1em}{0ex}}t\in ({t}_{i},{s}_{i}],i=1,2,\dots ,m;\hfill \\ y(t)=y(0)+{\int}_{0}^{t}(f(s,y(s))+G(s))\phantom{\rule{0.2em}{0ex}}ds,\phantom{\rule{1em}{0ex}}t\in [0,{t}_{1}];\hfill \\ y(t)=({g}_{i}({s}_{i},y({s}_{i}))+{G}_{i})+{\int}_{{s}_{i}}^{t}(f(s,y(s))+G(s))\phantom{\rule{0.2em}{0ex}}ds,\phantom{\rule{1em}{0ex}}t\in ({s}_{i},{t}_{i+1}],i=1,2,\dots ,m.\hfill \end{array}$

For each

$t\in ({s}_{i},{t}_{i+1}]$,

$i=0,1,2,\dots ,m$, we get

$|y(t)-{g}_{i}({s}_{i},y({s}_{i}))-{\int}_{{s}_{i}}^{t}f(s,y(s))\phantom{\rule{0.2em}{0ex}}ds|\le |{G}_{i}|+{\int}_{{s}_{i}}^{t}|G(s)|\phantom{\rule{0.2em}{0ex}}ds\le \psi +{\int}_{{s}_{i}}^{t}\phi (s)\phantom{\rule{0.2em}{0ex}}ds.$

Proceeding as above, we derive that

$\begin{array}{c}|y(t)-{g}_{i}(t,y(t))|\le |{G}_{i}|\le \psi ,\phantom{\rule{1em}{0ex}}t\in ({t}_{i},{s}_{i}],i=1,2,\dots ,m;\hfill \\ |y(t)-y(0)-{\int}_{0}^{t}f(s,y(s))\phantom{\rule{0.2em}{0ex}}ds|\le {\int}_{0}^{t}|G(s)|\phantom{\rule{0.2em}{0ex}}ds\le {\int}_{0}^{t}\phi (s)\phantom{\rule{0.2em}{0ex}}ds,\phantom{\rule{1em}{0ex}}t\in [0,{t}_{1}].\hfill \end{array}$

In order to deal with Ulam-type stability, we need the following result (see Theorem 16.4, [13]).

**Lemma 2.6** *Let the following inequality hold*:

$u(t)\le a(t)+{\int}_{0}^{t}b(s)u(s)\phantom{\rule{0.2em}{0ex}}ds+\sum _{0<{t}_{k}<t}{\beta}_{k}u\left({t}_{k}^{-}\right),\phantom{\rule{1em}{0ex}}t\ge 0,$

*where* $u,a,b\in PC({\mathbb{R}}_{+},{\mathbb{R}}_{+}):=\{x\in PC({\mathbb{R}}_{+},\mathbb{R}):x(t)\ge 0\}$, *a* *is nondecreasing and* $b(t)>0$, ${\beta}_{k}>0$, $k=1,\dots ,m$.

*Then*,

*for* $t\in {\mathbb{R}}_{+}$,

*the following inequality is valid*:

$u(t)\le a(t){(1+\beta )}^{k}exp({\int}_{0}^{t}b(s)\phantom{\rule{0.2em}{0ex}}ds),\phantom{\rule{1em}{0ex}}t\in ({t}_{k},{t}_{k+1}],k\in \{1,\dots ,m\},$

*where* $\beta =max\{{\beta}_{k}:k=1,\dots ,m\}$.