1 Introduction

The idea of fractional calculus is to replace the natural numbers in the derivative’s order with the rational ones. Although it seems an elementary consideration, it has an exciting correspondence explaining some physical phenomena. While several research studies have been performed on investigating the solutions existence of the fractional constant-order problems (we refer to [15, 8, 11, 21, 22, 24]), the solutions’ existence of the variable-order problems is rarely discussed in the literature (we refer to [7, 16, 27, 28, 30]). Therefore, all our results in this work are novel and worthwhile.

In relation to the study of the existence theory to boundary value problems of fractional variable order, we point out some of them. In [19], Jiahui and Pengyu studied the uniqueness of solutions to the initial value problem of Riemann–Liouville fractional differential equations of variable order. Zhang and Hu [35] established the existence of solutions and generalized Lyapunov-type inequalities of variable-order Riemann–Liouville boundary value problems.

Recently, Bouazza et al. [15] studied a Riemann–Liouville variable-order boundary value problem, and Benkerrouche et al. [14] presented the existence results and Ulam–Hyers stability for implicit nonlinear Caputo fractional differential equations of variable order. In 2021, Hristova et al. [18] and Refice et al. [23] turned to the investigation of boundary value problems of Hadamard fractional differential equations of variable order via the Kuratowski measure of noncompactness technique; for more studies, we refer to [26, 30, 34].

In particular, [6] Agarwal et al. studied the following problem:

$$\begin{aligned} \textstyle\begin{cases} D^{u}_{0^{+}}x(t)= f(t, x(t)),& t\in J:= [0, \infty ), u\in ]1, 2], \\ x(0)=0, & x \text{ bounded on } [0, \infty ), \end{cases}\displaystyle \end{aligned}$$

where \(D^{u}_{0^{+}}\) is the Riemann–Liouville fractional derivative of order u, f is a given function.

Inspired by [6] and [7, 16, 27, 28, 30], we deal with the boundary value problem (BVP)

$$\begin{aligned} \textstyle\begin{cases} {}^{c}D^{u(t)}_{0^{+}}x(t)= f_{1}(t, x(t)),\quad t\in J:= [0, T] \\ x(0)=0,\qquad x(T)=0, \end{cases}\displaystyle \end{aligned}$$
(1)

where \(1< u(t)\leq 2\), \(f_{1}:J \times \mathbb{R} \rightarrow \mathbb{R}\) is a continuous function and \({}^{c}D^{u(t)}_{0^{+}}\) is the Caputo fractional derivative of variable order \(u(t)\).

In this paper, we shall look for a solution of (1). Further, we study the stability of the obtained solution of (1) in the sense of Ulam–Hyers (UH).

2 Preliminaries

This section introduces some important fundamental definitions that will be needed for obtaining our results in the next sections.

The symbol \(C(J, \mathbb{R})\) represents the Banach space of continuous functions \(\varkappa:J \to \mathbb{R}\) with the norm

$$\begin{aligned} \Vert \varkappa \Vert =\operatorname{Sup} \bigl\{ \bigl\vert \varkappa (t) \bigr\vert : t\in J \bigr\} . \end{aligned}$$

For \(- \infty < a_{1} < a_{2} < + \infty \), we consider the mappings \(u(t): [a_{1}, a_{2}]\rightarrow (0, +\infty ) \) and \(v(t): [a_{1}, a_{2}]\rightarrow (n-1, n)\). Then, the left Riemann–Liouville fractional integral (RLFI) of variable order \(u(t)\) for function \(f_{2}(t)\) ([25, 26, 29]) is

$$\begin{aligned} I^{u(t)}_{a_{1}^{+}}f_{2}(t)= \int _{a_{1}}^{t} \frac{(t-s)^{u(t)-1}}{\Gamma (u(t))}f_{2}(s) \,ds,\quad t> a_{1}, \end{aligned}$$
(2)

and the left Caputo fractional derivative (CFD) of variable order \(v(t)\) for function \(f_{2}(t)\) ([25, 26, 29]) is

$$\begin{aligned} {}^{c}D^{u(t)}_{a_{1}^{+}}f_{2}(t)= \int _{a_{1}}^{t} \frac{(t-s)^{n-u(t)-1}}{\Gamma (n-u(t))}f^{(n)}_{2}(s) \,ds,\quad t> a_{1}. \end{aligned}$$
(3)

As anticipated, in case \(u(t)\) and \(v(t)\) are constant, then CFD and RLFI coincide with the standard Caputo fractional derivative of constant order and the standard Riemann–Liouville fractional integral of constant order, respectively, see e.g. [20, 25, 26].

Recall the following pivotal observation.

Lemma 2.1

([20])

Let \(\alpha _{1}, \alpha _{2} >0\), \(a_{1} >0\), \(f_{2} \in L(a_{1}, a_{2})\), \({}^{c}D_{a_{1}^{+}}^{\alpha _{1}}f_{2}\in L(a_{1}, a_{2})\). Then the differential equation

$$\begin{aligned} {}^{c}D_{a_{1}^{+}}^{\alpha _{1}}f_{2}=0 \end{aligned}$$

has the unique solution

$$\begin{aligned} f_{2}(t)=\omega _{0}+\omega _{1}(t-a_{1})+ \omega _{2}(t-a_{1})^{2}+\cdots+ \omega _{n-1}(t-a_{1})^{n-1}, \end{aligned}$$

and

$$\begin{aligned} I_{a_{1}^{+}}^{\alpha _{1}} {}^{c}D_{a_{1}^{+}}^{\alpha _{1}}f_{2}(t)=f_{2}(t)+ \omega _{0}+\omega _{1}(t-a_{1})+\omega _{2}(t-a_{1})^{2}+\cdots+\omega _{n-1}(t-a_{1})^{n-1} \end{aligned}$$

with \(n-1 < \alpha _{1} \leq n\), \(\omega _{\ell}\in \mathbb{R}\), \(\ell =0,1,\ldots,n-1\).

Furthermore,

$$\begin{aligned} {}^{c}D_{a_{1}^{+}}^{\alpha _{1}}I_{a_{1}^{+}}^{\alpha _{1}}f_{2}(t)=f_{2}(t) \end{aligned}$$

and

$$\begin{aligned} I_{a_{1}^{+}}^{\alpha _{1}}I_{a_{1}^{+}}^{\alpha _{2}}f_{2}(t)=I_{a_{1}^{+}}^{ \alpha _{2}}I_{a_{1}^{+}}^{\alpha _{1}}f_{2}(t)=I_{a_{1}^{+}}^{ \alpha _{1}+\alpha _{2}}f_{2}(t). \end{aligned}$$

Remark

([31, 33, 34])

Note that the semigroup property is not fulfilled for general functions \(u(t)\), \(v(t)\), i.e.,

$$\begin{aligned} I_{a_{1}^{+}}^{u(t)}I_{a_{1}^{+}}^{v(t)}f_{2}(t) \neq I_{a_{1}^{+}}^{u(t)+v(t)}f_{2}(t). \end{aligned}$$

Example

Let

$$\begin{aligned} &u(t)=t,\quad t \in [0, 4],\qquad v(t)= \textstyle\begin{cases} 2, t \in [0, 1], \\ 3, t \in ]1, 4], \end{cases}\displaystyle \qquad f_{2}(t)=2, \quad t \in [0, 4]. \\ &I_{0^{+}}^{u(t)}I_{0^{+}}^{v(t)}f_{2}(t)= \int _{0}^{t} \frac{(t-s)^{u(t)-1}}{\Gamma (u(t))} \int _{0}^{s} \frac{(s-\tau )^{v(s)-1}}{\Gamma (v(s))}f_{2}( \tau )\,d\tau\, ds \\ &\phantom{I_{0^{+}}^{u(t)}I_{0^{+}}^{v(t)}f_{2}(t)}= \int _{0}^{t}\frac{(t-s)^{t-1}}{\Gamma (t)} \biggl[ \int _{0}^{1} \frac{(s-\tau )}{\Gamma (2)}2\,d\tau + \int _{1}^{s} \frac{(s-\tau )^{2}}{\Gamma (3)}2\,d\tau \biggr] \,ds \\ &\phantom{I_{0^{+}}^{u(t)}I_{0^{+}}^{v(t)}f_{2}(t)}= \int _{0}^{t}\frac{(t-s)^{t-1}}{\Gamma (t)} \biggl[ 2s-1 + \frac{(s-1)^{3}}{3} \biggr] \,ds \end{aligned}$$

and

$$\begin{aligned} I_{0^{+}}^{u(t)+v(t)}f_{2}(t)|= \int _{0}^{t} \frac{(t-s)^{u(t)+v(t)-1}}{\Gamma (u(t)+v(t))}f_{2}(s) \,ds. \end{aligned}$$

So, we get

