Asymptotic behaviour of quantity related to an ODE Consider the differential equation
$$u''(t) + u(t) + u^3(t) = f(t) u(t) + g(t),\,\, u(0) = u_0, \,u'(0) = u_1$$
where $u :\mathbb{R}^+ \to \mathbb{R}$ is a bounded solution  and $f, g: \mathbb{R}^+ \to \mathbb{R}$ are given continuous functions such that $$\lim_{t\to \infty} f(t) = \lim_{t\to \infty} g(t) = 0.$$
Define the quantity $E(t) := \frac 12 (u(t))^2 +\frac 12 (u'(t))^2 + \frac 14 (u(t))^4.$
I want to study the asymptotic of $E$ when $t \to \infty.$  First, I considered many examples for $f, g$ using mathematica (See the attached images where I plotted $t\mapsto E(t)$). I'm interested in the case where
$\liminf_{t\to \infty}E(t) >0$ or roughly $\lim_{t\to \infty} E(t) >0.$ I wonder if this is the general case or it depends on the initial values $u_0, u_1$ and $f,g.$ In all the examples that I tested numerically, I found that $\lim_{t\to \infty} E(t) >0.$
My attempt started by differentiating $E$ with respect to $t.$ It seems that in the case where
$u'$ is bounded, we have $$\lim_{t\to \infty} E'(t) =0,$$
since $E' = (f u + g) u'.$ But this does not imply necessarily that $\lim_{t\to \infty}E(t) >0.$
The limit might be zero.
Thank you for any hint.


 A: In order for the system to be well-behaved a sufficient condition is that $f$ and $g$ are integrable at infinity.
Consider some uniform bounds of the RHS in terms of the energy functional (a standard trick): The $f$ term behaves the best. By Cauchy-Schwarz you have $|uu'|\leq E$ whereas for the $g$ term you only have $|u'|\leq \sqrt{2 E}$. We thus get the crude bound:
$$ |E'| \leq |f| E + |g| \sqrt{2E}$$.
A special case is $g\equiv 0$ for which we get (use e.g. a Gronwall Lemma):
$$ |\log(E(\infty)) - \log(E(0)) | \leq \int_0^\infty |f(t)|dt.$$
In this case it suffices that $f$ is integrable in order for
$\lim_{t \rightarrow \infty}  E(t)$ to exist and be strictly positive.
When $g$ does not vanish you may put e.g. $E=\frac12 A^2$  which yields (as long as $A>0$):
$$ |A'| \leq \frac12 |f| A + |g| $$
When e.g. $f$ and $g$ are integrable then also in this case the  system never explodes (use again a Gronwall Lemma) and will have a finite limit  which, however, may be zero. You may also from this get conditions on initial values of $A$ which when large enough compared to the $L^1$ norm of $f,g$ give lower bounds that assures that the limit is strictly positive. For example, a sufficient condition is that
$$ A(0) \ (1 - \frac12 \|f\|_1) > \|g\|_1 $$
A: If $\;t\to\infty,\;$ then the given ODE takes the form of
$$\ddot u+u+u^3 =0,\tag1$$
which does not contain variable $\;t.\;$
Substitution $\;P=\dot u,\;\ddot u = P'_u\, \dot u = P\,\dfrac{\text dP}{\text du},\;$ presents $(1)$ in the form of
$$P\,\text dP = -(u^3+u)\,\text du,$$
$$P=\dfrac12\sqrt{(a^2+1)^2-(u^2+1)^2},$$
$$\dfrac{\text du}{\sqrt{a^2-u^2}} = \sqrt{2+a^2+u^2},\tag2$$
and after substitutiion
$$v=\arcsin \dfrac ua$$
one can get
$$\text dv = \sqrt{2+a^2(1+\sin^2 v)}\,\text dt,$$
with the solutions
$$v(t) = \text{am}\left(\sqrt{a^2+2}\,(t+b)\bigg|\dfrac{a^2}{2+a^2}\right)$$
and
$$u(t) = a \text{ sn}\left(\sqrt{a^2+2}\,(t+b)\bigg|\dfrac{a^2}{2+a^2}\right),\tag3$$
where $\;\text{am}\;$ and $\;\text{sn}\;$ are the Jacobi functions.
The Jacobi functions looks too heavy for applying of the constant variations method.
Taking in account derivatives
\begin{cases}
\left(\text{sn}(x|m)\right)' = \text{cn}(x|m)\text{ dn}(x|m)\\[4pt]
\left(\text{cn}(x|m)\right)' = -\text{sn}(x|m)\text{ dn}(x|m)\\[4pt]
\left(\text{dn}(x|m)\right)' = -m\text{ sn}(x|m)\text{ cn}(x|m),
\end{cases}
looks possible to find parameters $\;a\;$ and $\;b\;$ for the given functions $\;f(t)\;$ and $\;g(t)\;$ numerically, using the next statement:

*

*$E(t) = \dfrac14(2u'^2+u^4+2u^2) \ge 0,$

*$E(0) = \dfrac14(2u_1^2+u_0^4+2u_0^2),$

*$E'(\infty) = 0,$

*$E(\infty) = E(0)+\int\limits_0^\infty(uf+g)\,\text dt.$
A: I'd be grateful if you give more explicit details about the decaying force in the harmonic oscillator
You can do it as I said or you can do it in an even simpler way and put $f=0$, $g=u^3-u'$ (effectively eliminating the non-linear term and adding the damping). Then you just have a linear equation $u''+u'+u=0$, which has an exponentially decaying solution, so your $g$, indeed, tends to $0$ at infinity. The more interesting question seems to be
Is there any pair $f,g$ tending to $0$ at $\infty$ such that all (or, at least, many) solutions decay to $0$ at infinity?
though, perhaps, I'm missing something simple here.
