1 Introduction

Ulam [35], in his celebrated talk in 1940 in the mathematics club of the University of Wisconsin, presented the various mathematical challenges and questions prevalent at that time. The Ulam–Hyers stability theorem [11] provides the conditions for solution to a linear functional equation, which remains close to an exact solution. This theorem has profound implications in the field of stability theory and has sparked further research and developments in the study of functional equations. Rassias [24] presented the concept of stability in linear mapping within the framework of Banach spaces. He investigated the conditions for a linear mapping between Banach spaces for stability, focusing on perturbations of the Cauchy functional equation. This stability concept has wide-range of applications in various branches of mathematics, including differential equations, functional analysis, mathematical physics and scientific disciplines [13, 27, 29, 30, 32].

Stochastic differential equations are fundamental in modeling and analyzing dynamic systems affected by random fluctuations. The stochastic differential equations offer higher accuracy and realism in describing real-world phenomena compared to ordinary differential equations. The impulsive effects are prevalent across diverse domains in the real-world including mechanics, electronics, telecommunications, finance, biological systems and physical processes [6, 16, 20, 21].

Fractional calculus originated from a question raised by L’Hospital to Leibnitz [23], which concerned the meaning of derivative \(\frac{{\textrm{d}}^{n}y}{{\textrm{d}}x^{n}}\) when \(n = \frac{1}{2}?\) In the year 1695, Leibnitz wrote to L’Hospital replaying, “This is an apparent paradox from which one-day useful consequences will be drawn". In [36], the authors focused on the theoretical findings of Ulam–Hyers stability analysis of the stochastic differential equations by employing the Caputo fractional type with a time delay. In [15], the authors studied the existence of the solutions using stochastic functional differential equations with finite delay, they analyzed the existence, uniqueness and Ulam–Hyers stability of the solution derived for the proposed problem.

Authors in [34] have studied the complete controllability problem of fractional stochastic evolution equations and stochastic fractional evolution with Poisson jumps. Further extension of the above technique to study the existence of stochastic differential equations with inclusions of Hilfer fractional derivative and Poisson jumps is presented in [26]. In [4], the authors used the fixed point technique to study a class of Hilfer fractional stochastic integro-differential equations with Poisson jumps. Whereas the fractional Fourier transform method is used to prove the Mittag–Leffler–Ulam–Hyers stability of fractional order differential equations in [28]. The study of the Helmholtz–Duffing oscillator with Caputo fractional difference equation is found in [33].

The authors in [1] discussed the existence and uniqueness of mild solutions to stochastic neutral differential equations with Caputo operator. Mahmudov [17] studied the semilinear neutral stochastic differential equations in Hilbert spaces and furthermore, extended the study to examine the existence and uniqueness of the mild solution under the non-Lipschitz property. Whereas the study of neural stochastic functional differential equation with finite delay and fractional Brownian motion (fBm) in Hilbert spaces is presented [12]. For the derivation of the periodical solution of fractional stochastic functional differential equation and fractional Brownian motion under the non-local property in [10]. The fractional neutral stochastic functional differential equation of order \(1<\beta <2\) is studied in [9]. The theory of different forms of stochastic differential equations came into the picture with the discovery of many mathematicians like Ahmed [2], Arthi et al. [3], Makhlouf et al. [18], Brahim et al. [5], Caraballo et al. [7], Deng et al. [8], LiZ [14], Ren et al. [25] and Shen et al. [31].

In this manuscript, we investigate the Ulam–Hyers stability of neutral stochastic functional differential equations with finite delay driven by fractional Brownian motion in Hilbert spaces. For our study, we take:

$$\begin{aligned} {\textrm{d}}\left[ {x}_{a}(s) + {\mathfrak {g}}(s, {x}_{a}(s - \omega (s)))\right]= & {} \left[ {\mathfrak {I}}{x}_a(s) + {\mathfrak {f}}(s, {x}_a(s - \varrho (s)))\right] {\textrm{d}}s \nonumber \\{} & {} + \varsigma (s){\textrm{d}}\varpi ^{{\mathbb {H}}}(s),\ s\in U, \end{aligned}$$
(1.1)

\({x}_a(s) = \zeta (s),\ s\in [-\rho , 0]\).

In the context of this study, we consider the following framework: \(U=[0,{\mathcal {T}}]\), \(({\mathcal {S}}_{\vartheta }(s))_{s\ge 0}\) in a Hilbert space \({\mathcal {X}}_a\), \({\mathfrak {I}}\) represents the infinitesimal generator of an analytic the semigroup of a bounded linear operator, \(\varpi ^{{\mathbb {H}}}\) is a fractional Brownian motion on a real and separable Hilbert space \({\mathcal {Y}}_a\) and \(\omega , \varrho : [0, +\infty ) \rightarrow [0, \rho ]\) (with \(\rho > 0\)) are continuous functions. Moreover, \({\mathfrak {f}}, {\mathfrak {g}}: [0, +\infty ) \times {\mathcal {X}}_a \rightarrow {\mathcal {X}}_a\) and \(\varsigma : [0, +\infty ] \rightarrow {\mathcal {L}}^0_2({\mathcal {Y}}_a, {\mathcal {X}}_a)\) are appropriate functions, where \({\mathcal {L}}^0_2({\mathcal {Y}}_a, {\mathcal {X}}_a)\) denotes the space of Q-Hilbert-Schmidt operators from \({\mathcal {Y}}_a\) into \({\mathcal {X}}_a\). The main objectives of our work in this article are

  • To establish the foundation on neutral stochastic functional differential equations with delay driven by fractional Brownian motion, explicitly focusing on Ulam–Hyers stability.

  • To discuss the existence and uniqueness of mild solution and Ulam–Hyers stability in the theoretical concepts.

  • To justify the theoretical results through Eular–Maruyama in the numerical approach with two examples.

The first segment of this study provides an overview of the existing literature on this subject. The purpose of the second segment is to provide some basic concepts. The third segment proposes the existence and uniqueness of mild solutions based on the theoretical concepts and the extension of the equation into a Ulam–Hyers stability result was obtained, followed by Eular–Maruyama in the numerical approach of two examples given to illustrate the efficiency of our results in the fourth segment. Finally, we end the paper in the fifth segment with a derived conclusion.

2 Preliminary Results

This segment refers to the known basic concepts needed to achieve the obtained results in this study.

Let \((\Omega , \mathcal {{\mathcal {F}}}, {\mathcal {P}})\) be a complete probability space. A one-dimensional fractional Brownian motion \(\left\{ \varpi ^{{\mathbb {H}}}(s), s \in U\right\} \) with Hurst parameter \({{\mathbb {H}}} \in (1/2, 1)\) is defined as a centered Gaussian process with a covariance function that can be expressed [19] as follows:

$$\begin{aligned} {\mathfrak {R}}_{{\mathbb {H}}}(\nu ,s) = \frac{1}{2} \left( s^{2{{\mathbb {H}}}} + \nu ^{2{{\mathbb {H}}}} - |s - \nu |^{2{{\mathbb {H}}}}\right) . \end{aligned}$$

Let us consider \(\wp = \{\wp (s); s \in U\}\) as a Wiener process. Furthermore, the \(\wp ^{{\mathbb {H}}}\) can be represented using the Wiener integral as follows:

$$\begin{aligned} \wp ^{{\mathbb {H}}}(s) = \int _{0}^{s}J_{{\mathbb {H}}}(s,\nu ) {\textrm{d}}\wp (\nu ), \end{aligned}$$

here \(J_{{\mathbb {H}}}(s,\nu )\) is the square integrable kernel