$$\begin{aligned} &I_{0^{+}}^{u(t)}I_{0^{+}}^{v(t)}f_{2}(t)|_{t=3}= \int _{0}^{3} \frac{(3-s)^{2}}{\Gamma (3)} \biggl[ 2s-1 + \frac{(s-1)^{3}}{3} \biggr] \,ds \\ &\phantom{I_{0^{+}}^{u(t)}I_{0^{+}}^{v(t)}f_{2}(t)|_{t=3}}=\frac{21}{10}, \\ &I_{0^{+}}^{u(t)+v(t)}f_{2}(t)|_{t=3}= \int _{0}^{3} \frac{(3-s)^{u(t)+v(t)-1}}{\Gamma (u(t)+v(t))}f_{2}(s) \,ds \\ &\phantom{I_{0^{+}}^{u(t)+v(t)}f_{2}(t)|_{t=3}}= \int _{0}^{1}\frac{(3-s)^{4}}{\Gamma (5)}2\,ds + \int _{1}^{3} \frac{(3-s)^{5}}{\Gamma (6)}2\,ds \\ &\phantom{I_{0^{+}}^{u(t)+v(t)}f_{2}(t)|_{t=3}}=\frac{1}{12} \int _{0}^{1} \bigl(s^{4}-12s^{3}+54s^{2}-108s+81 \bigr)\,ds \\ &\phantom{I_{0^{+}}^{u(t)+v(t)}f_{2}(t)|_{t=3}=}+\frac{1}{60} \int _{1}^{3} \bigl(-s^{5}+15s^{4}-90s^{3}+270s^{2}-405s+243 \bigr)\,ds \\ &\phantom{I_{0^{+}}^{u(t)+v(t)}f_{2}(t)|_{t=3}}=\frac{665}{180}. \end{aligned}$$

Therefore, we obtain

$$\begin{aligned} I_{0^{+}}^{u(t)}I_{0^{+}}^{v(t)}f_{2}(t)|_{t=3} \neq I_{0^{+}}^{u(t)+v(t)}f_{2}(t)|_{t=3}. \end{aligned}$$

Lemma 2.2

([36])

Let \(u: J \rightarrow (1, 2]\) be a continuous function, then for \(f_{2} \in C_{\delta}(J, {\mathbb{R}})=\{ f_{2}(t)\in C(J, {\mathbb{R}}), t^{\delta}f_{2}(t) \in C(J, {\mathbb{R}}), 0 \leq \delta \leq 1 \}\), the variable order fractional integral \(I^{u(t)}_{0^{+}}f_{2}(t)\) exists for any points on J.

Lemma 2.3

([36])

Let \(u: J \rightarrow (1, 2]\) be a continuous function, then \(I^{u(t)}_{0^{+}} f_{2}(t)\in C(J, \mathbb{R})\) for \(f_{2} \in C(J, \mathbb{R})\).

Definition 2.1

([19, 32, 35])

Let \(I \subset \mathbb{R}\), I is called a generalized interval if it is either an interval or \(\{a_{1}\}\), or ∅.

A finite set \({\mathcal{P}}\) is called a partition of I if each x in I lies in exactly one of the generalized intervals E in \({\mathcal{P}}\).

A function \(g: I \rightarrow \mathbb{R}\) is called piecewise constant with respect to partition \({\mathcal{P}}\) of I if, for any \(E \in {\mathcal{P}}\), g is constant on E.

2.1 Measure of noncompactness

This subsection discusses some necessary background information about the Kuratowski measure of noncompactness (KMNC).

Definition 2.2

([9])

Let X be a Banach space and \(\Omega _{X}\) be the bounded subsets of X. The (KMNC) is a mapping \(\zeta:\Omega _{X}\to [0,\infty ]\) which is constructed as follows:

$$\begin{aligned} \zeta (D)=\inf \Biggl\{ \epsilon >0: \exists (D_{\ell})_{\ell =1,2,\ldots,n} \subset X, D \subseteq \bigcup_{\ell =1}^{n}D_{\ell}, \operatorname{diam} (D_{\ell}) \leq \epsilon \Biggr\} , \end{aligned}$$

where

$$\begin{aligned} \operatorname{diam}(D_{\ell})=\sup\bigl\{ \Vert x-y \Vert : x, y \in D_{\ell}\bigr\} . \end{aligned}$$

The following properties are valid for (KMNC).

Proposition 2.1

([9, 10])

Let X be a Banach space, \(D, D_{1}, D_{2}\) are bounded subsets of X, then

  1. 1.

    \(\zeta (D)=0\Longleftrightarrow D\) is relatively compact.

  2. 2.

    \(\zeta (\phi )= 0\).

  3. 3.

    \(\zeta (D) =\zeta (\overline{D}) = \zeta (\operatorname{conv} D)\).

  4. 4.

    \(D_{1} \subset D_{2} \Longrightarrow \zeta (D_{1})\leq \zeta (D_{2})\).

  5. 5.

    \(\zeta (D_{1}+D_{2}) \leq \zeta (D_{1})+\zeta (D_{2})\).

  6. 6.

    \(\zeta (\lambda D)=|\lambda |\zeta (D), \lambda \in \mathbb{R}\).

  7. 7.

    \(\zeta (D_{1}\cup D_{2})=\operatorname{Max}\{\zeta (D_{1}), \zeta (D_{2})\}\).

  8. 8.

    \(\zeta (D_{1}\cap D_{2})=\operatorname{Min}\{\zeta (D_{1}), \zeta (D_{2})\}\).

  9. 9.

    \(\zeta (D+ x_{0})=\zeta (D)\) for any \(x_{0}\in X\).

Lemma 2.4

([17])

If \(U\subset C(J, X)\) is an equicontinuous and bounded set, then

  1. (i)

    the function \(\zeta (U(t))\) is continuous for \(t\in J\), and

    $$\begin{aligned} \widehat{\zeta}(U)= \sup_{t\in J} \zeta \bigl(U(t) \bigr). \end{aligned}$$
  2. (ii)

    \(\zeta ( \int _{0}^{T} x(\theta )\,d\theta:x\in U )\leq \int _{0}^{T}\zeta (U(\theta ))\,d\theta\),

where

$$\begin{aligned} U(s)= \bigl\{ x(s): x\in U \bigr\} , \quad s\in J. \end{aligned}$$

Theorem 2.1

(Darbo’s fixed point theorem (DFPT) [9])

Let Λ be nonempty, closed, bounded, and convex subset of a Banach space X and \(\digamma: \Lambda \longrightarrow \Lambda \) be a continuous operator satisfying

$$\begin{aligned} \zeta \bigl(\digamma (S) \bigr)\leq k\zeta (S),\quad \textit{for any }S(\neq \emptyset ) \subset \Lambda, k\in [0, 1), \end{aligned}$$

i.e., Ϝ is k-set contractions.

Then Ϝ has at least one fixed point in Λ.

Definition 2.3

([13])

The equation of (1) is (UH) stable if there exists \(c_{f_{1}}>0\) such that for any \(\epsilon >0\) and for every solution \(z \in C(J, \mathbb{R})\) of the following inequality

$$\begin{aligned} \bigl\vert {}^{c}D^{u(t)}_{0^{+}}z(t)- f_{1} \bigl(t, z(t) \bigr) \bigr\vert \leq \epsilon,\quad t\in J, \end{aligned}$$
(4)

there exists a solution \(x \in C(J, \mathbb{R})\) of equation (1) with

$$\begin{aligned} \bigl\vert z(t)- x(t) \bigr\vert \leq c_{f_{1}} \epsilon,\quad t\in J. \end{aligned}$$

3 Main results

3.1 Existence of solutions

Let us introduce the following assumption:

  1. (H1)

    Let \(n\in \mathbb{N}\) be an integer, \({\mathcal{P}} =\{J_{1}:=[0,T_{1}], J_{2}:=(T_{1},T_{2}], J_{3}:=(T_{2},T_{3}],\ldots J_{n}:=(T_{n-1},T] \}\) be a partition of the interval J, and let \(u(t): J \rightarrow (1,2]\) be a piecewise constant function with respect to \({\mathcal{P}}\), i.e.,

$$\begin{aligned} u(t)=\sum_{\ell =1}^{n}u_{\ell}I_{\ell}(t)= \textstyle\begin{cases} u_{1} & \text{if } t\in J_{1}, \\ u_{2} & \text{if } t\in J_{2}, \\ \vdots \\ u_{n}& \text{if } t\in J_{n}, \end{cases}\displaystyle \end{aligned}$$

where \(1< u_{\ell} \leq 2 \) are constants, and \(I_{\ell}\) is the indicator of the interval \(J_{\ell}:=(T_{\ell -1},T_{\ell}], \ell =1,2,\ldots,n\), (with \(T_{0}=0, T_{n}=T\)) such that

