1 Introduction

The main idea of fractional calculus is to constitute the natural numbers in the order of derivation operators with rational ones. Although this idea is preliminary and simple, it involves remarkable effects and outcomes which describe some physical, dynamics, modeling, control theory, bioengineering, and biomedical applications phenomena. For this reason, recently, a significant number of papers have appeared on this topic (see for example [8, 9] and the references therein); on the contrary, few papers deal with the existence of solutions to problems via variable order, see, e.g., [4, 15, 16, 18, 19].

In general, it is usually difficult to solve boundary value problems of fractional variable order (FBVPs) and obtain their analytical solution. Therefore, some methods are introduced for the approximation of solutions to different FBVPs of variable order. In relation to the study of the existence theory to FBVPs of variable order, we point out some of them. In [20], Zhang studied solutions of a two-point boundary value problem of fractional variable order involving singular fractional differential equations (FDEs). After some years, Zhang and Hu [22] established the existence results for approximate solutions of variable order fractional initial value problems on the half line. Recently, Bouazza et al. [3] considered a multiterm FBVP variable order and derived their results by terms of fixed point methods. In 2021, Hristova et al. [5] turned to investigation of the Hadamard FBVP of variable order by means of Kuratowski MNC method. For more details on other instances, refer to [10, 14] and the references therein.

In [1] Bai et al. investigate the existence for nonlinear fractional differential equations of constant order

$$ \textstyle\begin{cases} {}^{c}D^{u}_{0^{+}}x(t)= f(t, x(t), I^{u}_{0^{+}}x(t)), \quad t\in [a, b], u\in \, ]0, 1], \\ x(a)=x_{a}, \end{cases} $$

where \({}^{c}D^{u}_{0^{+}}\) and \(I^{u}_{0^{+}}\) stand for the Caputo–Hadamard derivative and Hadamard integral operators of order u, respectively, f is a given function, \(x_{a}\in \mathbb{R}\), and \(0< a< b<\infty \).

Some existence and Ulam stability properties for FDEs have been studied by many authors (see [2, 13] and the references therein).

Inspired by [1] and [4, 15, 16, 18, 19], we deal with the boundary value problem (BVP)

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

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

In this paper, we 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

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

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)\) [11, 12, 17] is

$$ 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}, $$
(2)

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

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

As anticipated, in case \(u(t)\) and \(v(t)\) are constant, CFD and RLFI coincide with the standard Caputo fractional derivative and Riemann–Liouville fractional integral, respectively, see, e.g., [7, 11, 12].

Recall the following pivotal observation.

Lemma 2.1

([7])

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

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

has the unique solution

$$ 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} $$

and

$$ 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}, $$

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

Furthermore,

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

and

$$ 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). $$

Remark

([20, 22, 23])

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

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

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], \\& \begin{aligned} 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 \\ &= \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 \\ &= \int _{0}^{t}\frac{(t-s)^{t-1}}{\Gamma (t)} \biggl[ 2s-1 + \frac{(s-1)^{3}}{3} \biggr] \,ds \end{aligned} \end{aligned}$$

and

$$ 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. $$

So, we get

$$\begin{aligned}& \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 \\ &=\frac{21}{10}, \end{aligned} \\& \begin{aligned} 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 \\ &= \int _{0}^{1}\frac{(3-s)^{4}}{\Gamma (5)}2\,ds + \int _{1}^{3} \frac{(3-s)^{5}}{\Gamma (6)}2\,ds \\ &=\frac{1}{12} \int _{0}^{1}\bigl(s^{4}-12s^{3}+54s^{2}-108s+81 \bigr)\,ds \\ &\quad {}+\frac{1}{60} \int _{1}^{3}\bigl(-s^{5}+15s^{4}-90s^{3}+270s^{2}-405s+243 \bigr)\,ds \\ &=\frac{665}{180}. \end{aligned} \end{aligned}$$

Therefore, we obtain

$$ 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}. $$

Lemma 2.2

([25])

Let \(u: J \rightarrow (1, 2]\) be a continuous function, then for

$$ f_{2} \in C_{\delta }(J, {\mathbb{R}})=\bigl\{ f_{2}(t)\in C(J, {\mathbb{R}}), t^{\delta }f_{2}(t) \in C(J, {\mathbb{R}}), 0 \leq \delta \leq 1 \bigr\} , $$

the variable-order fractional integral \(I^{u(t)}_{0^{+}}f_{2}(t)\) exists for any points on J.

Lemma 2.3

([25])