$$\begin{aligned} J_{{\mathbb {H}}}(s,\nu ) = c_{{\mathbb {H}}} \nu ^{\frac{1}{2}-{{\mathbb {H}}}}\int _{\nu }^{s}(u - \nu )^{{{\mathbb {H}}}-\frac{3}{2}} u^{{{\mathbb {H}}}-\frac{1}{2}}{\textrm{d}}u,\ \forall \ s> \nu , \end{aligned}$$

where \(c_{{\mathbb {H}}}=\Big [\frac{{{\mathbb {H}}}(2{{\mathbb {H}}}-1)}{\wp (2-2{{\mathbb {H}}})({{\mathbb {H}}}-\frac{1}{2})}\Big ]^{\frac{1}{2}}\), \(\wp (.,.)\) is represents the Beta function and we put \(J_{{\mathbb {H}}} (s, \nu ) = 0\) in \(s \le \nu \).

Let \(\eta \) be the reproducing kernel Hilbert space of the fractional Brownian motion. Additionally, \(\eta \) represents the closure of the set of indicator functions \(\left\{ 1_{[0,s]}, s \in U\right\} \) with respect to the scalar product \(\langle 1_{[0,s]}, 1_{[0,\nu ]}\rangle _{\eta } = {\mathfrak {R}}_{{{\mathbb {H}}}}(s,\nu )\).

The mapping from \(1_{[0,s]} \rightarrow \wp ^{{\mathbb {H}}}(s)\) can be extended to an isometry between \(\eta \) and the first Wiener chaos. This extension is denoted by \(\wp ^{{\mathbb {H}}}(\zeta )\) the image of \(\zeta \) under the previous isometry.

We remember that for \(\Psi , \zeta \in \eta \) their scalar product in \(\eta \) is

$$\begin{aligned} \langle \Psi ,\zeta \rangle _{\eta }= {{\mathbb {H}}}(2{{\mathbb {H}}} - 1)\int _{0}^{{\mathcal {T}}}\int _{0}^{{\mathcal {T}}}\Psi (\nu )\zeta (s)|s - \nu |^{2{{\mathbb {H}}}-2}\ {\textrm{d}}\nu {\textrm{d}}s. \end{aligned}$$

Assume that \(J^*_{{\mathbb {H}}}\) from \(\eta \) to \({\mathcal {L}}^2(U)\) defined by

$$\begin{aligned} (J^*_{{\mathbb {H}}} \zeta )(\nu ) =\int _{\nu }^{{\mathcal {T}}} \zeta (\omega ) \frac{\partial J}{\partial \omega }(\omega , \nu ){\textrm{d}}\omega . \end{aligned}$$

Furthermore for every \(\zeta \in \eta \), we obtain

$$\begin{aligned} \wp ^{{\mathbb {H}}}(\zeta ) =\int _{o}^{{\mathcal {T}}}(J^*_{{\mathbb {H}}} \zeta )(s){\textrm{d}}\wp (s). \end{aligned}$$

Let us consider the \(|\eta |\) is a linear space \(\Psi \), which is generated by measurable functions \(\Psi \) satisfying the following condition:

$$\begin{aligned} \left\| \Psi \right\| ^2_{|\eta |}:= \delta _{{\mathbb {H}}} \int _{0}^{{\mathcal {T}}} \int _{0}^{{\mathcal {T}}} \Big | \Psi (\nu )\left\| \Psi (s)\right\| \nu - s\Big |^{2{{\mathbb {H}}}-2} {\textrm{d}}\nu {\textrm{d}}s < \infty , \end{aligned}$$

where \(\delta _{{\mathbb {H}}} = {{\mathbb {H}}}(2{{\mathbb {H}}} - 1)\). Then, the following embedding [22].

Let \({\mathfrak {L}}^2(U) \subseteq {\mathfrak {L}}^{\frac{1}{{{\mathbb {H}}}}}(U) \subseteq |\eta |\subseteq \eta .\)

Moreover, the following results are importance: Consider a function \(\phi (\nu )\) with \(\nu \in U\), where the values of \(\phi \) belong to \({\mathcal {L}}^0_2({\mathcal {Y}}_a,{\mathcal {X}}_a)\). The Wiener integral of \(\phi \) with respect to \(\varpi ^{{\mathbb {H}}}\) is defined as follows:

$$\begin{aligned} \int _{0}^{s}\phi (\nu ){\textrm{d}}\varpi ^{{\mathbb {H}}}(\nu ) = \sum _{n=1}^{\infty }\int _{0}^{s}\sqrt{\lambda _n}\phi (\nu )e_n{\textrm{d}}\wp ^{{\mathbb {H}}}_n(\nu ) =\sum _{n=1}^{\infty }\int _{0}^{s}\sqrt{\lambda _n}J^*_{{\mathbb {H}}} (\phi e_n)(\nu ){\textrm{d}}\wp _n(\nu ),\nonumber \\ \end{aligned}$$
(2.1)

here, \(\wp _n\) be a standard Brownian motion.

Lemma 2.1

[5] Suppose \(\Psi : U \rightarrow {\mathcal {L}}^0_2({\mathcal {Y}}_a, {\mathcal {X}}_a)\) satisfies \(\int _{0}^{{\mathcal {T}}}\left\| \Psi (\nu )\right\| ^2_{{\mathcal {L}}^0_2}\ {\textrm{d}}\nu < \infty \). In this case, the sum in Eq. (2.1) is well-defined as a random variable taking values in \({\mathcal {X}}_a\). Consequently, we have

$$\begin{aligned} E_c\left\| \int _{0}^{s}\Psi (\nu ){\textrm{d}}\varpi ^{{\mathbb {H}}}(\nu )\right\| ^2 \le 2{{\mathbb {H}}}s^{2{{\mathbb {H}}}-1}\int _{0}^{s}\left\| \Psi (\nu )\right\| ^2_{{\mathcal {L}}^0_2} {\textrm{d}}\nu . \end{aligned}$$

Lemma 2.2

[5]

  1. 1.

    For \(0 < \delta \le 1\), the space \({\mathcal {X}}_{a_{\delta }}\) is a Banach space.

  2. 2.

    If \(0 < \wp \le \delta \), then the injection \({\mathcal {X}}_{a_{\delta }} \rightarrow {\mathcal {X}}_{a_{\wp }}\) is continuous.

  3. 3.

    For all \(0 < \delta \le 1\), there exists a positive constant \(M_\delta >0\) such that

    $$\begin{aligned} \left\| (-{\mathfrak {I}})^{\delta }{\mathcal {S}}_{\vartheta }(s)\right\| \le M_{\delta }s^{-\delta }e^{-\lambda s},\ s> 0,\ \lambda > 0. \end{aligned}$$

3 Main Results

Here, we are studying the existence and uniqueness of mild solutions and Ulam–Hyers stability results for stochastic neutral functional differential equation (1.1) by utilizing the following hypothesis.

Definition 3.1