$$\begin{aligned} I_{\ell}(t)= \textstyle\begin{cases} 1& \text{for } t\in J_{\ell}, \\ 0& \text{for elsewhere}. \end{cases}\displaystyle \end{aligned}$$

Further, for a given set U of functions \(u: J \to X\), let us denote

$$\begin{aligned} U(t)= \bigl\{ u(t), u \in U \bigr\} , \quad t\in J, \end{aligned}$$

and

$$\begin{aligned} U(J)= \bigl\{ U(t):v\in U, t\in J \bigr\} . \end{aligned}$$

For each \(\ell \in \{1, 2,\ldots,n \}\), the symbol \(E_{\ell}= C(J_{\ell}, \mathbb{R})\) indicates the Banach space of continuous functions \(x:J_{\ell} \to \mathbb{R}\) equipped with the norm

$$\begin{aligned} \Vert x \Vert _{E_{\ell}}=\sup_{t\in J_{\ell}} \bigl\vert x(t) \bigr\vert . \end{aligned}$$

Then, for any \(t \in J_{\ell}, \ell = 1, 2,\ldots, n\), the (CFD) of variable order \(u(t)\) for function \(x(t) \in C(J,\mathbb{R})\), defined by (3), could be presented as a sum of left Caputo fractional derivatives of constant orders \(u_{\ell}, \ell = 1, 2,\ldots, n\):

$$\begin{aligned} {}^{c}D^{u(t)}_{0^{+}}x(t) = \int _{0}^{T_{1}} \frac{(t-s)^{1-u_{1}}}{\Gamma (2-u_{1})}x^{(2)}(s) \,ds +\cdots+ \int _{T_{ \ell -1}}^{t}\frac{(t-s)^{1-u_{\ell}}}{\Gamma (2-u_{\ell})}x^{(2)}(s) \,ds. \end{aligned}$$
(5)

Thus, according to (5), (BVP)(1) can be written, for any \(t \in J_{\ell}, \ell = 1, 2,\ldots, n\), in the form

$$\begin{aligned} \int _{0}^{T_{1}}\frac{(t-s)^{1-u_{1}}}{\Gamma (2-u_{1})}x^{(2)}(s) \,ds +\cdots+ \int _{T_{\ell -1}}^{t}\frac{(t-s)^{1-u_{\ell}}}{\Gamma (2-u_{\ell})}x^{(2)}(s) \,ds = f_{1} \bigl(t, x(t) \bigr),\quad t \in J_{\ell}. \end{aligned}$$
(6)

In what follows we shall introduce the solution to BVP (1).

Definition 3.1

BVP (1) has a solution if there are functions \(x_{\ell}, \ell =1, 2,\ldots, n\), so that \(x_{\ell} \in C([0, T_{\ell}], \mathbb{R})\) fulfilling equation (6) and \(x_{\ell}(0) = 0 = x_{\ell}(T_{\ell})\).

Let the function \(x \in C(J, \mathbb{R})\) be such that \(x(t) \equiv 0\) on \(t \in [0, T_{\ell -1}]\) and it solves integral equation (6). Then (6) is reduced to

$$\begin{aligned} {}^{c}D^{u_{\ell}}_{T_{\ell -1}^{+}} x(t)= f_{1} \bigl(t, x(t) \bigr),\quad t \in J_{ \ell}. \end{aligned}$$

We shall deal with the following BVP:

$$\begin{aligned} \textstyle\begin{cases} {}^{c}D^{u_{\ell}}_{T_{\ell -1}^{+}} x(t)= f_{1}(t, x(t)),\quad t \in J_{ \ell}, \\ x(T_{{\ell -1}})=0,\qquad x(T_{\ell})=0. \end{cases}\displaystyle \end{aligned}$$
(7)

For our purpose, the upcoming lemma will be a corner stone of the solution of BVP (7).

Lemma 3.1

Let \(\ell \in \{1,2,\ldots,n\}\) be a natural number, \(f_{1}\in C(J_{\ell} \times \mathbb{R}, \mathbb{R})\), and there exists a number \(\delta \in (0, 1)\) such that \(t^{\delta} f_{1}\in C(J_{\ell} \times \mathbb{R}, \mathbb{R})\).

Then the function \(x \in E_{\ell}\) is a solution of BVP (7) if and only if x solves the integral equation

$$\begin{aligned} x(t) =-(T_{\ell}-T_{{\ell -1}})^{-1}(t-T_{\ell -1}) I^{u_{\ell}}_{T_{ \ell -1}^{+}} f_{1} \bigl(T_{\ell}, x(T_{\ell}) \bigr) +I^{u_{\ell}}_{T_{\ell -1}^{+}}f_{1} \bigl(t, x(t) \bigr). \end{aligned}$$
(8)

Proof

We presume that \(x \in E_{\ell}\) is a solution of BVP (7). Employing the operator \(I^{u_{\ell}}_{T_{\ell -1}^{+}}\) to both sides of (7) and regarding Lemma 2.1, we find

$$\begin{aligned} x(t)=\omega _{1} + \omega _{2}(t-T_{{\ell -1}})+ \frac{1}{\Gamma (u_{\ell})} \int _{T_{{\ell -1}}}^{t}(t-s)^{u_{\ell}-1} f_{1} \bigl(s, x(s) \bigr)\,ds,\quad t \in J_{\ell}. \end{aligned}$$

By \(x(T_{\ell -1}) = 0\), we get \(\omega _{1}=0\).

Let \(x(t)\) satisfy \(x(T_{\ell})=0\). So, we observe that

$$\begin{aligned} \omega _{2} = -(T_{\ell}-T_{{\ell -1}})^{-1} I^{u_{\ell}}_{T_{\ell -1}^{+}} f_{1} \bigl(T_{\ell}, x(T_{\ell}) \bigr). \end{aligned}$$

Then we find

$$\begin{aligned} x(t) =-(T_{\ell}-T_{{\ell -1}})^{-1}(t-T_{\ell -1})I^{u_{\ell}}_{T_{ \ell -1}^{+}} f_{1} \bigl(T_{\ell}, x(T_{\ell}) \bigr)+ I^{u_{\ell}}_{T_{\ell -1}^{+}}f_{1} \bigl(t, x(t) \bigr),\quad t \in J_{\ell}. \end{aligned}$$

Conversely, let \(x \in E_{\ell}\) be a solution of integral equation (8). Regarding the continuity of function \(t^{\delta} f_{1}\) and Lemma 2.1, we deduce that x is the solution of BVP (7). □

We are now in a position to prove the existence of solution for (BVP) (7) based on the concept of (MNCK) and (DFPT).

Theorem 3.1

Let the conditions of Lemma 3.1be satisfied and there exist a constant \(K >0\) such that

$$\begin{aligned} t^{\delta} \bigl\vert f_{1}(t,y_{1})- f_{1}(t,y_{2}) \bigr\vert \leq K \vert y_{1}-y_{2} \vert \end{aligned}$$
(9)

for any \(y_{1}, y_{2} \in \mathbb{R}\), \(t\in J_{\ell}\), and the inequality

$$\begin{aligned} \frac{2K(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}(T_{\ell}^{1-\delta}-T_{\ell -1}^{1-\delta})}{(1-\delta )\Gamma (u_{\ell})} < 1 \end{aligned}$$
(10)

holds. Then BVP (7) possesses at least one solution in \(E_{\ell}\).

Proof

We construct the operator

$$\begin{aligned} W: E_{\ell} \rightarrow E_{\ell} \end{aligned}$$

as follows:

$$\begin{aligned} Wx(t) ={}&{-}(T_{\ell}-T_{{\ell -1}})^{-1}(t-T_{\ell -1}) I^{u_{\ell}}_{T_{ \ell -1}^{+}} f_{1} \bigl(T_{\ell}, x(T_{\ell}) \bigr) \\ &{}+\frac{1}{\Gamma (u_{\ell})} \int _{T_{{\ell -1}}}^{t}(t-s)^{u_{\ell -1}} f_{1} \bigl(s, x(s) \bigr)\,ds,\quad t \in J_{\ell}. \end{aligned}$$
(11)

It follows from the properties of fractional integrals and from the continuity of function \(t^{\delta}f_{1}\) that the operator \(W: E_{\ell}\)\(E_{\ell}\) defined in (11) is well defined.

Let

$$\begin{aligned} R_{\ell} \geq \frac{\frac{2f^{\star}(T_{\ell}-T_{\ell -1})^{u_{\ell}}}{\Gamma (u_{\ell})}}{1-\frac{2(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}(T_{\ell}^{1-\delta}-T_{\ell -1}^{1-\delta})}{(1-\delta )\Gamma (u_{\ell})} (K+ L\frac{(T_{\ell}-T_{\ell -1})^{u_{\ell}}}{\Gamma (u_{\ell}+1)})} \end{aligned}$$

with

