Problem in selection of state variables of inverted pendulum
The number of states is a direct correspondence to the order of a system.
Referencing wikipedia, the inverted pendulum angle \$\theta(t)\$ has the following second order differential equation:
$$
\frac{d^2\theta(t)}{dt^2}=\frac{g}{l}\sin(\theta(t))
$$
For a state-space description, this second-order differential equation would be split in two first-order differential equations. One way to do would be with the following &quot;state choices&quot; (aka &quot;realization&quot;), as used in the question example:
$$
x_1 = \theta(t)\\
x_2 = \frac{d\theta(t)}{dt} = \omega(t)
$$
The first order differential of these states result in:
$$
\dot x_1 = x_2 \\
\dot x_2 = \frac{g}{l}\sin(x_1)
$$
You have now described a second order system using two state variables, such states can be used for state feedback. Be aware the inverted pendulum is a nonlinear system, so you can't find a \$\dot x=Ax\$ (where \$A\$ is not dependant on \$x\$) notation for this system.