An \({\mathcal {X}}_a\)-valued process \(\left\{ {x}_a(s),s \in [-\rho ,{\mathcal {T}}]\right\} \) is said to be a mild solution of Eq. (1.1) if

  1. (i)

    \({x}_a(.) \in {\mathcal {C}}([-\rho ,{\mathcal {T}}], {\mathfrak {L}}^2(\Omega ,{\mathcal {X}}_a))\),

  2. (ii)

    \({x}_a(s) = \zeta (s),\ s\in [-\rho , 0]\),

  3. (iii)

    for arbitrary \(s \in U\), we get

    $$\begin{aligned} {x}_a(s)&={\mathcal {S}}_{\vartheta }(s)\left( \zeta (0)+{\mathfrak {g}}\left( 0,\zeta (-\omega (0))\right) \right) -{\mathfrak {g}}\left( s,{x}_a(s-\omega (s))\right) \nonumber \\&\quad -\int _{0}^{s}{\mathfrak {I}}{\mathcal {S}}_{\vartheta }(s-\nu ){\mathfrak {g}}(\nu ,{x}_a(\nu -\omega (\nu ))){\textrm{d}}\nu \nonumber \\&\quad +\int _{0}^{s}{\mathcal {S}}_{\vartheta }(s-\nu ) {\mathfrak {f}} (\nu , {x}_a(\nu - \varrho (\nu ))){\textrm{d}}\nu +\int _{0}^{s}{\mathcal {S}}_{\vartheta }(s-\nu )\varsigma (\nu ) {\textrm{d}}\varpi ^{{\mathbb {H}}}(\nu ). \end{aligned}$$
    (3.1)

Now, we present the following hypothesis.

(\({\mathcal {H}}_1\)):

Let \({\mathfrak {I}}\) be the infinitesimal generator of an analytic the semigroup \(({\mathcal {S}}_{\vartheta }(s))_{s\ge 0}\) of a bounded linear operator on \({\mathcal {X}}_a\), which satisfies \(0 \in \varrho ({\mathfrak {I}})\). For further details, please refer to Lemma 2.2,

$$\begin{aligned} \left\| {\mathcal {S}}_{\vartheta }(s)\right\| \le M\ \textrm{and}\ \left\| (-{\mathfrak {I}})^{1-\wp }{\mathcal {S}}_{\vartheta }(s)\right\| \le \frac{M_{1-\wp }}{s^{1-\wp }}, \end{aligned}$$

for some constants \(M, M_{1-\wp }\) and every \(s \in U\).

(\({\mathcal {H}}_2\)):

There exist non-negative constants \({\mathfrak {C}}_i:= {\mathfrak {C}}_i({\mathcal {T}}), i = 1, 2\) such that the function \({\mathfrak {f}}: [0,+\infty ) \times {\mathcal {X}}_a \rightarrow {\mathcal {X}}_a\) satisfies the following Lipschitz conditions for all \(s \in U\) and \({x}_a, {y}_a\in {\mathcal {X}}_a\) the inequalities \(\left\| {\mathfrak {f}}(s, {x}_a) - {\mathfrak {f}}(s, {y}_a)\right\| \le {\mathfrak {C}}_1\left\| {x}_a - {y}_a\right\| \) and \(\left\| {\mathfrak {f}}(s, {x}_a)\right\| ^2 \le {\mathfrak {C}}^2_2\left( 1 + \left\| {x}_a\right\| ^2\right) \) are valid.

(\({\mathcal {H}}_3\)):

There exist constants \(\frac{1}{2}< \wp < 1, {\mathfrak {C}}_i:= {\mathfrak {C}}_i({\mathcal {T}}), i = 3, 4,\) such that \({\mathfrak {g}}\) is \({\mathcal {X}}_{a_{\wp }}\) -valued and satisfies for every \(s \in U\) and \({x}_a, {y}_a \in {\mathcal {X}}_a\)

  1. (i)

    \(\left\| (-{\mathfrak {I}})^{\wp } {\mathfrak {g}}(s, {x}_a) - (-{\mathfrak {I}})^{\wp }{\mathfrak {g}}(s, {y}_a)\right\| \le {\mathfrak {C}}_3\left\| {x}_a - {y}_a\right\| \).

  2. (ii)

    \(\left\| (-{\mathfrak {I}})^{\wp }{\mathfrak {g}}(s, {x}_a)\right\| ^2 \le {\mathfrak {C}}^2_4(1 + \left\| {x}_a\right\| ^2)\).

  3. (iii)

    The constants \({\mathfrak {C}}_3\) and \(\wp \) satisfy the following inequality

    $$\begin{aligned} \left\| (-{\mathfrak {I}})^{-\wp }\right\| {\mathfrak {C}}_3 < 1. \end{aligned}$$
(\({\mathcal {H}}_4\)):

The function \((-{\mathfrak {I}})^{\wp }{\mathfrak {g}}\) is continuous in the quadratic mean sense. In other words, for every \({x}_a \in {\mathcal {C}}(U, {\mathfrak {L}}^2(\Omega ,{\mathcal {X}}_a))\),

$$\begin{aligned} \lim _{s\rightarrow \nu }E_c\left\| (-{\mathfrak {I}})^{\wp }{\mathfrak {g}}(s, {x}_a(s))-(-{\mathfrak {I}})^{\wp }{\mathfrak {g}}(\nu ,{x}_a(\nu ))\right\| ^2=0. \end{aligned}$$
(\({\mathcal {H}}_5\)):

The function \(\varsigma : [0, +\infty ) \rightarrow {\mathcal {L}}^0_2({\mathcal {Y}}_a, {\mathcal {X}}_a)\) satisfies \(\int _{0}^{{\mathcal {T}}}\left\| \varsigma (\nu )\right\| ^2_{{\mathcal {L}}^0_2}{\textrm{d}}\nu < \infty ,\) for all \({\mathcal {T}} > 0\).

(\({\mathcal {H}}_6\)):

The function \({\mathfrak {g}}({x}_a)\) and \({\mathfrak {g}}(s,{x}_a)\) satisfy the condition that \(\left\| {\mathfrak {f}}({x}_a)-{\mathfrak {g}}({y}_a)\right\| ^2\le {\mathfrak {C}}_4\left\| {x}_a-{y}_a\right\| ^2, \left\| {\mathfrak {f}}(s,{x}_a)-{\mathfrak {f}}(s,{y}_a)\right\| ^2\le {\mathfrak {C}}_5\left\| {x}_a-{y}_a\right\| ^2\), the \({\mathfrak {C}}_4,\ {\mathfrak {C}}_5\) are constants and \(1-3{\mathfrak {C}}^2_4 M^2_{1-\wp }(s^{2\wp -1})(2\wp -1)-3sM^2{\mathfrak {C}}^2_5>0\).

Definition 3.2

Equation (1.1) has Ulam–Hyers stability if there exists a number \(M_0>0\) such that for every given \(\varepsilon >0\) a function \({x}_a\) satisfies

$$\begin{aligned} E_c\Big \Vert&{x}_a(s)-{\mathcal {S}}_{\vartheta }(s)(\zeta (0)+{\mathfrak {g}}\left( 0,\zeta (-\omega (0))\right) )-{\mathfrak {g}}\left( s,{x}_a(s-\omega (s))\right) \nonumber \\&+\int _{0}^{s}{\mathfrak {I}}{\mathcal {S}}_{\vartheta }(s-\nu ){\mathfrak {g}}(\nu ,{x}_a(\nu -\omega (\nu ))){\textrm{d}}\nu -\int _{0}^{s}{\mathcal {S}}_{\vartheta }(s-\nu ) {\mathfrak {f}} (\nu , {x}_a(\nu - \varrho (\nu ))){\textrm{d}}\nu \nonumber \\&-\int _{0}^{s}{\mathcal {S}}_{\vartheta }(s-\nu )\varsigma (\nu ) {\textrm{d}}\varpi ^{{\mathbb {H}}}(\nu )\Big \Vert ^2 \le \varepsilon , \end{aligned}$$
(3.2)

then there exists a solution \({y}_a\) of Eq. (1.1) such that \(E_c\Big \Vert {x}_a(s)-{y}_a(s)\Big \Vert ^2\le M_0\varepsilon ,\) where \(M_0\) is a non-negative and stability constant.