$$\begin{aligned} f^{\star}= \sup_{t\in J_{\ell}} \bigl\vert f_{1}(t, 0) \bigr\vert . \end{aligned}$$

We consider the set

$$\begin{aligned} B_{R_{\ell}}= \bigl\{ x \in E_{\ell}, \Vert x \Vert _{E_{\ell}}\leq R_{\ell} \bigr\} . \end{aligned}$$

Clearly, \(B_{R_{\ell}}\) is nonempty, closed, convex, and bounded. □

Now, we demonstrate that W satisfies the assumption of Theorem 2.1. We shall prove it in four phases.

Step 1: Claim: \(W(B_{R_{\ell}})\subseteq (B_{R_{\ell}})\).

For \(x \in B_{R_{\ell}}\) and by (H2), we get

$$\begin{aligned} \bigl\vert Wx(t) \bigr\vert \leq{}& \frac{(T_{\ell}-T_{\ell -1})^{-1}(t-T_{\ell -1})}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{T_{\ell}}(T_{\ell}-s)^{u_{\ell}-1} \bigl\vert f_{1} \bigl(s, x(s) \bigr) \bigr\vert \,ds\\ &{}+ \frac{1}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{t}(t-s)^{u_{\ell}-1} \bigl\vert f_{1} \bigl(s, x(s) \bigr) \bigr\vert \,ds \\ \leq{}& \frac{2}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{T_{\ell}}(T_{ \ell}-s)^{u_{\ell}-1} \bigl\vert f_{1} \bigl(s, x(s) \bigr) \bigr\vert \,ds \\ \leq{}& \frac{2}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{T_{\ell}}(T_{ \ell}-s)^{u_{\ell}-1} \bigl\vert f_{1} \bigl(s, x(s) \bigr)-f_{1}(s, 0) \bigr\vert \,ds\\ &{}+ \frac{2}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{T_{\ell}}(T_{\ell}-s)^{u_{ \ell}-1} \bigl\vert f_{1}(s, 0) \bigr\vert \,ds \\ \leq{}& \frac{2}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{T_{\ell}}(T_{ \ell}-s)^{u_{\ell}-1} s^{-\delta} \bigl(K \bigl\vert x(s) \bigr\vert \bigr)\,ds + \frac{2f^{\star}(T_{\ell}-T_{\ell -1})^{u_{\ell}}}{\Gamma (u_{\ell})} \\ \leq{}& \frac{2(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{T_{\ell}} s^{-\delta} \bigl(K \bigl\vert x(s) \bigr\vert \bigr)\,ds + \frac{2f^{\star}(T_{\ell}-T_{\ell -1})^{u_{\ell}}}{\Gamma (u_{\ell})} \\ \leq{}& \frac{2K(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}(T_{\ell}^{1-\delta}-T_{\ell -1}^{1-\delta})}{(1-\delta )\Gamma (u_{\ell})} R_{\ell} + \frac{2f^{\star}(T_{\ell}-T_{\ell -1})^{u_{\ell}}}{\Gamma (u_{\ell})} \\ \leq{}& R_{\ell}, \end{aligned}$$

which means that \(W(B_{R_{\ell}}) \subseteq B_{R_{\ell}} \).

Step 2: Claim: W is continuous.

We presume that the sequence \((x_{n})\) converges to x in \(E_{\ell}\) and \(t \in J_{\ell}\). Then

$$\begin{aligned} &\bigl\vert (Wx_{n}) (t)-(Wx) (t) \bigr\vert \\ &\quad \leq \frac{(T_{\ell}-T_{\ell -1})^{-1}(t-T_{\ell -1})}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{T_{\ell}}(T_{\ell}-s)^{u_{\ell}-1} \bigl\vert f_{1} \bigl(s, x_{n}(s) \bigr)-f_{1} \bigl(s, x(s) \bigr) \bigr\vert \,ds \\ &\qquad{}+\frac{1}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{t}(t-s)^{u_{\ell}-1} \bigl\vert f_{1} \bigl(s, x_{n}(s) \bigr)-f_{1} \bigl(s, x(s) \bigr) \bigr\vert \,ds \\ &\quad\leq \frac{2}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{T_{\ell}}(T_{ \ell}-s)^{u_{\ell}-1} \bigl\vert f_{1} \bigl(s, x_{n}(s) \bigr)-f_{1} \bigl(s, x(s) \bigr) \bigr\vert \,ds \\ &\quad \leq \frac{2}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{T_{\ell}}s^{- \delta}(T_{\ell}-s)^{u_{\ell}-1} \bigl(K \bigl\vert x_{n}(s)- x(s) \bigr\vert \bigr)\,ds \\ &\quad\leq \frac{2K(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}}{\Gamma (u_{\ell})} \Vert x_{n}- x \Vert _{E_{\ell}} \int _{T_{\ell -1}}^{T_{\ell}}s^{-\delta}\,ds \\ &\quad\leq \frac{2K(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}({T_{\ell}}^{1-\delta}-{T_{\ell -1}}^{1-\delta})}{(1-\delta )\Gamma (u_{\ell})} \Vert x_{n}-x \Vert _{E_{\ell}}, \end{aligned}$$

i.e., we obtain

$$\begin{aligned} \bigl\Vert (Wx_{n})-(Wx) \bigr\Vert _{E_{\ell}}\rightarrow 0\quad \text{as }n \rightarrow \infty. \end{aligned}$$

Ergo, the operator W is continuous on \(E_{\ell}\).

Step 3: Claim: W is bounded and equicontinuous.

By Step 1, we have \(W(B_{R_{\ell}})= \{W(x): x \in B_{R_{\ell}} \} \subset B_{R_{\ell}}\), thus for each \(x \in B_{R_{\ell}}\) we have \(\|W(x)\|_{E_{\ell}} \leq R_{\ell}\), which means that \(W(B_{R_{\ell}})\) is bounded. It remains to indicate that \(W(B_{R_{\ell}})\) is equicontinuous.

For \(t_{1},t_{2}\in J_{\ell}, t_{1} < t_{2}\) and \(x \in B_{R_{\ell}}\), we have

$$\begin{aligned} & \bigl\vert (Wx) (t_{2})-(Wx) (t_{1}) \bigr\vert \\ &\quad= \biggl\vert - \frac{(T_{\ell}-T_{\ell -1})^{-1}(t_{2}-T_{\ell -1})}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{T_{\ell}}(T_{\ell}-s)^{u_{\ell}-1} f_{1} \bigl(s, x(s) \bigr)\,ds \\ &\qquad{}+\frac{1}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{t_{2}}(t_{2}-s)^{u_{ \ell}-1} f_{1} \bigl(s, x(s) \bigr)\,ds+ \frac{(T_{\ell}-T_{\ell -1})^{-1}(t_{1}-T_{\ell -1})}{\Gamma (u_{\ell})} \\ &\qquad{}\times \int _{T_{\ell -1}}^{T_{\ell}}(T_{\ell}-s)^{u_{\ell}-1} f_{1} \bigl(s, x(s) \bigr)\,ds- \frac{1}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{t_{1}}(t_{1}-s)^{u_{ \ell}-1} f_{1} \bigl(s, x(s) \bigr)\,ds \biggr\vert \\ &\quad\leq \frac{(T_{\ell}-T_{\ell -1})^{-1}}{\Gamma (u_{\ell})} \bigl((t_{2}-T_{ \ell -1})-(t_{1}-T_{\ell -1}) \bigr) \int _{T_{\ell -1}}^{T_{\ell}}(T_{ \ell}-s)^{u_{\ell}-1} \bigl\vert f_{1} \bigl(s, x(s) \bigr) \bigr\vert \,ds \\ &\qquad{}+\frac{1}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{t_{1}} \bigl((t_{2}-s)^{u_{ \ell}-1}-(t_{1}-s)^{u_{\ell}-1} \bigr) \bigl\vert f_{1} \bigl(s, x(s) \bigr) \bigr\vert \,ds\\ &\qquad{}+ \frac{1}{\Gamma (u_{\ell})} \int _{t_{1}}^{t_{2}}(t_{2}-s)^{u_{\ell}-1} \bigl\vert f_{1} \bigl(s, x(s) \bigr) \bigr\vert \,ds \\ &\quad\leq \frac{(T_{\ell}-T_{\ell -1})^{-1}}{\Gamma (u_{\ell})} \bigl((t_{2}-T_{ \ell -1})-(t_{1}-T_{\ell -1}) \bigr) \int _{T_{\ell -1}}^{T_{\ell}}(T_{ \ell}-s)^{u_{\ell}-1} \bigl\vert f_{1} \bigl(s, x(s) \bigr)-f_{1}(s, 0) \bigr\vert \,ds \\ &\qquad{}+\frac{(T_{\ell}-T_{\ell -1})^{-1}}{\Gamma (u_{\ell})} \bigl((t_{2}-T_{ \ell -1})-(t_{1}-T_{\ell -1}) \bigr) \int _{T_{\ell -1}}^{T_{\ell}}(T_{ \ell}-s)^{u_{\ell}-1} \bigl\vert f_{1}(s, 0) \bigr\vert \,ds \\ &\qquad{}+\frac{1}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{t_{1}} \bigl((t_{2}-s)^{u_{ \ell}-1}-(t_{1}-s)^{u_{\ell}-1} \bigr) \bigl\vert f_{1} \bigl(s, x(s) \bigr)-f_{1}(s, 0) \bigr\vert \,ds \\ &\qquad{}+\frac{1}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{t_{1}} \bigl((t_{2}-s)^{u_{ \ell}-1}-(t_{1}-s)^{u_{\ell}-1} \bigr) \bigl\vert f_{1}(s, 0) \bigr\vert \,ds \\ &\qquad{}+\frac{1}{\Gamma (u_{\ell})} \int _{t_{1}}^{t_{2}}(t_{2}-s)^{u_{ \ell}-1} \bigl\vert f_{1} \bigl(s, x(s) \bigr)-f_{1}(s, 0) \bigr\vert \,ds+\frac{1}{\Gamma (u_{\ell})} \int _{t_{1}}^{t_{2}}(t_{2}-s)^{u_{\ell}-1} \bigl\vert f_{1}(s, 0) \bigr\vert \,ds \\ &\quad\leq \frac{(T_{\ell}-T_{\ell -1})^{-1}}{\Gamma (u_{\ell})} \bigl((t_{2}-T_{ \ell -1})-(t_{1}-T_{\ell -1}) \bigr) \int _{T_{\ell -1}}^{T_{\ell}}(T_{ \ell}-s)^{u_{\ell}-1}s^{-\delta} \bigl(K \bigl\vert x(s) \bigr\vert \bigr)\,ds \\ &\qquad{}+\frac{f^{\star}(T_{\ell}-T_{\ell -1})^{-1}}{\Gamma (u_{\ell})} \bigl((t_{2}-T_{\ell -1})-(t_{1}-T_{\ell -1}) \bigr) \int _{T_{\ell -1}}^{T_{ \ell}}(T_{\ell}-s)^{u_{\ell}-1} \,ds \\ &\qquad{}+\frac{1}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{t_{1}}s^{-\delta} \bigl((t_{2}-s)^{u_{\ell}-1}-(t_{1}-s)^{u_{\ell}-1} \bigr) \bigl(K \bigl\vert x(s) \bigr\vert \bigr)\,ds \\ &\qquad{}+\frac{f^{\star}}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{t_{1}} \bigl((t_{2}-s)^{u_{\ell}-1}-(t_{1}-s)^{u_{\ell}-1} \bigr)\,ds \\ &\qquad{}+\frac{1}{\Gamma (u_{\ell})} \int _{t_{1}}^{t_{2}}s^{-\delta}(t_{2}-s)^{u_{ \ell}-1} \bigl(K \bigl\vert x(s) \bigr\vert \bigr)\,ds+\frac{f^{\star}}{\Gamma (u_{\ell})} \int _{t_{1}}^{t_{2}}(t_{2}-s)^{u_{ \ell}-1} \,ds \\ &\quad\leq \frac{K(T_{\ell}-T_{\ell -1})^{u_{\ell}-2}}{\Gamma (u_{\ell})} \bigl((t_{2}-T_{\ell -1})-(t_{1}-T_{\ell -1}) \bigr) \Vert x \Vert _{E_{\ell}} \int _{T_{\ell -1}}^{T_{\ell}}s^{-\delta}\,ds \\ &\qquad{}+ \frac{f^{\star}(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}}{\Gamma (u_{\ell}+1)} \bigl((t_{2}-T_{\ell -1})-(t_{1}-T_{\ell -1}) \bigr)\\ &\qquad{}+ \frac{K}{\Gamma (u_{\ell})} \Vert x \Vert _{E_{\ell}} \int _{T_{\ell -1}}^{t_{1}}s^{- \delta} \bigl((t_{2}-t_{1})^{u_{\ell}-1} \bigr)\,ds \\ &\qquad{}+ \frac{f^{\star}}{\Gamma (u_{\ell})} \biggl( \frac{(t_{2}-T_{\ell -1})^{u_{\ell}}}{u_{\ell}}- \frac{(t_{2}-t_{1})^{u_{\ell}}}{{u_{\ell}}}- \frac{(t_{1}-T_{\ell -1})^{u_{\ell}}}{{u_{\ell}}} \biggr) \\ &\qquad{}+\frac{K(t_{2}-t_{1})^{u_{\ell}-1}}{\Gamma (u_{\ell})} \Vert x \Vert _{E_{ \ell}} \int _{t_{1}}^{t_{2}}s^{-\delta}\,ds+ \frac{f^{\star}}{\Gamma (u_{\ell})} \frac{(t_{2}-t_{1})^{u_{\ell}}}{u_{\ell}} \\ &\quad\leq \frac{K(T_{\ell}-T_{\ell -1})^{u_{\ell}-2}({T_{\ell}}^{1-\delta}-{T_{\ell -1}}^{1-\delta})}{(1-\delta )\Gamma (u_{\ell})} \bigl((t_{2}-T_{\ell -1})-(t_{1}-T_{\ell -1}) \bigr) \Vert x \Vert _{E_{\ell}} \\ &\qquad{}+ \frac{f^{\star}(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}}{\Gamma (u_{\ell}+1)} \bigl((t_{2}-T_{\ell -1})-(t_{1}-T_{\ell -1}) \bigr) \\ &\qquad{}+ \biggl( \frac{K({t_{1}}^{1-\delta}-{T_{\ell -1}}^{1-\delta})(t_{2}-t_{1})^{u_{\ell}-1}}{(1-\delta )\Gamma (u_{\ell})} \biggr) \Vert x \Vert _{E_{\ell}} \\ &\qquad{}+ \frac{f^{\star}}{\Gamma (u_{\ell}+1)} \bigl((t_{2}-T_{\ell -1})^{u_{ \ell}}-(t_{2}-t_{1})^{u_{\ell}}-(t_{1}-T_{\ell -1})^{u_{\ell}} \bigr) \\ &\qquad{}+ \frac{K({t_{2}}^{1-\delta}-{t_{1}}^{1-\delta})(t_{2}-t_{1})^{u_{\ell}-1}}{(1-\delta )\Gamma (u_{\ell})} \Vert x \Vert _{E_{\ell}} \\ &\qquad{}+\frac{f^{\star}(t_{2}-t_{1})^{u_{\ell}}}{\Gamma (u_{\ell}+1)} \\ &\quad\leq \biggl( \frac{K(T_{\ell}-T_{\ell -1})^{u_{\ell}-2}({T_{\ell}}^{1-\delta}-{T_{\ell -1}}^{1-\delta})}{(1-\delta )\Gamma (u_{\ell})} \Vert x \Vert _{E_{\ell}}+ \frac{f^{\star}(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}}{\Gamma (u_{\ell}+1)} \biggr)\\ &\qquad{}\times \bigl((t_{2}-T_{\ell -1})-(t_{1}-T_{\ell -1}) \bigr) \\ &\qquad{}+ \biggl( \frac{K({t_{2}}^{1-\delta}-{T_{\ell -1}}^{1-\delta})}{(1-\delta )\Gamma (u_{\ell})} \Vert x \Vert _{E_{\ell}} \biggr) (t_{2}-t_{1})^{u_{\ell}-1}\\ &\qquad{}+ \frac{f^{\star}}{\Gamma (u_{\ell}+1)} \bigl((t_{2}-T_{\ell -1})^{u_{ \ell}}-(t_{1}-T_{\ell -1})^{u_{\ell}} \bigr). \end{aligned}$$

Hence \(\|(Wx)(t_{2})-(Wx)(t_{1})\|_{E_{\ell}}\rightarrow 0\) as \(|t_{2}-t_{1}|\rightarrow 0\). It implies that \(T(B_{R_{\ell}})\) is equicontinuous.

Remark 3.1

According to the remark of [12] page 20, we can easily show that inequality (9) and the following inequality

$$\begin{aligned} \zeta \bigl(t^{\delta} \bigl\vert f_{1}(t,B) \bigr\vert \bigr)\leq K\zeta (B) \end{aligned}$$

are equivalent for any bounded sets \(B \subset X\) and for each \(t\in J_{\ell}\).

Step 4: Claim: W is k-set contractions.

For \(U \in B_{R_{\ell}}\), \(t \in J_{\ell}\), we get

$$\begin{aligned} \zeta \bigl(W(U) (t) \bigr)={}&\zeta \bigl({(Wx) (t), x\in U} \bigr) \\ \leq{} & \biggl\{ \frac{(T_{\ell}-T_{\ell -1})^{-1}(t-T_{\ell -1})}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{T_{\ell}}(T_{\ell}-s)^{u_{\ell}-1} \zeta f_{1} \bigl(s, x(s) \bigr)\,ds \\ &{}+\frac{1}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{t}(t-s)^{u_{\ell}-1} \zeta f_{1} \bigl(s, x(s) \bigr)\,ds, x \in U \biggr\} . \end{aligned}$$

Then Remark 3.1 implies that, for each \(s\in J_{i}\),

$$\begin{aligned} \zeta \bigl(W(U) (t) \bigr)\leq{} & \biggl\{ \frac{(T_{\ell}-T_{\ell -1})^{-1}(t-T_{\ell -1})}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{T_{\ell}}(T_{\ell}-s)^{u_{\ell}-1} \biggl[K \widehat{\zeta}(U) \int _{T_{{\ell -1}}}^{T_{\ell}}s^{-\delta}\,ds \biggr] \\ &{}+\frac{1}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{t}(t-s)^{u_{\ell}-1} \biggl[K\widehat{ \zeta}(U) \int _{T_{{\ell -1}}}^{t}s^{-\delta}\,ds \biggr], x \in U \biggr\} \\ \leq{} & \biggl\{ \frac{(T_{\ell}-T_{\ell -1})^{u_{\ell}-2}(t-T_{\ell -1})}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{T_{\ell}} \biggl[K\widehat{\zeta}(U) \int _{T_{{ \ell -1}}}^{T_{\ell}}s^{-\delta}\,ds \biggr] \\ &{}+\frac{(t-T_{\ell -1})^{u_{\ell}-1}}{\Gamma (u_{\ell})} \int _{T_{ \ell -1}}^{t} \biggl[K\widehat{\zeta}(U) \int _{T_{{\ell -1}}}^{t}s^{- \delta}\,ds \biggr], x \in U \biggr\} \\ \leq {}& \frac{K({T_{\ell}}^{1-\delta}-{T_{\ell -1}}^{1-\delta})(T_{\ell}-T_{\ell -1})^{u_{\ell}-2}(t-T_{\ell -1})}{(1-\delta )\Gamma (u_{\ell})} \widehat{\zeta}(U)\\ &{}+ \frac{K({t}^{1-\delta}-{T_{\ell -1}}^{1-\delta})(t-T_{\ell -1})^{u_{\ell}-1}}{(1-\delta )\Gamma (u_{\ell})} \widehat{ \zeta}(U) \\ \leq {}& \frac{2K({T_{\ell}}^{1-\delta}-{T_{\ell -1}}^{1-\delta})(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}}{(1-\delta )\Gamma (u_{\ell})} \widehat{\zeta}(U). \end{aligned}$$

Thus,

$$\begin{aligned} \widehat{\zeta}(WU)\leq \frac{2K({T_{\ell}}^{1-\delta}-{T_{\ell -1}}^{1-\delta})(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}}{(1-\delta )\Gamma (u_{\ell})} \widehat{\zeta}(U). \end{aligned}$$

Therefore, all conditions of Theorem 2.1 are fulfilled, and thus BVP (7) has at least solution \(\widetilde{x_{\ell}}\in B_{R_{\ell}}\). Since \(B_{R_{\ell}} \subset E_{\ell}\), the claim of Theorem 3.1 is proved.

Now, we will prove the existence result for BVP (1).

Introduce the following assumption:

  1. (H2)

    Let \(f_{1}\in C(J \times \mathbb{R}, \mathbb{R})\), and there exists a number \(\delta \in (0, 1)\) such that \(t^{\delta} f_{1}\in C(J \times \mathbb{R}, \mathbb{R})\) and there exists a constant \(K >0\) such that \(t^{\delta}|f_{1}(t,y_{1})- f_{1}(t,y_{2})|\leq K|y_{1}-y_{2}|\) for any \(y_{1}, y_{2} \in \mathbb{R}\) and \(t\in J\).

Theorem 3.2

Let conditions (H1), (H2) and inequality (10) be satisfied for all \(\ell \in \{1,2,\ldots,n\}\). Then problem (1) possesses at least one solution in \(C(J, \mathbb{R})\).

Proof

For any \(\ell \in \{1,2,\ldots,n\}\), according to Theorem 3.1, BVP (7) possesses at least one solution \(\widetilde{x_{\ell}}\in E_{\ell}\).

For any \(\ell \in \{1,2,\ldots,n\}\), we define the function

$$\begin{aligned} {x}_{\ell}= \textstyle\begin{cases} 0, \quad t \in [0, T_{\ell -1}], \\ \widetilde{x}_{\ell}, \quad t \in J_{\ell}. \end{cases}\displaystyle \end{aligned}$$

Thus, the function \(x_{\ell} \in C([0, T_{\ell}], \mathbb{R})\) solves the integral equation (6) for \(t \in J_{\ell}\) with \(x_{\ell}(0) =0, x_{\ell}(T_{\ell}) = \widetilde{x}_{\ell}(T_{\ell}) = 0\).

Then the function

$$\begin{aligned} x(t)= \textstyle\begin{cases} x_{1}(t), \quad t \in J_{1}, \\ x_{2}(t)= \textstyle\begin{cases} 0, & t \in J_{1}, \\ \widetilde{x}_{2}, & t \in J_{2}, \end{cases}\displaystyle \\ \vdots \\ x_{n}(t)= \textstyle\begin{cases} 0, & t \in [0, T_{\ell -1}], \\ \widetilde{x}_{\ell},& t \in J_{\ell}, \end{cases}\displaystyle \end{cases}\displaystyle \end{aligned}$$
(12)

is a solution of BVP (1) in \(C(J, \mathbb{R})\). □

3.2 Ulam–Hyers stability

Theorem 3.3

Let conditions (H1), (H2) and inequality (10) be satisfied. Then BVP (1) is (UH) stable.

Proof

Let \(\epsilon >0\) be an arbitrary number and the function \(z(t)\) from \(z \in C(J_{\ell}, \mathbb{R})\) satisfy inequality (4).

For any \(\ell \in \{1,2,\ldots,n\}\), we define the functions \(z_{1}(t)\equiv z(t), t \in [1, T_{1}]\), and for \(\ell =2,3,\ldots,n\),

$$\begin{aligned} {z}_{\ell}(t)= \textstyle\begin{cases} 0, & t \in [0, T_{\ell -1}], \\ z(t), & t \in J_{\ell}. \end{cases}\displaystyle \end{aligned}$$

For any \(\ell \in \{1,2,\ldots,n\}\), according to equality (5), for \(t \in J\) we get

$$\begin{aligned} {}^{c}D^{u(t)}_{{T_{\ell -1}}^{+}}z_{\ell}(t)= \int _{T_{\ell -1}}^{t} \frac{(t-s)^{1-u_{\ell}}}{\Gamma (2-u_{\ell})}z^{(2)}(s) \,ds. \end{aligned}$$

Taking the (RLFI) \(I^{u_{\ell}}_{T_{\ell -1}^{+}}\) of both sides of inequality (4), we obtain

$$\begin{aligned} & \biggl\vert z_{\ell}(t)+ \frac{(T_{\ell}-T_{{\ell -1}})^{-1}(t-T_{\ell -1})}{{\Gamma (u_{\ell})}} \int _{T_{{\ell -1}}}^{T_{\ell}}(T_{\ell}-s)^{u_{\ell -1}} f_{1} \bigl(s, z_{ \ell}(s) \bigr)\,ds \\ &\qquad{}-\frac{1}{\Gamma (u_{\ell})} \int _{T_{{\ell -1}}}^{t}(t-s)^{u_{ \ell -1}} f_{1} \bigl(s, z_{\ell}(s) \bigr)\,ds \biggr\vert \\ &\quad \leq \epsilon \int _{T_{\ell -1}}^{t} \frac{(t-s)^{u_{\ell}-1}}{\Gamma (u_{\ell})}\,ds \\ &\quad \leq \epsilon \frac{(T_{\ell}-T_{\ell -1})^{u_{\ell}}}{\Gamma (u_{\ell}+1)}. \end{aligned}$$

According to Theorem 3.2, BVP (1) has a solution \(x \in C(J, \mathbb{R})\) defined by \(x(t) = x_{\ell}(t)\) for \(t \in J_{\ell}, \ell = 1, 2,\ldots, n\), where

$$\begin{aligned} {x}_{\ell}= \textstyle\begin{cases} 0, & t \in [0, T_{\ell -1}], \\ \widetilde{x}_{\ell}, & t \in J_{\ell}, \end{cases}\displaystyle \end{aligned}$$
(13)

and \(\widetilde{x}_{\ell} \in E_{\ell}\) is a solution of BVP (7). According to Lemma 3.1, the integral equation

$$\begin{aligned} \widetilde{x}_{\ell}(t)={}&{ -} \frac{(T_{\ell}-T_{{\ell -1}})^{-1}(t-T_{\ell -1})}{{\Gamma (u_{\ell})}} \int _{T_{{\ell -1}}}^{T_{\ell}}(T_{\ell}-s)^{u_{\ell -1}} f_{1} \bigl(s, \widetilde{x}_{\ell}(s) \bigr)\,ds \\ &{}+\frac{1}{\Gamma (u_{\ell})} \int _{T_{{\ell -1}}}^{t}(t-s)^{u_{\ell -1}} f_{1} \bigl(s, \widetilde{x}_{\ell}(s) \bigr)\,ds \end{aligned}$$
(14)

holds.

Let \(t \in J_{\ell}, \ell = 1, 2,\ldots, n\). Then by Eqs. (13) and (14) we get

$$\begin{aligned} & \bigl\vert z(t)-x(t) \bigr\vert \\ &\quad = \bigl\vert z(t)-x_{\ell}(t) \bigr\vert = \bigl\vert z_{\ell}(t)-\widetilde{x}_{\ell}(t) \bigr\vert \\ &\quad = \biggl\vert z_{\ell}(t)+ \frac{(T_{\ell}-T_{{\ell -1}})^{-1}(t-T_{\ell -1})}{{\Gamma (u_{\ell})}} \int _{T_{{\ell -1}}}^{T_{\ell}}(T_{\ell}-s)^{u_{\ell -1}} f_{1} \bigl(s, \widetilde{x}_{\ell}(s) \bigr)\,ds \\ &\qquad{}-\frac{1}{\Gamma (u_{\ell})} \int _{T_{{\ell -1}}}^{t}(t-s)^{u_{ \ell -1}} f_{1} \bigl(s, \widetilde{x}_{\ell}(s) \bigr)\,ds \biggr\vert \\ &\quad= \biggl\vert z_{\ell}(t)+ \frac{(T_{\ell}-T_{{\ell -1}})^{-1}(t-T_{\ell -1})}{{\Gamma (u_{\ell})}} \int _{T_{{\ell -1}}}^{T_{\ell}}(T_{\ell}-s)^{u_{\ell -1}} f_{1} \bigl(s, z_{ \ell}(s) \bigr)\,ds \\ &\qquad{}-\frac{1}{\Gamma (u_{\ell})} \int _{T_{{\ell -1}}}^{t}(t-s)^{u_{ \ell -1}} f_{1} \bigl(s, z_{\ell}(s) \bigr)\,ds \biggr\vert \\ &\qquad{}+ \frac{(T_{\ell}-T_{\ell -1})^{-1}(t-T_{\ell -1})}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{T_{\ell}}(T_{\ell}-s)^{u_{\ell}-1} \bigl\vert f_{1} \bigl(s, z_{ \ell}(s) \bigr)-f_{1} \bigl(s, \widetilde{x}_{\ell}(s) \bigr) \bigr\vert \,ds \\ &\qquad{}+\frac{1}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{t}(t-s)^{u_{\ell}-1} \bigl\vert f_{1} \bigl(s, z_{\ell}(s) \bigr)-f_{1} \bigl(s, \widetilde{x}_{\ell}(s) \bigr) \bigr\vert \,ds \\ &\quad\leq \epsilon \frac{(T_{\ell}-T_{\ell -1})^{u_{\ell}}}{\Gamma (u_{\ell}+1)}+ \frac{(T_{\ell}-T_{\ell -1})^{-1}(t-T_{\ell -1})}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{T_{\ell}}(T_{\ell}-s)^{u_{\ell}-1} s^{-\delta} \bigl(K \bigl\vert z_{ \ell}(s)-\widetilde{x}_{\ell}(s) \bigr\vert \bigr)\,ds \\ &\qquad{}+\frac{1}{\Gamma (u_{\ell})} \int _{T_{\ell -1}}^{t}(t-s)^{u_{\ell}-1} s^{-\delta} \bigl(K \bigl\vert z_{\ell}(s)-\widetilde{x}_{\ell}(s) \bigr\vert \bigr)\,ds \\ &\quad\leq \epsilon \frac{(T_{\ell}-T_{\ell -1})^{u_{\ell}}}{\Gamma (u_{\ell}+1)}+ \frac{(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}}{\Gamma (u_{\ell})} \bigl(K \Vert z_{ \ell}-\widetilde{x}_{\ell} \Vert _{E_{\ell}} \bigr) \int _{T_{\ell -1}}^{T_{\ell}} s^{-\delta}\,ds \\ &\qquad{}+\frac{(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}}{\Gamma (u_{\ell})} \bigl(K \Vert z_{ \ell}- \widetilde{x}_{\ell} \Vert _{E_{\ell}} \bigr) \int _{T_{\ell -1}}^{t} s^{- \delta}\,ds \\ &\quad\leq \epsilon \frac{(T_{\ell}-T_{\ell -1})^{u_{\ell}}}{\Gamma (u_{\ell}+1)}+ \frac{(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}({T_{\ell}}^{1-\delta}-{T_{\ell -1}}^{1-\delta})}{(1-\delta )\Gamma (u_{\ell})} \bigl(K \Vert z_{\ell}-\widetilde{x}_{\ell} \Vert _{E_{\ell}} \bigr) \\ &\qquad{}+ \frac{(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}({t}^{1-\delta}-{T_{\ell -1}}^{1-\delta})}{(1-\delta )\Gamma (u_{\ell})} \bigl(K \Vert z_{\ell}- \widetilde{x}_{\ell} \Vert _{E_{\ell}} \bigr) \\ &\quad\leq \epsilon \frac{(T_{\ell}-T_{\ell -1})^{u_{\ell}}}{\Gamma (u_{\ell}+1)}+ \frac{2K(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}({T_{\ell}}^{1-\delta}-{T_{\ell -1}}^{1-\delta})}{(1-\delta )\Gamma (u_{\ell})} \Vert z_{\ell}-\widetilde{x}_{\ell} \Vert _{E_{\ell}} \\ &\quad\leq \epsilon \frac{(T_{\ell}-T_{\ell -1})^{u_{\ell}}}{\Gamma (u_{\ell}+1)}+\mu \Vert z-x \Vert , \end{aligned}$$

where

$$\begin{aligned} \mu =\max_{\ell = 1, 2,\ldots, n} \frac{2K(T_{\ell}-T_{\ell -1})^{u_{\ell}-1}({T_{\ell}}^{1-\delta}-{T_{\ell -1}}^{1-\delta})}{(1-\delta )\Gamma (u_{\ell})}. \end{aligned}$$

Then

$$\begin{aligned} \Vert z- x \Vert (1-\mu ) \leq \frac{(T_{\ell}-T_{\ell -1})^{u_{\ell}}}{\Gamma (u_{\ell}+1)} \epsilon. \end{aligned}$$

We obtain, for each \(t \in J_{\ell}\),

$$\begin{aligned} \bigl\vert z(t)- x(t) \bigr\vert \leq \Vert z- x \Vert \leq \frac{(T_{\ell}-T_{\ell -1})^{u_{\ell}}}{(1-\mu )\Gamma (u_{\ell}+1)} \epsilon:=c_{f_{1}} \epsilon. \end{aligned}$$

Therefore, BVP (1) is (UH) stable. □

3.3 Examples

3.3.1 Example 1

Let us consider the following fractional boundary value problem:

$$\begin{aligned} \textstyle\begin{cases} {}^{c}D^{u(t)}_{0^{+}}x(t)= \frac{t^{-\frac{1}{3}}e^{-t}}{(e^{e^{\frac{t^{2}}{1+t}}}+4e^{2t}+1)(1+ \vert x(t) \vert )}, \quad t\in J:= [0,2], \\ x(0)=0, \qquad x(2)=0. \end{cases}\displaystyle \end{aligned}$$
(15)

Let

$$\begin{aligned} &f_{1}(t, y)= \frac{t^{-\frac{1}{3}}e^{-t}}{(e^{e^{\frac{t^{2}}{1+t}}}+4e^{2t}+1)(1+y)},\quad (t,y)\in [0,2]\times [0,+\infty ). \\ & u(t)= \textstyle\begin{cases} \frac{3}{2}, & t \in J_{1}:=[0, 1], \\ \frac{9}{5}, & t \in J_{2}:=]1, 2]. \end{cases}\displaystyle \end{aligned}$$
(16)

