Before the initial value problem (1), (2) formulated in the previous section will be investigated, a simpler problem will be studied. First we derive the moment equations in the scalar case of system (1), that is, if instead of the system there is an equation. In the first part of this section, the linear homogenous differential equation, the coefficient of which depends on a random Markov process, with two states only is considered. In the second part, the moment equations are derived for nonhomogenous linear differential equations with *q* possible states of a random process, on which the coefficients depend.

### 3.1 Homogenous linear differential equations

On the probability space (\mathrm{\Omega},\mathcal{F},\mathbb{P}), we consider initial value problem (1), (2) where instead of system (1) there is a stochastic linear homogenous differential equation of the first order of the form

\frac{dx(t)}{dt}=a(\xi (t))x(t),

(5)

where *a* is a scalar function of a random variable. We suppose that the function *a* depends on the random Markov process \xi (t), which has only two states {\theta}_{1}, {\theta}_{2} with probabilities

{p}_{k}(t)=P\{\xi (t)={\theta}_{k}\},\phantom{\rule{1em}{0ex}}k=1,2,

that satisfy the system of linear differential equations

\begin{array}{r}\frac{d{p}_{1}(t)}{dt}=-\lambda {p}_{1}(t)+\nu {p}_{2}(t),\\ \frac{d{p}_{2}(t)}{dt}=\lambda {p}_{1}(t)-\nu {p}_{2}(t),\phantom{\rule{1em}{0ex}}\lambda \ge 0,\nu \ge 0.\end{array}

(6)

In the following, we use the denotations

\begin{array}{r}{a}_{1}=a({\theta}_{1}),\\ {a}_{2}=a({\theta}_{2}).\end{array}

**Theorem 1** *Moment equations of any order* s=0,1,2,\dots *for equation* (5) *are of the form*

\begin{array}{r}\frac{d{E}_{s}^{(1)}(t)}{dt}=s{a}_{1}{E}_{s}^{(1)}(t)-\lambda {E}_{s}^{(1)}(t)+\nu {E}_{s}^{(2)}(t),\\ \frac{d{E}_{s}^{(2)}(t)}{dt}=s{a}_{2}{E}_{s}^{(2)}(t)+\lambda {E}_{s}^{(1)}(t)-\nu {E}_{s}^{(2)}(t).\end{array}

(7)

*Proof* We divide the time line [0,\mathrm{\infty}) into intervals of length *h*. Next we replace the considered system of differential equations (5) by an approximated system of difference equations. If we denote {t}_{n}=nh, h>0, n=1,2,\dots , and approximate dx({t}_{n+1})/dt with (x({t}_{n+1})-x({t}_{n}))/h, then the approximated system to system (5) can be written in the form

x({t}_{n+1})=(1+ha(\xi ({t}_{n})))x({t}_{n}),\phantom{\rule{1em}{0ex}}n=1,2,\dots

or the approximated system to system (6) is of the form

\begin{array}{r}{p}_{1}({t}_{n+1})=(1-h\lambda ){p}_{1}({t}_{n})+h\nu {p}_{2}({t}_{n}),\\ {p}_{2}({t}_{n+1})=h\lambda {p}_{1}({t}_{n})+(1-h\nu ){p}_{2}({t}_{n}).\end{array}

(8)

In accordance with the formula for total probability, we obtain relationships for the particular density functions {f}_{k}({t}_{n},x), k=1,2, which satisfy the following system of functional equations:

{f}_{1}({t}_{n+1},x)=\frac{1-h\lambda}{1+h{a}_{1}}{f}_{1}({t}_{n},\frac{x}{1+h{a}_{1}})+\frac{h\nu}{1+h{a}_{2}}{f}_{2}({t}_{n},\frac{x}{1+h{a}_{2}}),

(9)

{f}_{2}({t}_{n+1},x)=\frac{h\lambda}{1+h{a}_{1}}{f}_{1}({t}_{n},\frac{x}{1+h{a}_{1}})+\frac{1-h\nu}{1+h{a}_{2}}{f}_{2}({t}_{n},\frac{x}{1+h{a}_{2}}).

(10)

Rename ‘{t}_{n}’ to ‘*t*’ and suppose that the particular density functions can be expressed in powers of parameter *h* by the Taylor formula. Let functions in (9) be represented as