Let \(u: J \rightarrow (1, 2]\) be a continuous function, then

$$ I^{u(t)}_{0^{+}} f_{2}(t)\in C(J, \mathbb{R})\quad \textit{for } f_{2} \in C(J, \mathbb{R}). $$

Definition 2.1

([6, 21, 24])

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.

Theorem 2.1

(Schauder fixed point theorem, [7])

Let E be a Banach space, Q be a convex subset of E, and \(F: Q\longrightarrow Q\) be a compact and continuous map. Then F has at least one fixed point in Q.

Definition 2.2

([2])

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

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

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

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

3 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.,

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

    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

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

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

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

Then, for any \(t \in J_{\ell }\), \(\ell = 1, 2, \ldots, n\), the left Caputo fractional derivative 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\),

$$ {}^{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. $$
(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 \\& \quad {}+ f_{1}\bigl(t, x(t), I^{u_{\ell }}_{0^{+}}x(t) \bigr)=0,\quad t \in J_{\ell }. \end{aligned}$$
(6)

In what follows we 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 Eq. (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

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

We shall deal with the following BVP:

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

For our purpose, the upcoming lemma will be a cornerstone 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}\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}\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

$$ x(t) = \int _{T_{\ell -1}}^{T_{\ell }}G_{\ell }(t,s)f_{1} \bigl(s, x(s), I^{u_{ \ell }}_{{T_{\ell -1}^{+}}}x(s)\bigr)\,ds, $$
(8)

where \(G_{\ell }(t,s)\) is the Green’s function defined by

$$\begin{aligned} G_{\ell }(t,s) = \textstyle\begin{cases} \frac{1}{\Gamma (u_{\ell })} [(T_{\ell }-T_{\ell -1})^{-1}(t-T_{ \ell -1})(T_{\ell }-s)^{u_{\ell }-1}-(t-s)^{u_{\ell }-1} ], \\ \quad T_{{\ell -1}} \leq s \leq t \leq T_{\ell }, \\ \frac{1}{\Gamma (u_{\ell })}(T_{\ell }-T_{\ell -1})^{-1}(t-T_{{\ell -1}})(T_{ \ell }-s)^{u_{\ell }-1}, \\ \quad T_{{\ell -1}} \leq t \leq s \leq T_{\ell }, \end{cases}\displaystyle \end{aligned}$$

where \(\ell =1,2,\ldots,n\).

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

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

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

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

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

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 }), I^{u_{\ell }}_{T_{\ell -1}^{+}}x(T_{ \ell })\bigr) \\ &{}-I^{u_{\ell }}_{T_{\ell -1}^{+}}f_{1} \bigl(t, x(t), I^{u_{\ell }}_{T_{ \ell -1}^{+}}x(t)\bigr), \quad t \in J_{\ell } \end{aligned}$$

by the continuity of Green’s function which implies that

$$ x(t) = \int _{T_{\ell -1}}^{T_{\ell }}G_{\ell }(t,s)f_{1} \bigl(s, x(s), I^{u_{ \ell }}_{{T_{\ell -1}^{+}}}x(s)\bigr)\,ds. $$

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). □

The following proposition will be needed.

Proposition 3.1

Assume that \(t^{\delta }f_{1}: J \times \mathbb{R} \times \mathbb{R} \rightarrow \mathbb{R}\), \((\delta \in (0, 1))\) is a continuous function, \(u(t):J\rightarrow (1,2]\) satisfies (H1), then Green’s functions of boundary value problem (6) satisfy the following properties:

  1. (1)

    \(G_{\ell }(t,s)\geq 0\) for all \(T_{{\ell -1}} \leq t\), \(s \leq T_{\ell }\),

  2. (2)

    \(\max_{t\in J_{\ell }}G_{\ell }(t,s)=G_{\ell }(s,s)\), \(s \in J_{\ell }\),

  3. (3)

    \(G_{\ell }(s,s)\) has one unique maximum given by

    $$ \max_{s\in J_{\ell }}G_{\ell }(s,s)= \frac{1}{\Gamma (u_{\ell }+1)} \biggl[(T_{\ell }-T_{\ell -1}) \biggl(1- \frac{1}{u_{\ell }} \biggr) \biggr]^{u_{\ell }-1}, $$

    where \(\ell =1,2,\ldots,n\).

Proof

Let \(\varphi (t,s)=(T_{\ell }-T_{{\ell -1}})^{-1}(t-T_{\ell -1})(T_{\ell }-s)^{u_{ \ell }-1}-(t-s)^{u_{\ell }-1}\).