Theorem 3.3

Let \(({\mathcal {H}}_1)-({\mathcal {H}}_5)\) hold. Then, for all \({\mathcal {T}} > 0\), Eq. (1.1) has a unique mild solution on \([-\rho , {\mathcal {T}} ]\).

Proof

Let us fix \({\mathcal {T}} > 0\) and consider \({\mathcal {B}}_{{\mathcal {T}}}:= {\mathcal {C}}[-\rho , {\mathcal {T}} ], {\mathfrak {L}}^2(\Omega , {\mathcal {X}}_a)\) as the Banach space of all continuous functions defined on \([-\rho , {\mathcal {T}} ]\) with values in \({\mathfrak {L}}^2(\Omega , {\mathcal {X}}_a)\). This space is equipped with the supremum norm denoted as \(\left\| \xi \right\| _{{\mathcal {B}}_{{\mathcal {T}}}} = \sup \nolimits _{u\in [-\rho ,{\mathcal {T}} ]}(E_c\left\| \xi (u)\right\| )^{\frac{1}{2}}\). Now, let us define the set as follows:

$$\begin{aligned} {\mathcal {S}}_{\vartheta _{{\mathcal {T}}}} = \{{x}_a \in {\mathcal {B}}_{{\mathcal {T}}}: {x}_a(\nu ) = \zeta (\nu ),\ \textrm{for}\ \nu \in [-\rho , 0 ]\}. \end{aligned}$$

The \({\mathcal {S}}_{\vartheta _{{\mathcal {T}}}}\) be a closed subset of \({\mathcal {B}}_{{\mathcal {T}}}\) provided with the norm \(\left\| .\right\| _{{\mathcal {B}}_{{\mathcal {T}}}}\). Let us consider the operator \(\Psi \) on \({\mathcal {S}}_{\vartheta _{{\mathcal {T}}}}\) by \(\Psi ({x}_a)(s) =\zeta (s)\) for \(s \in [-\rho , 0]\) and for \(s \in U\)

$$\begin{aligned} \begin{aligned} \Psi (x_a)(s)&= {\mathcal {S}}_{\vartheta }(s)(\zeta (0) + {\mathfrak {g}}(0, \zeta (-\omega (0)))) - {\mathfrak {g}}(s, {x}_a(s - \omega (s)))\\&\quad -\int _{0}^{s}{\mathfrak {I}}{\mathcal {S}}_{\vartheta }(s - \nu ){\mathfrak {g}}(\nu , {x}_a(\nu - \omega (\nu ))){\textrm{d}}\nu +\int _{0}^{s}{\mathcal {S}}_{\vartheta }(s - \nu ){\mathfrak {f}}(\nu - \varrho (\nu )){\textrm{d}}\nu \\&\quad +\int _{0}^{s}{\mathcal {S}}_{\vartheta }(s - \nu )\varsigma (\nu ){\textrm{d}}\varpi ^{{\mathbb {H}}}(\nu ). \end{aligned} \end{aligned}$$

It is evident that demonstrating the existence of mild solutions to Eq. (1.1) is equivalent to finding a fixed point for the operator \(\Psi \). We will now employ the Banach fixed point theorem to establish the uniqueness of the fixed point for \(\Psi \), dividing the subsequent proof into two steps.

Step 1:  For arbitrary \({x}_a \in {\mathcal {S}}_{\vartheta _{{\mathcal {T}}}}\), prove that \(s \rightarrow \Psi ({x}_a)(s)\) is continuous on the interval U in the \({\mathfrak {L}}^2(\Omega , X_a)\)-sense.

Assuming that \(0< s < {\mathcal {T}}\) and \(|h |\) is sufficiently small, the following holds for every fixed \({x}_a \in {\mathcal {S}}_{\vartheta _{{\mathcal {T}}}}\), we get

$$\begin{aligned} \begin{aligned}&\Big \Vert \Psi ({x}_a)(s + h) - \Psi ({x}_a)(s)\Big \Vert \\&\quad \le \Big \Vert ({\mathcal {S}}_{\vartheta }(s + h) - {\mathcal {S}}_{\vartheta }(s))(\zeta (0) + {\mathfrak {g}}(0, \zeta (-\omega (0))))\Big \Vert \\&\qquad + \Big \Vert {\mathfrak {g}}(s + h, {x}_a(s + h - \omega (s + h))) - {\mathfrak {g}}(s, {x}_a(s - \omega (s)))\Big \Vert \\&\qquad + \Bigg \Vert \int _{0}^{s+h}{\mathfrak {I}}{\mathcal {S}}_{\vartheta }(s + h - \nu ){\mathfrak {g}}(\nu , {x}_a(\nu - \omega (\nu ))){\textrm{d}}\nu \\&\qquad - \int _{0}^{s}{\mathfrak {I}}{\mathcal {S}}_{\vartheta }(s - \nu ){\mathfrak {g}}(\nu , {x}_a(\nu - \omega (\nu ))){\textrm{d}}\nu \Bigg \Vert \\&\qquad + \Bigg \Vert \int _{0}^{s+h}{\mathcal {S}}_{\vartheta }(s + h - \nu ){\mathfrak {f}}(\nu - \varrho (\nu )){\textrm{d}}\nu - \int _{0}^{s}{\mathcal {S}}_{\vartheta }(s - \nu ){\mathfrak {f}}(\nu - \varrho (\nu )){\textrm{d}}\nu \Bigg \Vert \\&\qquad +\Bigg \Vert \int _{0}^{s+h}{\mathcal {S}}_{\vartheta }(s + h - \nu )\varsigma (\nu ){\textrm{d}}\varpi ^{{\mathbb {H}}}(\nu ) - \int _{0}^{s}{\mathcal {S}}_{\vartheta }(s - \nu )\varsigma (\nu ){\textrm{d}}\varpi ^{{\mathbb {H}}}(\nu )\Bigg \Vert \\&\quad =\sum _{1\le i\le 5}{\mathcal {I}}_i(h). \end{aligned} \end{aligned}$$

The fulfillment of condition \(({\mathcal {H}}_1)\) assures that

$$\begin{aligned}{} & {} \left\| ({\mathcal {S}}_{\vartheta }(s + h) - {\mathcal {S}}_{\vartheta }(s))(\zeta (0) + {\mathfrak {g}}(0, \zeta (-\omega (0))))\right\| \\{} & {} \qquad \le 2M\left\| \zeta (0) + {\mathfrak {g}}(0, \zeta (-\omega (0)))\right\| \in {\mathfrak {L}}^2(\Omega ). \end{aligned}$$

Then,

$$\begin{aligned} \lim _{h\rightarrow 0}E_c|{\mathcal {I}}_1(h)|^2 = 0. \end{aligned}$$

By utilizing the fact that the operator \((-{\mathfrak {I}})^{-\wp }\) is bounded, we obtain

$$\begin{aligned}{} & {} E_c\Big | {\mathcal {I}}_2(h)\Big |^2 \le \Big \Vert (-{\mathfrak {I}})^{-\wp }\Big \Vert ^2E_c\Big \Vert (-{\mathfrak {I}})^{\wp }{\mathfrak {g}}(s + h, {x}_a(s + h - \omega (s + h)))\\{} & {} \quad - (-{\mathfrak {I}})^{\wp }{\mathfrak {g}}(s, {x}_a(s - \omega (s)))\Big \Vert ^2. \end{aligned}$$

Then,