Then we have

$$\begin{aligned} t^{\frac{1}{3}} \bigl\vert f_{1}(t,y_{1})-f_{1}(t,y_{2}) \bigr\vert &= \biggl\vert \frac{e^{-t}}{(e^{e^{\frac{t^{2}}{1+t}}}+4e^{2t}+1)} \biggl( \frac{1}{1+y_{1}}- \frac{1}{1+y_{2}} \biggr) \biggr\vert \\ &\leq \frac{e^{-t} \vert y_{1}-y_{2} \vert }{(e^{e^{\frac{t^{2}}{1+t}}}+4e^{2t}+1)(1+y_{1})(1+y_{2})} \\ &\leq \frac{e^{-t}}{(e^{e^{\frac{t^{2}}{1+t}}}+4e^{2t}+1)} \vert y_{1}-y_{2} \vert \\ &\leq \frac{1}{(e+5)} \vert y_{1}-y_{2} \vert . \end{aligned}$$

Hence, condition (H2) holds with \(\delta =\frac{1}{3}\) and \(K = \frac{1}{e+5}\).

By (16), according to BVP (7), we consider two auxiliary BVPs for Caputo fractional differential equations of constant order:

$$\begin{aligned} \textstyle\begin{cases} {}^{c}D^{\frac{3}{2}}_{0^{+}}x(t)= \frac{t^{-\frac{1}{3}}e^{-t}}{(e^{e^{\frac{t^{2}}{1+t}}}+4e^{2t}+1)(1+ \vert x(t) \vert )}, \quad t \in J_{1}, \\ x(0)=0,\qquad x(1)=0, \end{cases}\displaystyle \end{aligned}$$
(17)