We see that

$$\begin{aligned} \varphi _{t}(t,s) =&(T_{\ell }-T_{{\ell -1}})^{-1}(T_{\ell }-s)^{u_{ \ell }-1}-(u_{\ell }-1) (t-s)^{u_{\ell }-2} \\ \leq &(T_{\ell }-T_{{\ell -1}})^{-1}(T_{\ell }-T_{\ell -1})^{u_{\ell }-1}-(T_{ \ell }-T_{\ell -1})^{u_{\ell }-2} \\ = &0, \end{aligned}$$

which means that \(\varphi (t,s)\) is nonincreasing with respect to t, so \(\varphi (t,s)\geq \varphi (T_{\ell },s)=0\) for \(T_{{\ell -1}} \leq s \leq t \leq T_{\ell }\).

Thus, from this together with the expression of \(G_{\ell }(t,s)\), we have \(G_{\ell }(t,s)\geq 0\) for any \(T_{{\ell -1}} \leq t\), \(s \leq T_{\ell }\), \(\ell =\dot{1,\ldots,n}\).

Since \(\varphi (t,s)\) is nonincreasing with respect to t, then \(\varphi (t,s)\leq \varphi (s,s)\) for \(T_{{\ell -1}} \leq s \leq t \leq T_{\ell }\).

On the other hand, for \(T_{{\ell -1}} \leq t \leq s \leq T_{\ell }\), we get

$$ (T_{\ell }-T_{{\ell -1}})^{-1}(t-T_{\ell -1}) (T_{\ell }-s)^{u_{\ell }-1} \leq (T_{\ell }-T_{{\ell -1}})^{-1}(s-T_{\ell -1}) (T_{\ell }-s)^{u_{ \ell }-1}. $$

These assure that \(\max_{t\in [T_{\ell -1},T_{\ell }]}G_{\ell }(t,s)=G_{ \ell }(s,s)\), \(s\in [T_{\ell -1},T_{\ell }]\), \(\ell =\dot{1,\ldots,n}\).

Further, we verify (3) of Proposition (3.1). Clearly, the maximum points of \(G_{\ell }(s,s)\) are not \(T_{\ell -1}\) and \(T_{\ell }\), \(\ell =\dot{1,\ldots,n}\). For \(s\in [T_{\ell -1}, T_{\ell }]\), \(\ell =\dot{1,\ldots,n}\), we have

$$\begin{aligned} \frac{dG_{\ell }(s,s)}{\,ds} =&\frac{1}{\Gamma (u_{\ell })}(T_{\ell }-T_{{ \ell -1}})^{-1} \bigl[(T_{\ell }-s)^{u_{\ell }-1}-(s-T_{\ell -1}) (u_{\ell }-1) (T_{ \ell }-s)^{u_{\ell }-2} \bigr] \\ =&\frac{1}{\Gamma (u_{\ell })}(T_{\ell }-T_{{\ell -1}})^{-1}(T_{\ell }-s)^{u_{ \ell }-2} \bigl[(T_{\ell }-s)-(s-T_{\ell -1}) (u_{\ell }-1) \bigr] \\ =&\frac{1}{\Gamma (u_{\ell })}(T_{\ell }-T_{{\ell -1}})^{-1}(T_{\ell }-s)^{u_{ \ell }-2} \bigl[T_{\ell }+(u_{\ell }-1)T_{\ell -1}-u_{\ell }s \bigr], \end{aligned}$$

which implies that the maximum points of \(G_{\ell }(s,s)\) are \(s=\frac{T_{\ell }+(u_{\ell }-1)T_{\ell -1}}{u_{\ell }}\), \(\ell =\dot{1,\ldots,n}\).

Hence, for \(\ell =\dot{1,\ldots,n}\),

$$\begin{aligned} \max_{s\in [T_{\ell -1},T_{\ell }]}G_{\ell }(s,s) =&G_{\ell } \biggl( \frac{T_{\ell }+(u_{\ell }-1)T_{\ell -1}}{u_{\ell }}, \frac{T_{\ell } +(u_{\ell }-1)T_{\ell -1}}{u_{\ell }} \biggr) \\ =& \frac{1}{\Gamma (u_{\ell }+1)} \biggl[(T_{\ell }-T_{\ell -1}) \biggl(1- \frac{1}{u_{\ell }} \biggr) \biggr]^{u_{\ell }-1}. \end{aligned}$$

 □

We will prove the existence results for BVP (7). The first result is based on Theorem 2.1.