$$\begin{aligned} \lim _{h\rightarrow 0}E_c|{\mathcal {I}}_2(h)|^2 = 0. \end{aligned}$$

Considering the third term \({\mathcal {I}}_3(h)\), let us assume that \(h > 0\), then the following expression:

$$\begin{aligned} \begin{aligned} {\mathcal {I}}_3(h)&\le \Big \Vert \int _{0}^{s}({\mathcal {S}}_{\vartheta }(h) - {\mathcal {I}})(-{\mathfrak {I}})^{1-\wp }{\mathcal {S}}_{\vartheta }(s - \nu )(-{\mathfrak {I}})^{\wp }{\mathfrak {g}}(\nu , {x}_a(\nu - \omega (\nu ))){\textrm{d}}\nu \Big \Vert \\&\quad +\Big \Vert \int _{s}^{s+h}(-{\mathfrak {I}})^{1-\wp } {\mathcal {S}}_{\vartheta }(s + h - \nu )(-{\mathfrak {I}})^{\wp }{\mathfrak {g}}(\nu , {x}_a(\nu - \omega (\nu ))){\textrm{d}}\nu \Big \Vert ,\\&\le {\mathcal {I}}_{31}(h) + {\mathcal {I}}_{32}(h). \end{aligned} \end{aligned}$$

By Holder’s inequality, one has that

$$\begin{aligned} E_c|{\mathcal {I}}_{31}(h)|^2 \le sE_c\int _{0}^{s}\left\| ({\mathcal {S}}_{\vartheta }(h) - {\mathcal {I}})(-{\mathfrak {I}})^{1-\wp }{\mathcal {S}}_{\vartheta }(s - \nu )(-{\mathfrak {I}})^{\wp }{\mathfrak {g}}(\nu , {x}_a(\nu - \omega (\nu )))\right\| ^2{\textrm{d}}\nu . \end{aligned}$$

By employing condition \(({\mathcal {H}}_1)\), condition (ii) in \(({\mathcal {H}}_3)\) and considering the fact that \(\frac{1}{2}< \wp < 1\),

$$\begin{aligned} \begin{aligned}&\Big \Vert ({\mathcal {S}}_{\vartheta }(h) - {\mathcal {I}})(-{\mathfrak {I}})^{1-\wp }{\mathcal {S}}_{\vartheta }(s - \nu )(-{\mathfrak {I}})^{\wp }{\mathfrak {g}}(\nu , {x}_a(\nu - \omega (\nu )))\Big \Vert \\ {}&\quad \le \frac{(M+1)M_{1-\wp }}{(s - \nu )^{1-\wp }} \Vert (-{\mathfrak {I}})^{\wp }{\mathfrak {g}}(\nu , x_{a}(\nu - \omega (\nu )))\Vert \in {\mathfrak {L}}^2([0, s] \times \Omega ), \end{aligned} \end{aligned}$$

then,

$$\begin{aligned} \lim _{h\rightarrow 0}E_c|{\mathcal {I}}_{31}(h)|^2 = 0. \end{aligned}$$

By taking into conditions \(({\mathcal {H}}_1)\) and \(({\mathcal {H}}_3)\), as well as applying Holder’s inequality, we have

$$\begin{aligned} E_c|{\mathcal {I}}_{32}(h)|^2 \le \frac{M^2_{1-\wp }}{2\wp - 1} h^{2\wp -1}\int _{0}^{{\mathcal {T}}}{\mathfrak {C}}^2_4 (E_c\left\| x_{a}(\nu - \omega (\nu ))\right\| ^2 + 1){\textrm{d}}\nu ,\ \lim _{h\rightarrow 0}E_c|{\mathcal {I}}_{3}(h)|^2 = 0. \end{aligned}$$

We can employ similar calculations to demonstrate that \(\lim \nolimits _{h\rightarrow 0}E_c|{\mathcal {I}}_{4}(h)|^2 = 0.\) Regarding the term \({\mathcal {I}}_5(h)\), we obtain

$$\begin{aligned} \begin{aligned} {\mathcal {I}}_5(h)&\le \left\| \int _{0}^{s}({\mathcal {S}}_{\vartheta }(h) - {\mathcal {I}}){\mathcal {S}}_{\vartheta }(s - \nu )\varsigma (\nu ){\textrm{d}}\varpi ^{{\mathbb {H}}}(\nu )\right\| \\&\quad + \left\| \int _{s}^{s+h}{\mathcal {S}}_{\vartheta }(s + h - \nu )\varsigma (\nu ){\textrm{d}}\varpi ^{{\mathbb {H}}}(\nu )\right\| ,\\&\le {\mathcal {I}}_{51}(h) + {\mathcal {I}}_{52}(h). \end{aligned} \end{aligned}$$

By condition \(({\mathcal {H}}_ 1)\) and Lemma 2.2, we obtain

$$\begin{aligned} \begin{aligned} E_c|{\mathcal {I}}_{51}(h)|^2&\le 2{{\mathbb {H}}}s^{2{{\mathbb {H}}}-1}\int _{0}^{s}\left\| ({\mathcal {S}}_{\vartheta }(h) - {\mathcal {I}}){\mathcal {S}}_{\vartheta }(s - \nu )\varsigma (\nu )\right\| ^2_{{\mathcal {L}}^0_2}{\textrm{d}}\nu ,\\&\le 2{{\mathbb {H}}}{\mathcal {T}}^{2{{\mathbb {H}}}-1}M^2\int _{0}^{{\mathcal {T}}} \left\| ({\mathcal {S}}_{\vartheta }(h) - {\mathcal {I}})\varsigma (\nu )\right\| ^2_{{\mathcal {L}}^0_2}{\textrm{d}}\nu . \end{aligned} \end{aligned}$$

Since \(\lim \limits _{h\rightarrow 0}\left\| ({\mathcal {S}}_{\vartheta }(h) - {\mathcal {I}})\varsigma (\nu )\right\| ^2_{{\mathcal {L}}^0_2}= 0\) and

$$\begin{aligned} \left\| ({\mathcal {S}}_{\vartheta }(h) - {\mathcal {I}})\varsigma (\nu )\right\| ^2_{{\mathcal {L}}^0_2}\le 4M^2\left\| \varsigma (\nu )\right\| ^2_{{\mathcal {L}}^0_2}\in {\mathfrak {L}}^1(U, {\textrm{d}}\nu ),\ \lim _{h\rightarrow 0}E_c\Big | {\mathcal {I}}_{51}(h)\Big |^2 = 0. \end{aligned}$$

Again by Lemma 2.2, we get

$$\begin{aligned} E_c\vert {\mathcal {I}}_{52}(h)|^2 \le 2{{\mathbb {H}}}h^{2{{\mathbb {H}}}-1}M^2 \int _{s}^{s+h}\left\| \varsigma (\nu )\right\| ^2_{{\mathcal {L}}^0_2}{\textrm{d}}\nu \rightarrow 0. \end{aligned}$$

Based on the previous arguments, it is evident that \(\lim \nolimits _{h\rightarrow 0} E_c\Big \Vert \Psi (x_{a})(s +h)-\Psi (x_{a})(s)\Big \Vert ^2 = 0\). Hence, we conclude that the function \(s \rightarrow \Psi (x_{a})(s)\) is continuous on U in the \({\mathfrak {L}}^2\)-sense.

Step 2:  Next, we will demonstrate that \(\Psi \) is a contraction mapping in \({\mathcal {S}}_{\vartheta _{{\mathcal {T}}_{1}}}\), where \({\mathcal {T}}_1 \le {\mathcal {T}}\) will be determined later.