\begin{array}{r}f({t}_{n+1},x)={f}_{1}(t+h,x)={f}_{1}(t,x)+\frac{\partial {f}_{1}(t,x)}{\partial t}h+O\left({h}^{2}\right),\\ \frac{1-h\lambda}{1+h{a}_{1}}{f}_{1}({t}_{n},\frac{x}{1+h{a}_{1}})\\ \phantom{\rule{1em}{0ex}}=(1-h(\lambda +{a}_{1})+O\left({h}^{2}\right)){f}_{1}(t,x-hx{a}_{1}+O\left({h}^{2}\right))\\ \phantom{\rule{1em}{0ex}}=(1-h(\lambda +{a}_{1})+O\left({h}^{2}\right))({f}_{1}(t,x)-\frac{\partial {f}_{1}(t,x)}{\partial x}hx{a}_{1}+O\left({h}^{2}\right))\\ \phantom{\rule{1em}{0ex}}={f}_{1}(t,x)-h\lambda {f}_{1}(t,x)-h{a}_{1}{f}_{1}(t,x)-h{a}_{1}x\frac{\partial {f}_{1}(t,x)}{\partial x}+O\left({h}^{2}\right),\\ \frac{h\nu}{1+h{a}_{2}}{f}_{2}({t}_{n},\frac{x}{1+h{a}_{2}})=h\nu {f}_{2}(t,x)+O\left({h}^{2}\right),\end{array}

where *O* is Landau order symbol. Now, using the obtained expressions and comparing the left-hand side to the right-hand side of (9) and assuming h\to 0, we get

\frac{\partial {f}_{1}(t,x)}{\partial t}=-{a}_{1}\frac{\partial}{\partial x}(x{f}_{1}(t,x))-\lambda {f}_{1}(t,x)+\nu {f}_{2}(t,x).

(11)

Similarly, decomposition of the particular density functions in (10) gives the second equation

\frac{\partial {f}_{2}(t,x)}{\partial t}=-{a}_{2}\frac{\partial}{\partial x}(x{f}_{2}(t,x))+\lambda {f}_{1}(t,x)-\nu {f}_{2}(t,x).

(12)

Finally, multiplying equations (11), (12) by {x}^{s}, s=0,1,2,\dots and integrating them by parts from −∞ to ∞, in accordance with Definition 2, a system of linear differential equations with constant coefficients (7) can be obtained. □

Let us note that moment equations (7) can be derived in a different way. If system (8) of difference equations for probabilities is known, then the particular moments of the *s* th order satisfy the following relations:

\begin{array}{rl}{E}_{s}^{(1)}({t}_{n+1})& =(1-h\lambda ){(1+h{a}_{1})}^{s}{E}_{s}^{(1)}({t}_{n})+h\nu {(1+h{a}_{2})}^{s}{E}_{s}^{(2)}({t}_{n}),\\ {E}_{s}^{(2)}({t}_{n+1})& =h\lambda {(1+h{a}_{1})}^{s}{E}_{s}^{(1)}({t}_{n})+(1-h\nu ){(1+h{a}_{2})}^{s}{E}_{s}^{(2)}({t}_{n}).\end{array}

(13)

Particular moments contained in the first equation of (13) can be expressed in powers of parameter *h* by the Taylor formula:

\begin{array}{c}{E}_{s}^{(1)}({t}_{n+1})={E}_{s}^{(1)}(t+h)={E}_{s}^{(1)}(t)+\frac{d{E}_{s}^{(1)}(t)}{dt}h+O\left({h}^{2}\right),\hfill \\ (1-h\lambda ){(1+h{a}_{1})}^{s}{E}_{s}^{(1)}({t}_{n})=(1+hs{a}_{1}-h\lambda +O\left({h}^{2}\right)){E}_{s}^{(1)}(t),\hfill \\ h\nu {(1+h{a}_{2})}^{s}{E}_{s}^{(2)}({t}_{n})=h\nu {E}_{s}^{(2)}(t)+O\left({h}^{2}\right).\hfill \end{array}

If we put the obtained expressions into the first equation of (13), then under assumption h\to 0, we get the first equation of system (7). In the same way, using the second equation of (13), the second equation of system (7) can be constructed.

**Example 1** Let us establish conditions for *s*-mean stability of linear differential equation (5). The characteristic equation for the system of moment equations (7) is written as follows:

\begin{array}{r}\left|\begin{array}{cc}z-s{a}_{1}+\lambda & -\nu \\ -\lambda & z-s{a}_{2}+\nu \end{array}\right|\\ \phantom{\rule{1em}{0ex}}={z}^{2}+z(\lambda +\nu -s({a}_{1}+{a}_{2}))+{s}^{2}{a}_{1}{a}_{2}-s\nu {a}_{1}-s\lambda {a}_{2}=0.\end{array}

Therefore, the conditions of asymptotic stability of solutions of moment equations (7), in accordance with the Hurwitz criterion, are of the following form (assume s\ne 0, the case s=0 is considered below):

{a}_{1}+{a}_{2}<\frac{\lambda +\nu}{s},\phantom{\rule{2em}{0ex}}{a}_{1}{a}_{2}>\frac{\nu {a}_{1}+\lambda {a}_{2}}{s}.

Let us use the denotations

\gamma \equiv \frac{\lambda +\nu}{s},\phantom{\rule{2em}{0ex}}a\equiv \frac{\nu {a}_{1}+\lambda {a}_{2}}{\lambda +\nu}={a}_{1}{p}_{1}^{0}+{a}_{2}{p}_{2}^{0},