Theorem 3.1

Let the conditions of Lemma 3.1be satisfied and there exist constants \(K, L >0\) such that \(t^{\delta }|f_{1}(t,y_{1}, z_{1})- f_{1}(t,y_{2}, z_{2})|\leq K|y_{1}-y_{2}|+ L|z_{1}-z_{2}|\) for any \(y_{i}, z_{i} \in \mathbb{R}\), \(i = 1, 2\), \(t\in J_{\ell }\), and the inequality

$$ \frac{(T_{\ell }^{1-\delta }-T_{\ell -1}^{1-\delta }) ((T_{\ell }-T_{\ell -1})(1-\frac{1}{u_{\ell }}) )^{u_{\ell }-1}}{(1-\delta )\Gamma (u_{\ell }+1)}\biggl(K+ L\frac{(T_{\ell }-T_{\ell -1})^{u_{\ell }}}{\Gamma (u_{\ell }+1)}\biggr)< 1 $$
(9)

holds.

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

Proof

We construct the operator

$$ W : E_{\ell } \rightarrow E_{\ell } $$

as follows:

$$ Wx(t) = \int _{T_{\ell -1}}^{T_{\ell }}G_{\ell }(t,s)f_{1} \bigl(s, x(s), I^{u_{ \ell }}_{{T_{\ell -1}^{+}}}x(s)\bigr)\,ds,\quad t \in J_{\ell }. $$
(10)

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 (10) is well defined.

Let

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

with

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

We consider the set

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

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 three phases.

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

For \(x\in B_{R_{\ell }}\), by Proposition 3.1, we have