If \(x_{a}, y_{a} \in {\mathcal {S}}_{\vartheta _{{\mathcal {T}}}}\) by using the inequality \((f + g + j)^2\le \frac{1}{k}f^2+\frac{2}{1-k}g^2+\frac{2}{1-k}j^2\), here \(k:= {\mathfrak {C}}_3\Vert (-{\mathfrak {I}})^{-\wp } \Vert < 1\), we obtain for every fixed \(s \in U\).

$$\begin{aligned} \begin{aligned}&\Vert \Psi (x_{a})(s)-\Psi (y_{a})(s)\Vert ^2\le \frac{1}{k}\Vert {\mathfrak {g}}(s,x_{a}(s-\omega (s)))-{\mathfrak {g}}(s,y_{a}(s-\omega (s)))\Vert ^2\\&\quad +\frac{2}{1-k}\Big \Vert \int _{0}^{s}{\mathfrak {I}}{\mathcal {S}}_{\vartheta }(s-\nu ){\mathfrak {g}}(\nu ,x_{a}(\nu -\omega (\nu )))-{\mathfrak {g}}(\nu ,y_{a}(\nu -\omega (\nu ))){\textrm{d}}\nu \Big \Vert ^2\\&\quad +\frac{2}{1-k}\Big \Vert \int _{0}^{s}{\mathcal {S}}_{\vartheta }(s-\nu ){\mathfrak {f}}(\nu ,x_{a}(\nu -\varrho (\nu )))-{\mathfrak {f}}(\nu ,y_{a}(\nu -\rho (\nu ))){\textrm{d}}\nu \Big \Vert ^2. \end{aligned} \end{aligned}$$

By Lipschitz property of \((-{\mathfrak {I}})^{\wp }{\mathfrak {g}}\) and \({\mathfrak {f}}\) combined with Holder’s inequality, we obtain

$$\begin{aligned} \begin{aligned}&E_c\Vert \Psi (x_{a})(s)-\Psi (y_{a})(s)\Vert ^2\le kE_c\Vert x_{a}(s-\omega )-y_{a}(s-\omega )\Vert ^2\\&\quad +\frac{2}{1-k}{\mathfrak {C}}^2_3M^2_{1-\wp }\Bigg (\frac{s^{2\wp -1}}{2\wp -1}\Bigg )\int _{0}^{s}E_c\Big \Vert x_{a}(\nu -\omega )-y_{a}(\nu -\omega )\Big \Vert ^2{\textrm{d}}\nu \\&\quad +\frac{2}{1-k}sM^2{\mathfrak {C}}^2_1\int _{0}^{s}E_c\Big \Vert x_{a}(\nu -\varrho (\nu ))-y_{a}(\nu -\varrho (\nu ))\Big \Vert ^2{\textrm{d}}\nu . \end{aligned} \end{aligned}$$

Hence,

$$\begin{aligned} \sup _{\nu \in [-\rho ,s]}E_c\Vert \Psi (x_{a})(\nu )-\Psi (y_{a})(\nu )\Vert ^2\le \gamma (s)\sup _{\nu \in [-\rho ,s]}E_c\Vert x_{a}(\nu )-y_{a}(\nu )\Vert ^2, \end{aligned}$$

where,

$$\begin{aligned} \gamma (s)=k+\frac{2{\mathfrak {C}}^2_3 M^2_{1-\wp }}{(1-k)(2\wp -1)}s^{2\wp }+\frac{2M^2{\mathfrak {C}}^2_1}{1-k}s^2. \end{aligned}$$

Based on condition (iii) in \(({\mathcal {H}}_3)\), we can deduce that \(\gamma (0) = k = \Vert (-{\mathfrak {I}})^{-\wp }\Vert {\mathfrak {C}}_3 < 1\). Consequently, there exists a positive value \(0<{\mathcal {T}}_1 \le {\mathcal {T}}\) such that \(0< \gamma ({\mathcal {T}}_1) < 1\). By the contraction mapping property of \(\zeta \) on \({\mathcal {S}}_{\vartheta _{{{\mathcal {T}}}_{1}}}\), it possesses a unique fixed point, which serves as a mild solution to Eq. (1.1) on the interval \([-\rho , {\mathcal {T}}_1]\). This process can be iterated in finitely many steps to extend the solution to the entire interval \([-\rho ,{\mathcal {T}}]\). Thus, we can conclude the proof. \(\square \)

Theorem 3.4

Let (\({\mathcal {H}}_1\)) and (\({\mathcal {H}}_3\))-(\({\mathcal {H}}_6\)) are true, then system of Eq. (1.1) is Ulam–Hyers stable.

Proof

We can prove the existence of the solution by using the Theorem 3.3 and then we will consider the Ulam–Hyers stability of this solution.

For every \(\varepsilon >0\), suppose that \({x}_a\) of the following inequality Eq. (3.2). We wish to prove that there exists a non-negative constant \(M_0>0\) and \({y}_a\) such that \(E_c\Big \Vert {x}_a(s)-{y}_a(s)\Big \Vert ^2\le M_0\varepsilon \), for some solution \({y}_a\) due to the inequality

$$\begin{aligned} E_c\Big \Vert {\textrm{d}}[x_{a}(s) + {\mathfrak {g}}(s, x_{a}(s - \omega (s)))]- [{\mathfrak {I}}x_{a}(s) + {\mathfrak {f}}(s, x_{a}(s - \varrho (s)))]{\textrm{d}}s - \varsigma (s){\textrm{d}}\varpi ^{{\mathbb {H}}}(s)\Big \Vert ^2<\varepsilon . \end{aligned}$$