and

$$\begin{aligned} \textstyle\begin{cases} {}^{c}D^{\frac{9}{5}}_{1^{+}}x(t)= \frac{t^{-\frac{1}{3}}e^{-t}}{(e^{e^{\frac{t^{2}}{1+t}}}+4e^{2t}+1)(1+ \vert x(t) \vert )}, \quad t \in J_{2}, \\ x(1)=0,\qquad x(2)=0. \end{cases}\displaystyle \end{aligned}$$
(18)

Next, we prove that condition (10) is fulfilled for \(\ell = 1\). Indeed,

$$\begin{aligned} \frac{2K({T_{1}}^{1-\delta}-{T_{0}}^{1-\delta})(T_{1}-T_{0})^{u_{1}-1}}{(1-\delta )\Gamma (u_{1})} =\frac{2}{\frac{2}{3}(e+5)\Gamma (\frac{3}{2})} \simeq 0.4385 < 1. \end{aligned}$$

Accordingly, condition (10) is achieved. By Theorem 3.1, BVP (17) has a solution \(\widetilde{x}_{1} \in E_{1}\).

We prove that condition (10) is fulfilled for \(\ell = 2\). Indeed,

$$\begin{aligned} \frac{2K({T_{2}}^{1-\delta}-{T_{1}}^{1-\delta})(T_{2}-T_{1})^{u_{2}-1}}{(1-\delta )\Gamma (u_{2})} =\frac{2}{e+5} \frac{{2}^{\frac{2}{3}}-1}{\frac{2}{3}\Gamma (\frac{9}{5})}\simeq 0.2451 < 1. \end{aligned}$$