where {p}_{k}^{0}={lim}_{t\to +\mathrm{\infty}}{p}_{k}(t), k=1,2 and *a* is mean value of coefficients {a}_{1}, {a}_{2}. It allows us to derive a simpler form of the above conditions:

{a}_{1}+{a}_{2}<\gamma ,\phantom{\rule{2em}{0ex}}{a}_{1}{a}_{2}>a\gamma .

The domains of stability for moments of various order are determined by their boundaries as it is shown in Figure 1. Any domain of stability includes the third quadrant where the values of coefficients {a}_{1}, {a}_{2} are negative, *i.e.*, {a}_{1}<0, {a}_{2}<0.

Using moment equations, it is also possible to determine the domain of stability for the deterministic equation

where *a* is independent of a random variable \xi (t). This case corresponds to the moment equations of the zeroth order, *i.e.*, if s=0.

### 3.2 Nonhomogenous linear differential equation

We have derived the system of moment equations for a linear homogenous equation with random coefficient under assumptions that the random variable can only be in two states. It was a simple enough case that allowed us to understand the process of deriving the system of moment equations. Now we establish a system of moment equations in the same way for linear the nonhomogeneous differential equation

\frac{dx(t)}{dt}=a(t,\xi (t))x(t)+b(t,\xi (t)),

(14)

where \xi (t) is the Markov process which has *q* possible states {\theta}_{1},{\theta}_{2},\dots ,{\theta}_{q}, with probabilities {p}_{k}(t)=P\{\xi (t)={\theta}_{k}\}, k=1,2,\dots ,q. We suppose that the probabilities satisfy the system of linear differential equations

\frac{d{p}_{k}(t)}{dt}=\sum _{s=1}^{q}{\pi}_{ks}(t){p}_{s}(t),

(15)

where the transition matrix {({\pi}_{ks}(t))}_{k,s=1}^{q} satisfies the following relationships:

\sum _{k=1}^{q}{\pi}_{ks}(t)\equiv 0,\phantom{\rule{1em}{0ex}}{\pi}_{ks}(t)\{\begin{array}{cc}\ge 0,\hfill & k\ne s,\hfill \\ \le 0,\hfill & k=s.\hfill \end{array}

Since the coefficients of studied system (14) depend on *t*, we can denote

{a}_{k}(t)=a(t,{\theta}_{k}),\phantom{\rule{2em}{0ex}}{b}_{k}(t)=b(t,{\theta}_{k}),\phantom{\rule{1em}{0ex}}k=1,2,\dots ,q.

**Theorem 2** *Moment equations of any order* s=1,2,\dots *for equation* (14) *are of the form*

\begin{array}{r}\frac{d{E}_{s}^{(k)}(t)}{dt}=s{a}_{k}(t){E}_{s}^{(k)}(t)+s{b}_{k}(t){E}_{s-1}^{(k)}(t)+\sum _{r=1}^{q}{\pi}_{kr}(t){E}_{s}^{(r)}(t),\\ \phantom{\rule{1em}{0ex}}k=1,2,\dots ,q.\end{array}

(16)

*Proof* By dividing the time line into intervals of length *h*, we obtain the approximated system

x({t}_{n+1})=(1+ha({t}_{n},\xi ({t}_{n})))x({t}_{n})+hb({t}_{n},\xi ({t}_{n}))

to the considered system (14) and

{p}_{k}({t}_{n+1})={p}_{k}({t}_{n})+h\sum _{s=1}^{q}{\pi}_{ks}({t}_{n}){p}_{s}({t}_{n}),\phantom{\rule{1em}{0ex}}k=1,2,\dots ,q

to system (15).

Particular probability density functions {f}_{k}({t}_{n},x) satisfy, in this case, the system of difference equations

\begin{array}{rl}{f}_{k}({t}_{n+1},x)=& \frac{1}{1+h{a}_{k}({t}_{n})}{f}_{k}({t}_{n},\frac{x-h{b}_{k}({t}_{n})}{1+h{a}_{k}({t}_{n})})\\ +h\sum _{s=1}^{q}\frac{{\pi}_{ks}({t}_{n})}{1+h{a}_{k}({t}_{n})}{f}_{k}({t}_{n},\frac{x-h{b}_{k}({t}_{n})}{1+h{a}_{k}({t}_{n})}).\end{array}

(17)

Similarly as in the proof of Theorem 1, we assume that the particular density functions can be represented in powers of parameter *h* by the Taylor formula, and by the same way as in the proof of Theorem 1, we get

\frac{\partial {f}_{k}(t,x)}{\partial t}=-\frac{\partial}{\partial x}({a}_{k}(t)x+{b}_{k}(t)){f}_{k}(t,x)+\sum _{s=1}^{q}{\pi}_{ks}(t){f}_{s}(t,x),\phantom{\rule{1em}{0ex}}k=1,2,\dots ,q.

The system of moment equations (16) can be derived from the last system for particular probability density functions by using the same modifications as in the proof of Theorem 1. □