$$\begin{aligned} \bigl\vert Wx(t) \bigr\vert =& \biggl\vert \int _{T_{\ell -1}}^{T_{\ell }}G_{\ell }(t, s)f_{1} \bigl(s, x(s), I^{u_{\ell }}_{T_{\ell -1}^{+}}x(s) \bigr)\,ds \biggr\vert \\ \leq & \int _{T_{\ell -1}}^{T_{\ell }}G_{\ell }(t, s) \bigl\vert f_{1} \bigl(s, x(s), I^{u_{\ell }}_{T_{\ell -1}^{+}}x(s) \bigr) \bigr\vert \,ds \\ \leq &\frac{1}{\Gamma (u_{\ell }+1)} \biggl((T_{\ell }-T_{\ell -1}) \biggl(1- \frac{1}{u_{\ell }}\biggr) \biggr)^{u_{\ell }-1} \\ &{}\times\int _{T_{\ell -1}}^{T_{\ell }} \bigl\vert f_{1} \bigl(s, x(s), I^{u_{\ell }}_{T_{\ell -1}^{+}}x(s) \bigr)-f_{1}(s, 0, 0) \bigr\vert \,ds \\ &{}+\frac{1}{\Gamma (u_{\ell }+1)} \biggl((T_{\ell }-T_{\ell -1}) \biggl(1- \frac{1}{u_{\ell }}\biggr) \biggr)^{u_{\ell }-1} \int _{T_{\ell -1}}^{T_{\ell }} \bigl\vert f_{1}(s, 0, 0) \bigr\vert \,ds \\ \leq &\frac{1}{\Gamma (u_{\ell }+1)} \biggl((T_{\ell }-T_{\ell -1}) \biggl(1- \frac{1}{u_{\ell }}\biggr) \biggr)^{u_{\ell }-1} \int _{T_{\ell -1}}^{T_{\ell }}s^{- \delta }\bigl(K \bigl\vert x(s) \bigr\vert + L \bigl\vert I^{u_{\ell }}_{T_{\ell -1}^{+}}x(s) \bigr\vert \bigr)\,ds \\ &{}+\frac{f^{\star }}{\Gamma (u_{\ell }+1)}(T_{\ell }-T_{\ell -1})^{u_{ \ell }} \biggl(1-\frac{1}{u_{\ell }}\biggr)^{u_{\ell }-1} \\ \leq &\frac{(T_{\ell }^{1-\delta }-T_{\ell -1}^{1-\delta }) ((T_{\ell }-T_{\ell -1})(1-\frac{1}{u_{\ell }}) )^{u_{\ell }-1}}{(1-\delta )\Gamma (u_{\ell }+1)}\biggl(K+ L\frac{(T_{\ell }-T_{\ell -1})^{u_{\ell }}}{\Gamma (u_{\ell }+1)} \biggr)R_{ \ell } \\ &{}+\frac{f^{\star }}{\Gamma (u_{\ell }+1)}(T_{\ell }-T_{\ell -1})^{u_{ \ell }} \biggl(1-\frac{1}{u_{\ell }}\biggr)^{u_{\ell }-1} \\ \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 \int _{T_{\ell -1}}^{T_{\ell }}G_{\ell }(t, s) \bigl\vert f_{1}\bigl(s, x_{n}(s), I^{u_{\ell }}_{T_{\ell -1}^{+}}x_{n}(s) \bigr) -f_{1}\bigl(s, x(s), I^{u_{\ell }}_{T_{ \ell -1}^{+}}x(s) \bigr) \bigr\vert \,ds \\& \quad \leq \frac{1}{\Gamma (u_{\ell }+1)} \biggl((T_{\ell }-T_{\ell -1}) \biggl(1- \frac{1}{u_{\ell }}\biggr) \biggr)^{u_{\ell }-1} \\& \qquad {}\times\int _{T_{\ell -1}}^{T_{\ell }}s^{- \delta }\bigl(K \bigl\vert x_{n}(s)- x(s) \bigr\vert +L I^{u_{\ell }}_{T_{\ell -1}^{+}}|x_{n}(s)-x(s) \bigr)|)\,ds \\& \quad \leq \frac{K}{\Gamma (u_{\ell }+1)} \biggl((T_{\ell }-T_{\ell -1}) \biggl(1- \frac{1}{u_{\ell }}\biggr) \biggr)^{u_{\ell }-1} \Vert x_{n}- x \Vert _{E_{\ell }} \int _{T_{ \ell -1}}^{T_{\ell }}s^{-\delta }\,ds \\& \qquad {}+ \frac{L}{\Gamma (u_{\ell }+1)} \biggl((T_{\ell }-T_{\ell -1}) \biggl(1- \frac{1}{u_{\ell }}\biggr) \biggr)^{u_{\ell }-1} \bigl\Vert I^{u_{\ell }}_{T_{\ell -1}^{+}}(x_{n}- x) \bigr\Vert _{E_{\ell }} \int _{T_{\ell -1}}^{T_{\ell }}s^{-\delta }\,ds \\& \quad \leq \frac{K({T_{\ell }}^{1-\delta }-{T_{\ell -1}}^{1-\delta }) ((T_{\ell }-T_{\ell -1})(1-\frac{1}{u_{\ell }}) )^{u_{\ell }-1}}{(1-\delta )\Gamma (u_{\ell }+1)} \Vert x_{n}- x \Vert _{E_{\ell }} \\& \qquad {}+ \frac{L(T_{\ell }-T_{\ell -1})^{2u_{\ell }-1}(1-\frac{1}{u_{\ell }})^{u_{\ell }-1}({T_{\ell }}^{1-\delta }-{T_{\ell -1}}^{1-\delta })}{(1-\delta ) (\Gamma (u_{\ell +1}) )^{2}} \Vert x_{n}-x \Vert _{E_{\ell }} \\& \quad \leq \frac{({T_{\ell }}^{1-\delta }-{T_{\ell -1}}^{1-\delta }) ((T_{\ell }-T_{\ell -1})(1-\frac{1}{u_{\ell }}) )^{u_{\ell }-1}}{(1-\delta )\Gamma (u_{\ell }+1)} \biggl(K + L \frac{(T_{\ell }-T_{\ell -1})^{u_{\ell }}}{\Gamma (u_{\ell }+1)} \biggr) \Vert x_{n}-x \Vert _{E_{\ell }}, \end{aligned}$$

i.e., we obtain

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

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

Step 3: W is compact.

