TITLE: How to pick a Lyapunov function and prove stability?
QUESTION [6 upvotes]: I am currently trying to learn how to determine the stability of a solution using Lyapunov's Method for autonomous systems.
Say we are given the nonlinear system:
$$\dot{x_1}(t)=-x_1(t) + x_1(t)x_2(t)$$
$$\dot{x_2}(t)=-x_2(t) $$
And we want to show that the solution $x(t)=0$ is asymptotically stable (I know it is).
We need to pick a Lyapunov function $V(x)$ such that $V(x)$ is positive definite. 
And we need $\dot{V}(x)$ to be negative definite to prove asymptotic stability.
I tried $$V(x)=\frac{1}{2}({x_1}^2 +{x_2}^2)$$
Where
$$\dot{V}(x)={x_1}\dot{x_1}+{x_2}\dot{x_2}=-{x_1}^2 +{x_1}^2{x_2} -{x_2}^2$$
As far as I can tell, in this case $\dot{V}(x)$ is not negative definite. So what am I missing? If $V(x)$ is positive definite & $\dot{V}(x)$ is indefinite, do I need to choose a new Lyapunov function? Or do I have to look at different ranges in $x$ to determine stability (global vs local stability). 
When it comes to selecting Lyapunov functions, how do you know you have a correct function?

REPLY [8 votes]: To my knowledge there is not a general method for finding a Lyapunov function. In this case one can solve the differential equations and use that to find a Lyapunov function. Namely $x_2$ is decoupled from $x_1$ and can be shown to have the following solution
$$
x_2(t) = C_1\,e^{-t},
$$
where $C_1$ is a constant and depends on the initial condition of $x_2$. Substituting the above equation into the expression for $\dot{x}_1$ gives
$$
\dot{x}_1 = x_1 (C_1\,e^{-t} -1)
$$
which is a separable differential equation, namely
$$
\frac{dx_1}{x_1} = (C_1\,e^{-t} -1) dt.
$$
Integrating on both sides gives
$$
\log(x_1) = -C_1\,e^{-t} -t+C_2.
$$
Solving for $x_1$ gives
\begin{align}
x_1(t) &= e^{-C_1\,e^{-t} -t+C_2}, \\ &= C_3\,e^{-C_1\,e^{-t} -t}, \\
&= C_3\,e^{-t}\,e^{-C_1\,e^{-t}},
\end{align}
or when using the definition for $x_2$ then it can also be expressed as $x_1(t)=C_3\,e^{-t}\,e^{-x_2}$. So the quantities $x_2$ and $x_1\,e^{x_2}$ will both decay exponentially fast, so the following Lyapunov function can be used
$$
V(x) = x_2^2 + x_1^2\,e^{2\,x_2},
$$
for which it can be shown that its derivative is
$$
\dot{V}(x) = -2\,x_2^2 - 2\,x_1^2\,e^{2\,x_2}.
$$
I will leave proving that $V(x)$ is radially unbounded to you.