In this section we use the above obtained expressions to obtain the explicit expression of the Green’s function, depending on the values of the constants a and b. Moreover, we study the sign of the function and deduce suitable comparison results.
We separate the study in three cases, taking into consideration the expression of the general solution of (2.6).
3.1 The case (C1)
Now, assume the case (C1), i.e., {a}^{2}>{b}^{2}. Using (2.10), we get the following expression of G for this situation:
G(t,s)=[cos(\omega (st))+\frac{b}{\omega}sin(\omega (st))]{\chi}_{0}^{t}(s)+\frac{a}{\omega}sin(\omega (s+t)){\chi}_{t}^{0}(s),
which we can rewrite as
Studying the expression of G we can obtain maximum and antimaximum principles. In order to do this, we will be interested in those maximal strips (in the sense of inclusion) of the kind [\alpha ,\beta ]\times \mathbb{R} where G does not change sign depending on the parameters.
So, we are in a position to study the sign of the Green’s function in the different triangles of definition. The result is the following.
Lemma 3.1
Assume
{a}^{2}>{b}^{2}
and define
\eta (a,b):=\{\begin{array}{cc}\frac{1}{\sqrt{{a}^{2}{b}^{2}}}arctan\frac{\sqrt{{a}^{2}{b}^{2}}}{b},\hfill & \mathit{\text{if}}\phantom{\rule{0.25em}{0ex}}b>0,\hfill \\ \frac{\pi}{2a},\hfill & \mathit{\text{if}}\phantom{\rule{0.25em}{0ex}}b=0,\hfill \\ \frac{1}{\sqrt{{a}^{2}{b}^{2}}}(arctan\frac{\sqrt{{a}^{2}{b}^{2}}}{b}+\pi ),\hfill & \mathit{\text{if}}\phantom{\rule{0.25em}{0ex}}b<0.\hfill \end{array}
Then the Green’s function of problem (2.5) is

positive on\{(t,s),0<s<t\}if and only ift\in (0,\eta (a,b)),

negative on\{(t,s),t<s<0\}if and only ift\in (\eta (a,b),0).
If a>0, the Green’s function of problem (2.5) is

positive on\{(t,s),t<s<0\}if and only ift\in (0,\pi /\sqrt{{a}^{2}{b}^{2}}),

positive on\{(t,s),0<s<t\}if and only ift\in (\pi /\sqrt{{a}^{2}{b}^{2}},0),
and, if a<0, the Green’s function of problem (2.5) is

negative on\{(t,s),t<s<0\}if and only ift\in (0,\pi /\sqrt{{a}^{2}{b}^{2}}),

negative on\{(t,s),0<s<t\}if and only ift\in (\pi /\sqrt{{a}^{2}{b}^{2}},0).
Proof For 0<b<a, the argument of the sin in (3.1c) is positive, so (3.1c) is positive for t<\pi /\omega. On the other hand, it is easy to check that (3.1a) is positive as long as t<\eta (a,b).
The rest of the proof continues similarly. □
As a corollary of the previous result we obtain the following one.
Lemma 3.2 Assume {a}^{2}>{b}^{2}. Then we have the following:

ifa>0, the Green’s function of problem (2.5) is nonnegative on[0,\eta (a,b)]\times \mathbb{R},

ifa<0, the Green’s function of problem (2.5) is nonpositive on[\eta (a,b),0]\times \mathbb{R},

the Green’s function of problem (2.5) changes sign in any other strip not a subset of the aforementioned.
Proof The proof follows from the previous result together with the fact that
\eta (a,b)\le \frac{\pi}{2\omega}<\frac{\pi}{\omega}.
□
Remark 3.1 Realize that the rectangles defined in the previous lemma are optimal in the sense that G changes sign in a bigger rectangle. The same observation applies to similar results we will prove for the other cases. This fact implies that we cannot have maximum or antimaximum principles on bigger intervals for the solution, something that is widely known and which the following results, together with Example 3.4, illustrate.
Since G(t,0) changes sign at t=\eta (a,b), it is immediate to verify that, by defining function {h}_{\u03f5}(s)=1 for all s\in (\u03f5,\u03f5) and {h}_{\u03f5}(s)=0 otherwise, we have a solution of problem (2.5) that crosses the 0 line as close to the right of \eta (a,b) as necessary. So the estimates are optimal for this case.
However, one can study problems with particular nonhomogeneous part h for which the solution crosses 0 for a bigger interval. This is showed in the following example.
Example 3.1 Consider the problem {x}^{\prime}(t)5x(t)+4x(t)={cos}^{2}3t, x(0)=0.
Clearly, we are in the case (C1). For this problem,
\begin{array}{rl}\overline{u}(t)& :={\int}_{0}^{t}[cos(3(st))+\frac{4}{3}sin(3(st))]{cos}^{2}3s\phantom{\rule{0.2em}{0ex}}\mathrm{d}s\frac{5}{3}{\int}_{t}^{0}sin(3(s+t))\phantom{\rule{0.2em}{0ex}}\mathrm{d}s\\ =\frac{1}{18}(6cos3t+3cos6t+2sin3t+2sin6t9).\end{array}
\overline{u}(0)=0, so \overline{u} is the solution of our problem.
Studying \overline{u}, we can arrive at the conclusion that \overline{u} is nonnegative in the interval [0,\gamma ], being zero at both ends of the interval and
\begin{array}{rcl}\gamma & =& \frac{1}{3}arccos\left(\frac{1}{39}[\sqrt[3]{47\text{,}2155\text{,}265\sqrt{41}}+\sqrt[3]{5(9\text{,}443+1\text{,}053\sqrt{41})}35]\right)\\ =& 0.201824\dots .\end{array}
Also, \overline{u}(t)<0 for t=\gamma +\u03f5 with \u03f5\in {\mathbb{R}}^{+} sufficiently small. Furthermore, the solution is periodic of period 2\pi /3 (see Figure 1).
If we use Lemma 3.2, we find that, a priori, \overline{u} is nonpositive on [4/15,0] which we know is true by the study we have done of \overline{u}, but this estimate is, as expected, far from the interval [\gamma 1,0] in which \overline{u} is nonpositive. This does not contradict the optimality of the a priori estimate, as we have showed before, some other examples could be found for which the interval where the solution has constant is arbitrarily close to the one given by the a priori estimate.
3.2 The case (C2)
We study here the case (C2). In this case, it is clear that
G(t,s)=[cosh(\omega (st))+\frac{b}{\omega}sinh(\omega (st))]{\chi}_{0}^{t}(s)+\frac{a}{\omega}sinh(\omega (s+t)){\chi}_{t}^{0}(s),
which we can rewrite as
Studying the expression of G we can obtain maximum and antimaximum principles. With this information, we can state the following lemma.
Lemma 3.3
Assume
{a}^{2}<{b}^{2}
and define
\sigma (a,b):=\frac{1}{\sqrt{{b}^{2}{a}^{2}}}arctanh\frac{\sqrt{{b}^{2}{a}^{2}}}{b}.
Then we have the following:

ifa>0, the Green’s function of problem (2.5) is positive on\{(t,s),t<s<0\}and\{(t,s),0<s<t\},

ifa<0, the Green’s function of problem (2.5) is negative on\{(t,s),t<s<0\}and\{(t,s),0<s<t\},

ifb>0, the Green’s function of problem (2.5) is negative on\{(t,s),t<s<0\},

ifb>0, the Green’s function of problem (2.5) is positive on\{(t,s),0<s<t\}if and only ift\in (0,\sigma (a,b)),

ifb<0, the Green’s function of problem (2.5) is positive on\{(t,s),0<s<t\},

ifb<0, the Green’s function of problem (2.5) is negative on\{(t,s),t<s<0\}if and only ift\in (\sigma (a,b),0).
Proof For 0<a<b, he argument of the sinh in (3.1d) is negative, so (3.2d) is positive. The argument of the sinh in (3.1c) is positive, so (3.2c) is positive. It is easy to check that (3.2a) is positive as long as t<\sigma (a,b).
On the other hand, (3.2b) is always negative.
The rest of the proof continues similarly. □
As a corollary of the previous result we obtain the following one.
Lemma 3.4 Assume {a}^{2}<{b}^{2}. Then we have the following.

if0<a<b, the Green’s function of problem (2.5) is nonnegative on[0,\sigma (a,b)]\times \mathbb{R},

ifb<a<0, the Green’s function of problem (2.5) is nonnegative on[0,+\mathrm{\infty})\times \mathbb{R},

ifb<a<0, the Green’s function of problem (2.5) is nonpositive on[\sigma (a,b),0]\times \mathbb{R},

ifb>a>0, the Green’s function of problem (2.5) is nonpositive on(\mathrm{\infty},0]\times \mathbb{R},

the Green’s function of problem (2.5) changes sign in any other strip not a subset of the aforementioned.
Example 3.2 Consider the problem
{x}^{\prime}(t)+\lambda x(t)+2\lambda x(t)={e}^{t},\phantom{\rule{2em}{0ex}}x(1)=c
(3.3)
with \lambda >0.
Clearly, we are in the case (C2),
\sigma (\lambda ,2\lambda )=\frac{1}{\lambda \sqrt{3}}ln[7+4\sqrt{3}]=\frac{1}{\lambda}\cdot 1.52069\dots .
If \lambda \ne 1/\sqrt{3}, then
\begin{array}{r}\overline{u}(t):={\int}_{0}^{t}[cosh(\lambda \sqrt{3}(st))+\frac{2}{\sqrt{3}}sinh(\lambda \sqrt{3}(st))]{e}^{s}\phantom{\rule{0.2em}{0ex}}\mathrm{d}s\\ \phantom{\overline{u}(t):=}+\frac{1}{\sqrt{3}}{\int}_{t}^{0}sinh(\omega (s+t)){e}^{s}\phantom{\rule{0.2em}{0ex}}\mathrm{d}s\\ \phantom{\overline{u}(t)}=\frac{1}{3{\lambda}^{2}1}[(\lambda 1)(\sqrt{3}sinh(\sqrt{3}\lambda t)cosh(\sqrt{3}\lambda t))+(2\lambda 1){e}^{t}\lambda {e}^{t}],\\ \tilde{u}(t)=cosh(\lambda \sqrt{3}t)\sqrt{3}sinh(\lambda \sqrt{3}t).\end{array}
With these equalities, it is straightforward to construct the unique solution w of problem (3.3). For instance, in the case \lambda =c=1,
and
w(t)=sinht+\frac{1sinh1}{cosh(\lambda \sqrt{3})\sqrt{3}sinh(\lambda \sqrt{3})}(cosh(\lambda \sqrt{3}t)\sqrt{3}sinh(\lambda \sqrt{3}t)).
Observe that for \lambda =1, c=sinh1, w(t)=sinht. Lemma 3.4 guarantees the nonnegativity of w on [0,1.52069\dots ], but it is clear that the solution w is positive on the whole positive real line.
3.3 The case (C3)
We study here the case (C3) for a=b. In this case, it is clear that
G(t,s)=[1+a(st)]{\chi}_{0}^{t}(s)+a(s+t){\chi}_{t}^{0}(s),
which we can rewrite as
G(t,s)=\{\begin{array}{cc}1+a(st),\hfill & 0\le s\le t,\hfill \\ 1a(st),\hfill & t\le s\le 0,\hfill \\ a(s+t),\hfill & t\le s\le 0,\hfill \\ a(s+t),\hfill & 0\le s\le t,\hfill \\ 0,\hfill & \text{otherwise}.\hfill \end{array}
Studying the expression of G we can obtain maximum and antimaximum principles. With this information, we can prove the following lemma as we did with the analogous ones for cases (C1) and (C2).
Lemma 3.5 Assume a=b. Then, if a>0, the Green’s function of problem (2.5) is

positive on\{(t,s),t<s<0\}and\{(t,s),0<s<t\},

negative on\{(t,s),t<s<0\},

positive on\{(t,s),0<s<t\}if and only ift\in (0,1/a),
and, if a<0, the Green’s function of problem (2.5) is

negative on\{(t,s),t<s<0\}and\{(t,s),0<s<t\},

positive on\{(t,s),0<s<t\},

negative on\{(t,s),t<s<0\}if and only ift\in (1/a,0).
As a corollary of the previous result we obtain the following one.
Lemma 3.6 Assume a=b. Then we have the following:

if0<a, the Green’s function of problem (2.5) is nonnegative on[0,1/a]\times \mathbb{R},

ifa<0, the Green’s function of problem (2.5) is nonpositive on[1/a,0]\times \mathbb{R},

the Green’s function of problem (2.5) changes sign in any other strip not a subset of the aforementioned.
For this particular case we have another way of computing the solution to the problem.
Proposition 3.7 Let a=b and assume 2a{t}_{0}\ne 1. Let H(t):={\int}_{{t}_{0}}^{t}h(s)\phantom{\rule{0.2em}{0ex}}\mathrm{d}s and \mathcal{H}(t):={\int}_{{t}_{0}}^{t}H(s)\phantom{\rule{0.2em}{0ex}}\mathrm{d}s. Then problem (2.5) has a unique solution given by
u(t)=H(t)2a{\mathcal{H}}_{o}(t)+\frac{2at1}{2a{t}_{0}1}c.
Proof The equation is satisfied, since
\begin{array}{rcl}{u}^{\prime}(t)+a(u(t)+u(t))& =& {u}^{\prime}(t)+2a{u}_{e}(t)\\ =& h(t)2a{H}_{e}(t)+\frac{2ac}{2a{t}_{0}1}+2a{H}_{e}(t)\frac{2ac}{2a{t}_{0}1}=h(t).\end{array}
The initial condition is also satisfied for, clearly, u({t}_{0})=c. □
Example 3.3 Consider the problem {x}^{\prime}(t)+\lambda (x(t)x(t))={t}^{p}, x(0)=1 for \lambda ,p\in \mathbb{R}, p>1. For p\in (1,0) we have a singularity at 0. We can apply the theory in order to get the solution
u(t)=\frac{1}{p+1}t{t}^{p}+12\lambda t,
where \overline{u}(t)=\frac{1}{p+1}t{t}^{p} and \tilde{u}(t)=12\lambda t. \overline{u} is positive in (0,+\mathrm{\infty}) and negative in (\mathrm{\infty},0) independently of λ, so the solution has better properties than the ones guaranteed by Lemma 3.6.
The next example shows that the estimate is sharp.
Example 3.4 Consider the problem
{u}_{\u03f5}^{\prime}(t)+{u}_{\u03f5}(t)+{u}_{\u03f5}(t)={h}_{\u03f5}(t),\phantom{\rule{1em}{0ex}}t\in \mathbb{R};\phantom{\rule{2em}{0ex}}{u}_{\u03f5}(0)=0,
(3.4)
where \u03f5\in \mathbb{R}, {h}_{\u03f5}(t)=12x(\u03f5x){\chi}_{[0,\u03f5]}(x) and {\chi}_{[0,\u03f5]} is the characteristic function of the interval [0,\u03f5]. Observe that {h}_{\u03f5} is continuous. By means of the expression of the Green’s function for problem (3.4), we see that its unique solution is given by
{u}_{\u03f5}(t)=\{\begin{array}{cc}2{\u03f5}^{3}t{\u03f5}^{4},\hfill & \text{if}t\u03f5,\hfill \\ {t}^{4}2\u03f5{t}^{3},\hfill & \text{if}\u03f5t0,\hfill \\ {t}^{4}(4+2\u03f5){t}^{3}+6\u03f5{t}^{2},\hfill & \text{if}0t\u03f5,\hfill \\ 2{\u03f5}^{3}t+2{\u03f5}^{3}+{\u03f5}^{4},\hfill & \text{if}t\u03f5.\hfill \end{array}
The a priori estimate on the solution tells us that {u}_{\u03f5} is nonnegative at least in [0,1]. Studying the function {u}_{\u03f5} (see Figure 2), it is easy to check that {u}_{\u03f5} is zero at 0 and 1+\u03f5/2, positive in (\mathrm{\infty},1+\u03f5/2)\mathrm{\setminus}\{0\} and negative in (1+\u03f5/2,+\mathrm{\infty}).
The case (C3.2) is very similar,
G(t,s)=\{\begin{array}{cc}1+a(ts),\hfill & 0\le s\le t,\hfill \\ 1a(ts),\hfill & t\le s\le 0,\hfill \\ a(s+t),\hfill & t\le s\le 0,\hfill \\ a(s+t),\hfill & 0\le s\le t,\hfill \\ 0,\hfill & \text{otherwise}.\hfill \end{array}
Lemma 3.8 Assume a=b. Then, if a>0, the Green’s function of problem (2.5) is

positive on\{(t,s),t<s<0\}, \{(t,s),0<s<t\}and\{(t,s),0<s<t\},

negative on\{(t,s),t<s<0\}if and only ift\in (1/a,0),
and, if a>0, the Green’s function of problem (2.5) is

negative on\{(t,s),t<s<0\}, \{(t,s),t<s<0\}and\{(t,s),0<s<t\},

positive on\{(t,s),0<s<t\}if and only ift\in (0,1/a).
As a corollary of the previous result we obtain the following one.
Lemma 3.9 Assume a=b. Then we have the following:

ifa>0, the Green’s function of problem (2.5) is nonnegative on[0,+\mathrm{\infty})\times \mathbb{R},

ifa<0the Green’s function of problem (2.5) is nonpositive on(\mathrm{\infty},0]\times \mathbb{R},

the Green’s function of problem (2.5) changes sign in any other strip not a subset of the aforementioned.
Again, for this particular case we have another way of computing the solution to the problem.
Proposition 3.10 Let a=b, H(t):={\int}_{0}^{t}h(s)\phantom{\rule{0.2em}{0ex}}\mathrm{d}s and \mathcal{H}(t):={\int}_{0}^{t}H(s)\phantom{\rule{0.2em}{0ex}}\mathrm{d}s. Then problem (2.5) has a unique solution given by
u(t)=H(t)H({t}_{0})2a({\mathcal{H}}_{e}(t){\mathcal{H}}_{e}({t}_{0}))+c.
Proof The equation is satisfied, since
{u}^{\prime}(t)+a(u(t)u(t))={u}^{\prime}(t)+2a{u}_{o}(t)=h(t)2a{H}_{o}(t)+2a{H}_{o}(t)=h(t).
The initial condition is also satisfied for, clearly, u({t}_{0})=c. □
Example 3.5 Consider the problem
{x}^{\prime}(t)+\lambda (x(t)x(t))=\frac{\lambda {t}^{2}2t+\lambda}{{(1+{t}^{2})}^{2}},\phantom{\rule{2em}{0ex}}x(0)=\lambda
for \lambda \in \mathbb{R}. We can apply the theory in order to get the solution
u(t)=\frac{1}{1+{t}^{2}}+\lambda (1+2\lambda t)arctant{\lambda}^{2}ln(1+{t}^{2})+\lambda 1,
where \overline{u}(t)=\frac{1}{1+{t}^{2}}+\lambda (1+2\lambda t)arctant{\lambda}^{2}ln(1+{t}^{2})1.
Observe that the real function
h(t):=\frac{\lambda {t}^{2}2t+\lambda}{{(1+{t}^{2})}^{2}}
is positive on ℝ if \lambda >1 and negative on ℝ for all \lambda <1. Therefore, Lemma 3.9 guarantees that \overline{u} will be positive on (0,\mathrm{\infty}) for \lambda >1 and in (\mathrm{\infty},0) when \lambda <1.