Now, we will show that \(W(B_{R_{\ell }})\) is relatively compact, meaning that W is compact. Clearly, \(W(B_{R_{\ell }})\) is uniformly bounded because, by Step 1, we have \(W(B_{R_{\ell }})= \{W(x): x \in B_{R_{\ell }} \}\subset W(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 \int _{T_{\ell -1}}^{T_{\ell }}G_{\ell }(t_{2}, s)f_{1}\bigl(s, x(s), I^{u_{\ell }}_{T_{\ell -1}^{+}}x(s)\bigr) \,ds- \int _{T_{\ell -1}}^{T_{\ell }}G_{ \ell }(t_{1}, s)f_{1}\bigl(s, x(s), I^{u_{\ell }}_{T_{\ell -1}^{+}}x(s)\bigr) \,ds \biggr\vert \\& \quad \leq \int _{T_{\ell -1}}^{T_{\ell }} \bigl\vert G_{\ell }(t_{2}, s)-G_{\ell }(t_{1}, s) \bigr\vert \bigl\vert f_{1}\bigl(s, x(s), I^{u_{\ell }}_{T_{\ell -1}^{+}}x(s)\bigr) \bigr\vert \,ds \\& \quad \leq \int _{T_{\ell -1}}^{T_{\ell }} \bigl\vert G_{\ell }(t_{2}, s)-G_{\ell }(t_{1}, s) \bigr\vert \bigl\vert f_{1}\bigl(s, x(s), I^{u_{\ell }}_{T_{\ell -1}^{+}}x(s) \bigr)-f_{1}(s, 0, 0) \bigr\vert \,ds \\& \qquad {} + \int _{T_{\ell -1}}^{T_{\ell }} \bigl\vert G_{\ell }(t_{2}, s)-G_{\ell }(t_{1}, s) \bigr\vert \bigl\vert f_{1}(s, 0, 0) \bigr\vert \,ds \\& \quad \leq \int _{T_{\ell -1}}^{T_{\ell }} \bigl\vert G_{\ell }(t_{2}, s)-G_{\ell }(t_{1}, s) \bigr\vert \bigl[s^{-\delta } \bigl(K \bigl\vert x(s) \bigr\vert +L \bigl\vert I^{u_{\ell }}_{T_{\ell -1}^{+}}x(s) \bigr\vert \bigr) \bigr] \,ds \\& \qquad {}+f^{\star } \int _{T_{\ell -1}}^{T_{\ell }} \bigl\vert G_{\ell }(t_{2}, s)-G_{\ell }(t_{1}, s) \bigr\vert \,ds \\& \quad \leq \bigl(K \Vert x \Vert _{E_{\ell }}+L \bigl\Vert I^{u_{\ell }}_{T_{\ell -1}^{+}}x \bigr\Vert _{E_{ \ell }} \bigr) \int _{T_{\ell -1}}^{T_{\ell }}s^{-\delta } \bigl\vert G_{\ell }(t_{2}, s)-G_{ \ell }(t_{1}, s) \bigr\vert \,ds \\& \qquad {}+f^{\star } \int _{T_{\ell -1}}^{T_{\ell }} \bigl\vert G_{\ell }(t_{2}, s)-G_{\ell }(t_{1}, s) \bigr\vert \,ds \\& \quad \leq T_{\ell -1}^{-\delta } \biggl(K+L \frac{(T_{\ell }-T_{\ell -1})^{u_{\ell }}}{\Gamma (u_{\ell }+1)} \biggr) \Vert x \Vert _{E_{\ell }} \int _{T_{\ell -1}}^{T_{\ell }} \bigl\vert G_{\ell }(t_{2}, s)-G_{ \ell }(t_{1}, s) \bigr\vert \,ds \\& \qquad {}+f^{\star } \int _{T_{\ell -1}}^{T_{\ell }} \bigl\vert G_{\ell }(t_{2}, s)-G_{\ell }(t_{1}, s) \bigr\vert \,ds, \end{aligned}$$

by the continuity of Green’s function \(G_{\ell }\). Hence \(\|(Wx)(t_{2})-(Wx)(t_{1})\|_{E_{\ell }}\rightarrow 0\) as \(|t_{2}- t_{1}|\rightarrow 0\). It implies that \(W(B_{R_{\ell }})\) is equicontinuous.

Therefore, all conditions of Theorem 2.1 are fulfilled, and thus there exists \(\widetilde{x_{\ell }}\in B_{R_{\ell }}\) such that \(W\widetilde{x_{\ell }}=\widetilde{x_{\ell }}\), which is a solution of BVP (7). Since \(B_{R_{\ell }} \subset E_{\ell }\), the claim of Theorem 3.1 is proved. □

The second result is based on the Banach contraction principle.

Theorem 3.2

Let the conditions of Theorem 3.1be satisfied. Then BVP (7) has a unique solution in \(E_{\ell }\).

Proof

We shall use the Banach contraction principle to prove that W defined in (10) has a unique fixed point.

For \(x(t), y(t) \in E_{\ell }\), by Proposition(3.1), we obtain that

$$\begin{aligned}& \bigl|(Wx)(t)-(Wy)(t)\bigr| \\& \quad = \biggl\vert \int _{T_{\ell -1}}^{T_{\ell }}G_{\ell }(t, s)f_{1}\bigl(s, x(s), I^{u_{ \ell }}_{T_{\ell -1}^{+}}x(s)\bigr)- \int _{T_{\ell -1}}^{T_{\ell }}G_{\ell }(t, s)f_{1}\bigl(s, y(s), I^{u_{\ell }}_{T_{\ell -1}^{+}}y(s)\bigr) \,ds \biggr\vert \\& \quad \leq \int _{T_{\ell -1}}^{T_{\ell }}G_{\ell }(t, s) \bigl\vert f_{1}\bigl(s, x(s), I^{u_{\ell }}_{T_{\ell -1}^{+}}x(s) \bigr)-f_{1}\bigl(s, y(s), I^{u_{\ell }}_{T_{ \ell -1}^{+}}y(s) \bigr) \bigr\vert \,ds \\& \quad \leq \frac{1}{\Gamma (u_{\ell }+1)} \biggl((T_{\ell }-T_{\ell -1}) \biggl(1- \frac{1}{u_{\ell }}\biggr) \biggr)^{u_{\ell }-1} \\& \qquad {}\times \int _{T_{\ell -1}}^{T_{\ell }}s^{- \delta } \bigl(K \bigl\vert x(s)- y(s) \bigr\vert +L I^{u_{\ell }}_{T_{\ell -1}^{+}} \bigl\vert x(s)-y(s) \bigr\vert \bigr)\,ds \\& \quad \leq \frac{K}{\Gamma (u_{\ell }+1)} \biggl((T_{\ell }-T_{\ell -1}) \biggl(1- \frac{1}{u_{\ell }}\biggr) \biggr)^{u_{\ell }-1} \Vert x- y \Vert _{E_{\ell }} \int _{T_{ \ell -1}}^{T_{\ell }}s^{-\delta }\,ds \\& \qquad {} + \frac{L(T_{\ell }-T_{\ell -1})^{2u_{\ell }-1} (1-\frac{1}{u_{\ell }})^{u_{\ell }-1}}{ (\Gamma (u_{\ell }+1) )^{2}} \Vert x-y \Vert _{E_{\ell }} \int _{T_{\ell -1}}^{T_{\ell }}s^{-\delta }\,ds \\& \quad \leq \frac{1}{\Gamma (u_{\ell }+1)} \biggl((T_{\ell }-T_{\ell -1}) \biggl(1- \frac{1}{u_{\ell }}\biggr) \biggr)^{u_{\ell }-1} \biggl(K+ \frac{L(T_{\ell }-T_{\ell -1})^{u_{\ell }}}{\Gamma (u_{\ell }+1)} \biggr) \Vert x-y \Vert _{E_{\ell }} \int _{T_{\ell -1}}^{T_{\ell }}s^{-\delta }\,ds \\& \quad \leq \frac{(T_{\ell }^{1-\delta }-T_{\ell -1}^{1-\delta }) ((T_{\ell }-T_{\ell -1})(1-\frac{1}{u_{\ell }}) )^{u_{\ell }-1}}{(1-\delta ) \Gamma (u_{\ell }+1)} \biggl(K+\frac{L(T_{\ell }-T_{\ell -1})^{u_{\ell }}}{\Gamma (u_{\ell }+1)} \biggr) \Vert x-y \Vert _{E_{\ell }}. \end{aligned}$$

Consequently, by (9), the operator W is a contraction. Hence, by Banach’s contraction principle, W has a unique fixed point \(\widetilde{x_{\ell }}\in E_{\ell }\), which is the unique solution of problem (7), the claim of Theorem 3.1 is proved. □

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

We introduce the following assumption:

  1. (H2)

    Let \(f_{1}\in C(J \times \mathbb{R}\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}\times \mathbb{R}, \mathbb{R})\) and there exist constants \(K, L >0\) such that \(t^{\delta }|f_{1}(t,y_{1}, z_{1})- f_{1}(t,y_{2}, z_{2})|\leq K|y_{1}-y_{2}|+ L|z_{1}-z_{2}|\) for any \(y_{1}, y_{2}, z_{1}, z_{2} \in \mathbb{R}\) and \(t\in J\).

Theorem 3.3

Let conditions (H1), (H2) and inequality (9) 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

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

Thus, the function \(x_{\ell } \in C([0, T_{\ell }], \mathbb{R})\) solves 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

$$ 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} $$
(11)

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

