How to obtain the Lyapunov candidate of this system I have been trying to find a suitable Lyapunov function for this system
$\dot{x_{1}} = \sin(x_{2})$
$\dot{x_{2}} = -x_{1}-x_{2}$
As can be noted it has multiple equilibrium points:
Equilibrium Points: $(-n\pi,n\pi)$ where $n = ... -2,-1, 0,+1,+2 ...$
When n is even the equilibrium point is stable focus, but when odd the equilibrium point is a saddle.
I tried this:
$V = x^{T}Px + (1-\cos(x_{2}))$
For V to be positive definite we need $P_{11}+P_{12} >0$ and $P_{11}P_{22}-(P_{12})^{2}>0$, where $P$ is a $2\times 2$ symmetric matrix ($P_{12} = P_{21}$). The time derivative of Lyapunov candidate is:
$$ \dot{V} = \dot{x_{1}}x_{1}P_{11} + \dot{x_{2}}x_{1}P_{12} + \dot{x_{1}}x_{2}P_{12} + \dot{x_{2}}x_{2}P_{22} + \dot{x_{2}} \sin(x_{2})  $$
By solving I get to the point:
$ \dot{V} = (-P_{12} - P_{22})x_{1}x_{2} - P_{12}x_{1}^{2} - P_{22}x_{2}^{2} + (P_{12} -1)x_{2}sin(x_{2}) +(P_{11} -1)x_{1}\sin(x_{2}) $
In this point I tried to make:
$$-P_{12}-P_{22} = 0\longrightarrow P_{12} = -P_{22}\tag1$$
$$P_{11} -1 =0 \tag2$$
And we also assume that:
$$P_{12}>0\tag3$$
$$P_{22}>0 \tag4$$
$$P_{12}-1 <0\longrightarrow P_{12}<1\tag5$$
So we can guarantee that $\dot{V}$ is negative definite in the domain $-\pi<x_{2}<\pi$. But the problem manifests here. If we are suppose to satisfy $(5)$ and $(3)$ we obtain that:
$$0<P_{12}<1$$
If I assign $P_{12} = 0.5$ from $(1)$ we can say that $P_{22} = -0.5$ but this value does satisfy $(4)$ and this is my MAIN issue with this. I don't know I my math went wrong, or if I just went trough the wrong process, the process I used for this exercise was similar to the process one can follow to obtain a Lyapunov function that guarantee asymptotic stability for a pendulum with friction problem, but it is not working for me.
 A: Your first constraint from $(1)$, that $P_{12} = -P_{22}$, it not necessary. If we still set $P_{11}=1$ and $P_{12}=1/2$ yields
$$
\dot{V} = -\frac{1}{2} x^\top
\underbrace{
\begin{bmatrix}
1 & \frac{1}{2}+P_{22} \\
\frac{1}{2}+P_{22} & 2\,P_{22}
\end{bmatrix}
}_Q x - \frac{1}{2}x_2\,\sin(x_2). \tag{1}
$$
The matrix $Q$ can only be made positive semi-definite when $P_{22} = 1/2$, which simplifies $(1)$ to
$$
\dot{V} = -\frac{1}{2} (x_1 + x_2)^2 - \frac{1}{2}x_2\,\sin(x_2), \tag{2}
$$
which is negative definite for $-\pi < x_2 < \pi$.

Another option is to make all non-polynomial terms of the time derivative of the Lyapunov function zero, which can be done using $P_{11}=P_{12}=1$. This only enables you to get a negative semi-definite result at best when using $P_{22}=1$, yielding
$$
\dot{V} = -(x_1 + x_2)^2. \tag{3}
$$
Using LaSalle's invariance principle you can still show that all initial conditions converge to one of the equilibria (though, this does not show that most initial conditions converge to the stable equilibria with even $n$).