Suppose that there exists a function \({\mathfrak {g}}(s, x_{a}(s - \omega (s))\) such that

$$\begin{aligned} E_c\left\| {\mathfrak {g}}(s, {x}_a(s - \omega (s))- {\mathfrak {g}}(s, y_{a}(s - \omega (s))\right\| <\varepsilon . \end{aligned}$$

Let us consider the equation as follows:

$$\begin{aligned} d\left[ x_{a}(s) + {\mathfrak {g}}(s, x_{a}(s - \omega (s)))\right] = \left[ {\mathfrak {I}}x_{a}(s) + {\mathfrak {f}}(s, x_{a}(s - \varrho (s)))\right] {\textrm{d}}s + \varsigma (s){\textrm{d}}\varpi ^{{\mathbb {H}}}(s), \end{aligned}$$

for all \(s\in U\) and \(x_{a}(s) = \zeta (s),\ s\in [-\rho , 0]\).

In which \({x}_0= {y}_0\), then \({x}_a(0)={y}_a(0)\) and the mild solution of equation \(x_{a}\) yields the follows:

$$\begin{aligned} x_{a}(s)&={\mathcal {S}}_{\vartheta }(s)\left( \zeta (0)+{\mathfrak {g}}\left( 0,\zeta (-\omega (0))\right) \right) -{\mathfrak {g}}\left( s,x_{a}(s-\omega (s))\right) \nonumber \\&\quad -\int _{0}^{s}{\mathfrak {I}}{\mathcal {S}}_{\vartheta }(s-\nu ){\mathfrak {g}}(\nu ,x_{a}(\nu -\omega (\nu ))){\textrm{d}}\nu +\int _{0}^{s}{\mathcal {S}}_{\vartheta }(s-\nu ) {\mathfrak {f}} (\nu , x_{a}(\nu - \varrho (\nu ))){\textrm{d}}\nu \nonumber \\&\quad +\int _{0}^{s}{\mathcal {S}}_{\vartheta }(s-\nu )\varsigma (\nu ) {\textrm{d}}\varpi ^{{\mathbb {H}}}(\nu ). \end{aligned}$$
(3.3)

It is clear that the solution is Ulam–Hyers stability in the interval \((-\infty , 0]\). Now, we consider the interval \(s \in U\) and suppose \(\varepsilon <1\). Furthermore, it follows from Eq. (3.3), we get

$$\begin{aligned} \begin{aligned}&E_c\Big \Vert {x}_a(s)-{y}_a(s)\Big \Vert ^2 \\&\quad \le 3E_c\left\| {\mathfrak {g}}(s,x_{a}(s-\omega (s)))-{\mathfrak {g}}(s,y_{a}(s-\omega (s)))\right\| ^2\\&\qquad +3E_c\left\| \int _{0}^{s}{\mathfrak {I}}{\mathcal {S}}_{\vartheta }(s-\nu ){\mathfrak {g}}(\nu ,x_{a}(\nu -\omega (\nu )))-{\mathfrak {g}}(\nu ,y_{a}(\nu -\omega (\nu ))){\textrm{d}}\nu \right\| ^2\\&\qquad +3E_c\left\| \int _{0}^{s}{\mathcal {S}}_{\vartheta }(s-\nu ) {\mathfrak {f}}(\nu , {x}_a(\nu - \varrho (\nu ))) - {\mathfrak {f}}(\nu , y_{a}(\nu - \varrho (\nu ))){\textrm{d}}\nu \right\| ^2,\\&\quad \le 3{\mathcal {T}}\varepsilon +\left( 3{\mathfrak {C}}^2_4 M^2_{1-\varpi }\left( \frac{s^{2\varpi -1}}{2\varpi -1}\right) +3sM^2{\mathfrak {C}}^2_5\right) E_c\left\| {x}_a-{y}_a\right\| ^2. \end{aligned} \end{aligned}$$

So, we have

$$\begin{aligned} \begin{aligned} E_c\left\| {x}_a(s)-{y}_a(s)\right\| ^2&\le \frac{3{\mathcal {T}}\varepsilon }{1-\dfrac{3{\mathfrak {C}}^2_4 M^2_{1-\varpi }s^{2\varpi -1}}{2\varpi -1}-3sM^2{\mathfrak {C}}^2_5}:= M_0\varepsilon , \end{aligned} \end{aligned}$$

where \(M_0=\dfrac{3{\mathcal {T}}}{1-\dfrac{3{\mathfrak {C}}^2_4 M^2_{1-\varpi }s^{2\varpi -1}}{2\varpi -1}-3sM^2{\mathfrak {C}}^2_5}\). Therefore, \(E_c\left\| {x}_a(s)-{y}_a(s)\right\| ^2 \le M_0\varepsilon \).

Hence, Eq. (1.1) has Ulam–Hyers stability. \(\square \)

4 Numerical Examples

In this segment, we have provide the Euler–Maruyama numerical method through two examples present the efficiency of the obtained results.

Example 4.1

Consider the following neutral stochastic functional differential equation for every \(\varepsilon > 0\),

$$\begin{aligned} {\left\{ \begin{array}{ll} &{}d\left[ {x}_{a}(s) + {\mathfrak {g}}(s, {x}_{a}(s - \omega (s)))\right] = \left[ {\mathfrak {I}}{x}_a(s) + {\mathfrak {f}}(s, {x}_{a}(s - \omega (s)))\right] {\textrm{d}}s + \varsigma (s){\textrm{d}}\varpi ^{{\mathbb {H}}}(s),\\ &{}x_{a}(s)=\zeta (s), \end{array}\right. } \end{aligned}$$
(4.1)

where

$$\begin{aligned} \zeta (s)&\in {\mathcal {L}}^0_{2}([-\rho , 0]; {\mathbb {R}}), x_a(s) \in {\mathcal {M}}^2([s_0 - \rho , {\mathcal {T}}]; {\mathbb {R}}),\\ {\mathfrak {f}}(s, {x}_{a}(s - \omega (s))&={\mathfrak {f}}(s, x_a) \\&=\frac{1}{\sqrt{1+s^2}}x_a(0)+\frac{\sin (s)}{\sqrt{1+s^2}} x_a(-\rho ),\ x_a\in C ([- \rho , 0]; {\mathbb {R}}),\\ {\mathfrak {g}}(s, {x}_{a}(s - \omega (s))&={\mathfrak {g}}(s, x_a)\\&=\int _{-\rho }^{0}\frac{1}{\sqrt{1+s^2}} \sin (-\rho )x_a(-\rho )\ {\textrm{d}}\rho ,\ x_a\in C ([- \rho , 0]; {\mathbb {R}}), \end{aligned}$$

with \(\rho > 0\). Then, replacing now \(x_a\) by the segment of a solution \(x_{a_{s}}\), we get

$$\begin{aligned} {\mathfrak {f}}(s, x_{a_{s}})&=\frac{1}{\sqrt{1+s^2}}x_a(s)+\frac{\sin (s)}{\sqrt{1+s^2}} x_a(s-\rho ),\\ {\mathfrak {g}}(s, x_{a_{s}})&=\int _{-\rho }^{0}\frac{1}{\sqrt{1+s^2}} \sin (-\rho )x_a(s-\rho )\ {\textrm{d}}\rho . \end{aligned}$$

We wish to prove that Eq. (4.1) has Ulam–Hyers stability. Let \(x_a, y_a \in C([-\rho , 0], {\mathbb {R}})\), we have

$$\begin{aligned} \Big |{\mathfrak {f}}(s, x_a) - {\mathfrak {f}}(s, y_a)\Big |^2&= \Big |\frac{1}{\sqrt{1+s^2}}(x_a(0)-y_a(0))+\frac{\sin (s)}{\sqrt{1+s^2}} (x_a(-\rho )-y_a(0))\Big |^2,\\&\le \frac{2}{1+s^2}\Big |x_a(0)-y_a(0)\Big |^2+\frac{\sin ^2(s)}{1+s^2} \Big |x_a(-\rho )-y_a(\rho )\Big |^2,\\&\le 2\Big \Vert x_a-y_a\Big \Vert ^2. \end{aligned}$$

On the other hand,

$$\begin{aligned} \Big |{\mathfrak {g}}(s, x_a) - {\mathfrak {f}}(s, y_a)\Big |&= \Bigg |\int _{-\rho }^{0}\frac{1}{\sqrt{1+s^2}}\sin (-\rho )(x_a(-\rho )-y_a(-\rho )){\textrm{d}}\rho \Bigg |,\\&\le \frac{1}{\sqrt{1+s^2}} \int _{-\rho }^{0}\Big |\sin (-\rho )\Big |\Big |x_a(-\rho )-y_a(-\rho )\Big |{\textrm{d}}\rho ,\\&\le \frac{1}{\sqrt{1+s^2}}\Big |x_a(-\rho )-y_a(-\rho )\Big |\int _{-\rho }^{0}{\textrm{d}}\rho ,\le \frac{\rho }{\sqrt{1+s^2}}\Big \Vert x_a-y_a\Big \Vert . \end{aligned}$$

Therefore,

$$\begin{aligned} \Big |{\mathfrak {g}}(s, x_a) - {\mathfrak {f}}(s, y_a)\Big |^2\le \frac{\rho ^2}{\sqrt{1+s^2}}\Big \Vert x_a-y_a\Big \Vert ^2. \end{aligned}$$

Hence,

$$\begin{aligned} \Big |{\mathfrak {f}}(s, x_a)\Big |^2&= \Big |\frac{1}{\sqrt{1+s^2}}x_a(0)+\frac{\sin (s)}{\sqrt{1+s^2}} (x_a(\rho )\Big |^2,\\&\le \frac{2}{1+s^2}\Big |x_a(0)\Big |^2+\frac{sin^2(s)}{1+s^2} \Big |x_a(\rho )\Big |^2,\\&\le 2\Big \Vert x_a\Big \Vert ^2, \end{aligned}$$

and

$$\begin{aligned} \Big |{\mathfrak {g}}(s, x_a)\Big |^2&= \Big |\frac{1}{\sqrt{1+s^2}} (x_a(\rho )\Big |^2,\\&\le \frac{2}{1+s^2} \Big |x_a(\rho )\Big |^2,\\&\le 2\Big \Vert x_a\Big \Vert ^2. \end{aligned}$$

Hence, by Theorem 3.4, the Eq. (4.1) has Ulam–Hyers stability.

Fig. 1
figure 1

Simulation of \(x_a(s)\) and \(y_a(s)\) in Eq. (4.1)

The effects of Eq. (4.1) solution through \(s_0=1, \rho =2.5\) and initial value for all \(-0.5 \le s \le 0\), are depicted in Fig. 1, plots the graphs for varying \(x_a(s)\) and \(y_a(s)\) against time. This graph shows that the time in favour of \(x_a(s)\) increase rapidly and \(y_a(s)\) oscillate the same value. It is difficult to distinguish the sample path solution from the two simulated solutions on the plot. In the simulation, if the numerical solution reaches 0 or negative at any time point, we consider the numerical solution at that particular time point and set all the time points to zero.

Example 4.2

Consider the following neutral stochastic functional differential equation for every \(\varepsilon > 0\),

$$\begin{aligned} {\left\{ \begin{array}{ll} &{}{\textrm{d}}\left[ {x}_{a}(s) + {\mathfrak {g}}(s, {x}_{a}(s - \omega (s)))\right] = \left[ {\mathfrak {I}}{x}_a(s) + {\mathfrak {f}}(s, {x}_{a}(s - \omega (s)))\right] {\textrm{d}}s + \varsigma (s){\textrm{d}}\varpi ^{{\mathbb {H}}}(s),\\ &{}x_{a}(s)=\zeta (s), \end{array}\right. } \end{aligned}$$
(4.2)

where

$$\begin{aligned} \begin{aligned} \zeta (s)&\in {\mathcal {L}}^0_{2}([-\rho , 0]; {\mathbb {R}}), x(s) \in {\mathcal {M}}^2([s_0 - \rho , {\mathcal {T}}], {\mathbb {R}}),\\ {\mathfrak {f}}(s, {x}_{a}(s - \omega (s))&={\mathfrak {f}}(s, x_a) \\&=\frac{1}{\sqrt{1+s^2}}x_a(0)+\frac{\cos (s)}{\sqrt{1+s^2}} x_a(\rho )d\theta ,\ x_a\in C ([- \rho , 0]; {\mathbb {R}}),\\ {\mathfrak {g}}(s, {x}_{a}(s - \omega (s))&={\mathfrak {g}}(s, x_a)=\frac{\sin (s)}{\sqrt{1+s^2}} x_a(-\rho ),\ x_a\in C ([- \rho , 0]; {\mathbb {R}}), \end{aligned} \end{aligned}$$

with \(\rho > 0\). Then, replacing now \(x_a\) by the segment of a solution \(x_{a_{s}}\), we get

$$\begin{aligned} {\mathfrak {f}}(s, x_{a_{s}})&=\frac{1}{\sqrt{1+s^2}}x_a(s)+\frac{\cos (s)}{\sqrt{1+s^2}} x_a(s-\rho ),\\ {\mathfrak {g}}(s, x_{a_{s}})&=\frac{\sin (s)}{\sqrt{1+s^2}} x_a(s-\rho ). \end{aligned}$$

We wish to prove that Eq. (4.2) has Ulam–Hyers stability. Let \(x_a, y_a \in C([-\rho , 0], {\mathbb {R}})\), we have

$$\begin{aligned} \Big |{\mathfrak {f}}(s, x_a) - {\mathfrak {f}}(s, y_a)\Big |^2&= \Big |\frac{1}{\sqrt{1+s^2}}(x_a(0)-y_a(0))+\frac{\cos (s)}{\sqrt{1+s^2}} (x_a(-\rho )-y_a(-\rho ))\Big |^2,\\&\le \frac{2}{1+s^2}\Big |x_a(0)-y_a(0)\Big |^2+\frac{2}{1+s^2} \Big |x_a(-\rho )-y_a(-\rho )\Big |^2,\\&\le 4\Big \Vert x_a-y_a\Big \Vert ^2. \end{aligned}$$

On the other hand,

$$\begin{aligned} \begin{aligned} \Big |{\mathfrak {g}}(s, x_a) - {\mathfrak {g}}(s, y_a)\Big |^2&= \frac{\sin ^2(s)}{{1+s^2}} \Big |(x_a(-\rho )-y_a(-\rho ))\Big |^2,\\&\le \Big \Vert x_a-y_a\Big \Vert ^2. \end{aligned} \end{aligned}$$

Hence, the Lipschitz property is satisfied. Furthermore,

$$\begin{aligned} \begin{aligned} \Big |{\mathfrak {f}}(s, x_a)\Big |^2&= \Big |\frac{1}{\sqrt{1+s^2}}x_a(0)+\frac{\sin (s)}{\sqrt{1+s^2}} (x_a(-\rho )\Big |^2,\\&\le \frac{2}{1+s^2}\Big |x_a(0)\Big |^2+\frac{sin^2(s)}{1+s^2} \Big |x_a(-\rho )\Big |^2,\\&\le 2\Big (1+\Big \Vert x_a\Big \Vert ^2\Big ). \end{aligned} \end{aligned}$$

In addition,

$$\begin{aligned} \begin{aligned} \Big |{\mathfrak {g}}(s, x_a)\Big |^2&= \frac{\sin ^2}{1+s^2} \Big |x_a(-\rho )\Big |^2,\\&\le 1+\Big \Vert x_a(\rho )\Big \Vert ^2. \end{aligned} \end{aligned}$$

Hence, by Theorem 3.4, the Eq. (4.2) has Ulam–Hyers stability.

Fig. 2
figure 2

Simulation of \(x_a(s)\) and \(y_a(s)\) in Eq. (4.2)

The effects of Eq. (4.2) solution through \(s_0=1, \rho =2.5\) and initial value for all \(-0.5 \le s \le 0\), are depicted in Fig. 2, plots the graphs for varying \(x_a(s)\) and \(y_a(s)\) against time. This graph shows that the time in favour of \(x_a(s)\) increase rapidly and \(y_a(s)\) oscillate the same value. It is difficult to distinguish the sample path solution from the two simulated solutions on the plot. In the simulation, if the numerical solution reaches 0 or negative at any time point, we consider the numerical solution at that particular time point and set all the time points to zero.

5 Conclusion

In the present work, we consider the neural stochastic functional differential equation with finite delay driven by fractional Brownian motion in Hilbert spaces. First, we examine the existence and uniqueness of the mild solution. Next, we investigate the Ulam–Hyers stability of the obtained solution. Furthermore, we justified the theoretical results through a numerical simulation with examples. Hence, from both the theoretical results and the numerical simulation, we can conclude that the Euler–Maruyama method is more accurate in studying the neural stochastic functional differential equation Eqs. (4.1) and (4.2). In our future research, we are interest to investigate the application of stochastic differential equations in various areas.