4 Ulam–Hyers stability

Theorem 4.1

Let conditions (H1), (H2) and inequality (9) 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 [0, T_{1}]\), and for \(\ell =2,3,\ldots,n\):

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

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

$$ {}^{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. $$

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

$$\begin{aligned}& \biggl|z_{\ell }(t)+ \int _{T_{{\ell -1}}}^{T_{\ell }}G_{\ell }(t, s)f_{1}\bigl(s, z_{\ell }(s), I^{u_{\ell }}_{T_{\ell -1}^{+}}z_{\ell }(s) \bigr)\,ds\biggl| \\& \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.3, 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

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

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

$$ \widetilde{x}_{\ell }(t)= \int _{T_{{\ell -1}}}^{T_{\ell }}G_{\ell }(t, s) f_{1}\bigl(s, \widetilde{x}_{\ell }(s), I^{u_{\ell }}_{T_{\ell -1}^{+}} \widetilde{x}_{\ell }(s)\bigr)\,ds $$
(13)

holds.

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

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

where

$$ \mu =\max_{\ell = 1, 2,\ldots, n} \frac{({T_{\ell }}^{1-\delta }-{T_{\ell -1}}^{1-\delta }) ((T_{\ell }-T_{\ell -1})(1-\frac{1}{u_{\ell }}) )^{u_{\ell }-1}}{(1-\delta )\Gamma (u_{\ell }+1)}\biggl(K+ L \frac{(T_{\ell }-T_{\ell -1})^{u_{\ell }}}{\Gamma (u_{\ell }+1)}\biggr). $$

Then

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

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

$$ \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 . $$

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

5 Example

Let us consider the following fractional boundary value problem:

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

Let

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

Then we have

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

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

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

$$ \textstyle\begin{cases} {}^{c}D^{\frac{7}{5}}_{0^{+}}x(t)+ \frac{t^{-\frac{1}{2}}}{4e^{t}(1+ \vert x(t) \vert + \vert I^{{\frac{7}{5}}}_{0^{+}}x(t) \vert )}=0, \quad t \in J_{1}, \\ x(0)=0, \qquad x(1)=0, \end{cases} $$
(16)

and

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

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

$$\begin{aligned}& \frac{(T_{1}^{1-\delta }-T_{0}^{1-\delta }) ((T_{1}-T_{0})(1-\frac{1}{u_{1}}) )^{u_{1}-1}}{(1-\delta ) \Gamma (u_{1}+1)}\biggl(K+ L\frac{(T_{1}-T_{0})^{u_{1}}}{\Gamma (u_{1}+1)}\biggr) \\& \quad = \frac{(1-\frac{5}{7})^{\frac{2}{5}}}{\frac{1}{2}\Gamma (\frac{12}{5})}\biggl( \frac{1}{4}+\frac{1}{4\Gamma (\frac{12}{5})}\biggr) \simeq 0.4402< 1. \end{aligned}$$

Accordingly, condition (9) is achieved. By Theorem 3.1, problem (16) has a solution \(\widetilde{x}_{1} \in E_{1}\).

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

$$\begin{aligned}& \frac{(T_{2}^{1-\delta }-T_{1}^{1-\delta }) ((T_{2}-T_{1})(1-\frac{1}{u_{2}}) )^{u_{2}-1}}{(1-\delta )\Gamma (u_{2}+1)}\biggl(K+ L\frac{(T_{2}-T_{1})^{u_{2}}}{\Gamma (u_{2}+1)}\biggr) \\& \quad = \frac{(2^{\frac{1}{2}}-1)(1-\frac{2}{3})^{\frac{1}{2}}}{\frac{1}{2}\Gamma (\frac{5}{2})}\biggl( \frac{1}{4}+\frac{1}{4\Gamma (\frac{5}{2})}\biggr) \simeq 0.1576< 1. \end{aligned}$$

Thus, condition (9) is satisfied.

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

Then, by Theorem 3.3, BVP (14) has a solution

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

where

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

According to Theorem 4.1, BVP (14) is (UH) stable.

6 Conclusion

In this work we presented two results on the existence, uniqueness of solutions to the multiterm BVP boundary value problem of Caputo fractional differential equations of variable order, which is a piecewise constant function based on the essential difference about the variable order. The first one is based on Schauder’s fixed point theorem (Theorem 3.1) and the second one on the Banach contraction principle (Theorem 3.2). By a numerical example, we illustrated the theoretical findings. Finally, we study Ulam–Hyers stability (Theorem 4.1) of solutions to our problem. Therefore, all results in this work show a great potential to be applied in various applications of multidisciplinary sciences.

The variable order BVPs are important and interesting to all researchers. In other words, 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.