Thus, condition (10) is satisfied.

According to Theorem 3.1, BVP (18) possesses a solution \(\widetilde{x}_{2} \in E_{2}\).

Then, by Theorem 3.2, BVP (15) has a solution

$$\begin{aligned} x(t)= \textstyle\begin{cases} \widetilde{x}_{1}(t), & t \in J_{1}, \\ x_{2}(t), & t \in J_{2}, \end{cases}\displaystyle \end{aligned}$$

where

$$\begin{aligned} x_{2}(t)= \textstyle\begin{cases} 0, & t \in J_{1}, \\ \widetilde{x}_{2}(t), & t \in J_{2}. \end{cases}\displaystyle \end{aligned}$$

According to Theorem 3.3, BVP (15) is (UH) stable.

3.3.2 Example 2

Let us consider the following fractional boundary value problem:

$$\begin{aligned} \textstyle\begin{cases} {}^{c}D^{u(t)}_{0^{+}}x(t)=\frac{t^{-\frac{1}{2}}}{5e^{t}(1+ \vert x(t) \vert )}, \quad t\in J:= [0,3], \\ x(0)=0,\qquad x(3)=0. \end{cases}\displaystyle \end{aligned}$$
(19)

Let

$$\begin{aligned} f_{1}(t, y)=\frac{t^{-\frac{1}{2}}}{5e^{t}(1+y)},\quad (t,y)\in [0,3] \times [0,+\infty ). \end{aligned}$$
$$\begin{aligned} u(t)= \textstyle\begin{cases} \frac{9}{6}, \quad t \in J_{1}:=[0, 1], \\ \frac{6}{5}, \quad t \in J_{2}:=]1, 3]. \end{cases}\displaystyle \end{aligned}$$
(20)

