Clarification on the "Comparison Principle" Found in Chapter 3 of Nonlinear Systems by Hassan K. Khalil (Details in Body) In the book the following Lemma is given (Lemma 3.4, Comparison Lemma):

Consider the the scalar differential equation
  $$\dot u =f(t,u), \qquad u(t_0)=u_0$$
  where $f(t,u)$ is continuous in $t$ and locally Lipschitz in $u$, for all $t \geq 0$ and all $u \in J \subset R$. Let $[t_0,T)$ ($T$ could be infinity) be the maximal interval of existence of the solution $u(t)$, and suppose $u(t) \in J$ for all $t \in [t_0,T)$. Let $v(t)$ be a continuous function whose upper right hand derivative $D^+v(t)$ satisfies the differential inequality
  $$D^+v(t) \leq f(t,v(t)),\qquad v(t_0) \leq u_0$$
  with $v(t) \in J$ for all $t \in [t_0,T)$. Then, $v(t) \leq u(t)$ for all $t \in [t_0,T)$.

Following this is an example (example 3.8):

The scalar differential equation
  $$\dot x =f(x) = -(1+x^2)x, \qquad x(0)=a$$
  has a unique solution on $[0,t_1)$, for some $t_1>0$, because $f(x)$ is locally Lipschitz. Let $v(t)=x^2(t)$. The function $v(t)$ is differentiable and its derivative is given by
  $$\dot v(t)=2x(t) \dot x(t)=-2x^2(t)-2x^4(t) \leq -2x^2(t)$$
  ...

This example then continues, but my confusion is on the last line where the book says $f(t,v(t)) = -2x^2(t)$ for the inequality. This doesn't make sense to me. I have been trying to figure this out for several hours now and haven't made any progress. I thought you'd simply substitute $x^2(t)$ into $f(x)=-(1+x^2)x$ given that $D^+v(t) \leq f(t,v(t))$ from the lemma. 
Obviously I'm missing something in my understanding...
Edit: here is a link to a .pdf see page 102-103
 A: The function $f$ in the comparison lemma is not the same $f$ as in the example with the ODE $\dot x =-(1+x^2)x$. I think that from here stems the confusion. From the choice of the Lyapunov function $V=x^2$ it should be clear that $\dot V=2x\dot x\leq-2x^2$. That is,  $\dot V\leq -2V$. So regarding the lemma, setting $V=:u$, we have $\dot u= \Xi(u)$ with $\Xi=-2x^2=-2V$. Or the same with $\Xi =:f$ when using the same notation of the lemma.
A: If you want to apply the theorem to the example, then the "named" ODE function for the cited lemma is $u'=f(t,u)=-2u$.
This is then compared to the example ODE that is to be analyzed by providing a bound. With the change of variables $v=x^2$ one gets a compatible form
$$
v'=2xx'=-2x^2(1+x^2)=-2v-2v^2=g(t,v).
$$
Now we get indeed for solutions of this ODE
$$v'=g(t,v)\le f(t,v),$$ as $-2v^2\le 0$.
In consequence, the unknown solution $v$ is bounded by the known solution with the same initial value $$v(t)\le u(t)=v(0)e^{-2t},\\~\\ |x(t)|\le|x(0)|e^{-t}.$$

Remark: the equation for $v$ is also directly solvable as Bernoulli equation, $$(v^{-1})'=-v^{-2}v'=2(v^{-1})+2,$$ so that $$v(t)^{-1}+1=(v(0)^{-1}+1)e^{2t},$$ and solving that for $v$
$$
v(t)=\frac{v(0)e^{-2t}}{1+v(0)(1-e^{-2t})}=v(0)e^{-2t}-\frac{v(0)^2e^{-2t}(1-e^{-2t})}{1+v(0)(1-e^{-2t})}.
$$
which is indeed, for $t> 0$, smaller than $u(t)$.