Then we have

$$\begin{aligned} t^{\frac{1}{2}} \bigl\vert f_{1}(t,y_{1})-f_{1}(t,y_{2}) \bigr\vert &= \biggl\vert \frac{1}{5e^{t}} \biggl(\frac{1}{1+y_{1}}- \frac{1}{1+y_{2}} \biggr) \biggr\vert \\ &\leq \frac{ \vert y_{2}-y_{1} \vert }{5e^{t}(1+y_{1})(1+y_{2})} \\ &\leq \frac{1}{5} \vert y_{1}-y_{2} \vert . \end{aligned}$$

Hence condition (H2) holds with \(\delta =\frac{1}{2}\) and \(K =\frac{1}{5}\).

By (20), according to (7), we consider two auxiliary BVPs for Caputo fractional differential equations of constant order:

$$\begin{aligned} \textstyle\begin{cases} {}^{c}D^{\frac{9}{6}}_{0^{+}}x(t)= \frac{t^{-\frac{1}{2}}}{5e^{t}(1+ \vert x(t) \vert )}, \quad t \in J_{1}, \\ x(0)=0,\qquad x(1)=0, \end{cases}\displaystyle \end{aligned}$$
(21)

and

$$\begin{aligned} \textstyle\begin{cases} {}^{c}D^{\frac{6}{5}}_{1^{+}}x(t)= \frac{t^{-\frac{1}{2}}}{5e^{t}(1+ \vert x(t) \vert )}, \quad t \in J_{2}, \\ x(1)=0, \qquad x(3)=0. \end{cases}\displaystyle \end{aligned}$$
(22)

Next, we prove that condition (10) is fulfilled for \(\ell = 1\). Indeed,

$$\begin{aligned} \frac{2K({T_{1}}^{1-\delta}-{T_{0}}^{1-\delta})(T_{1}-T_{0})^{u_{1}-1}}{(1-\delta )\Gamma (u_{1})} =\frac{2\frac{1}{5}}{\frac{1}{2}\Gamma (\frac{9}{6})} \simeq 0.9027 < 1. \end{aligned}$$

Accordingly, condition (10) is achieved. By Theorem 3.1, BVP (21) has a solution \(\widetilde{x}_{1} \in E_{1}\).

We prove that condition (10) is fulfilled for \(\ell = 2\). Indeed,

$$\begin{aligned} \frac{2K({T_{2}}^{1-\delta}-{T_{1}}^{1-\delta})(T_{2}-T_{1})^{u_{2}-1}}{(1-\delta )\Gamma (u_{2})} = \frac{2\frac{1}{5}(\sqrt{3}-1)(2)^{0.2}}{\frac{1}{2}\Gamma (\frac{6}{5})} \simeq 0.7326 < 1. \end{aligned}$$

Thus, condition (10) is satisfied.

According to Theorem 3.1, BVP (22) possesses a solution \(\widetilde{x}_{2} \in E_{2}\).

Then, by Theorem 3.2, BVP (19) has a solution

$$\begin{aligned} x(t)= \textstyle\begin{cases} \widetilde{x}_{1}(t), & t \in J_{1}, \\ x_{2}(t), & t \in J_{2}, \end{cases}\displaystyle \end{aligned}$$

where

$$\begin{aligned} x_{2}(t)= \textstyle\begin{cases} 0, & t \in J_{1}, \\ \widetilde{x}_{2}(t), & t \in J_{2}. \end{cases}\displaystyle \end{aligned}$$

According to Theorem 3.3, BVP (19) is (UH) stable.

4 Conclusion

In this paper, we presented results about the existence of solutions to the BVP of Caputo fractional differential equations of variable order \(u(t)\), where \(u(t): [0, T] \rightarrow (1, 2]\) is a piecewise constant function. All our results are based on Darbo’s fixed point theorem combined with the Kuratowski measure of noncompactness (Theorem 3.1), and we studied Ulam–Hyers stability of solutions to our problem (Theorem 3.3).

Finally, we illustrated the theoretical findings by a numerical example.

All results in this work show a great potential to be applied in various of sciences.

Moreover, with the help of our results in this research paper, investigations on this open research problem could be also possible, and one could extend the proposed BVP to other complicated fractional models.

In the near future we want to study these BVPs with different boundary problem (implicit, resonance, thermostat model, etc.) value conditions involving integral conditions or integro-derivative conditions.