Find state space model from transfer function
So, assuming that the transfer function is between the output $Y(s)$ and the input $U(s)$, namely
$$
\dfrac{Y(s)}{U(s)} = G(s)\qquad\qquad(1)
$$
multiplying (1) by $U(s)\cdot(s^2-2s+1))$ yields
$$
s^2 Y(s) -2s Y(s) + Y(s) = sU(s) + U(s)
$$
Going back in the time domain we obtain
$$
\ddot y -2\dot y + y = \dot u + u\qquad (2)
$$
Now, we look for a realization of the kind
\begin{align*}
\dot x &amp;= Ax+Bu\qquad (3)\\
y &amp;=Cx
\end{align*}
with $x=(x_1,x_2)$ and
\begin{align*}
A &amp;= \begin{pmatrix}0 &amp; 1\\a_1 &amp; a_2\end{pmatrix} &amp; B&amp;=\begin{pmatrix}0\\1\end{pmatrix}, &amp; C&amp;=\begin{pmatrix}c_1&amp;c_2\end{pmatrix}\end{align*}
The next step is to find the values of $(a_1,a_2,c_1,c_2)$ for which (3) has the same input-output behaviour of (2). From (3) we have
\begin{align*}
 y&amp;=c_1x_1+c_2x_2\\
\dot y&amp;= c_1\dot x_1 + c_2\dot x_2 = c_1x_2 + c_2a_1x_1 + c_2a_2 x_2 + c_2u\\
\ddot y&amp;= c_1\ddot x_1 + c_2\ddot x_2 = c_1a_1x_1+c_1a_2x_2 +c_1u+ c_2a_1x_2+ c_2a_2a_1x_1+c_2a_2^2 x_2 + c_2a_2u + c_2\dot u
\end{align*}
substituting into (2) yields
\begin{align*}
0&amp;=(c_1+c_1a_1+c_2a_2a_1-2c_2a_1)x_1 + (c_2+c_1a_2+c_2a_1+c_2a_2^2-2c_1-2c_2a_2)x_2\\
&amp;+(c_1+a_2c_2-2c_2-1)u + (c_2-1)\dot u
\end{align*}
since that equality must hold for all $(x_1,x_2,u,\dot u)$ that' equivalent to ask
\begin{align*}
c_1+c_1a_1+c_2a_2a_1-2c_2a_1&amp;=0\\c_2+c_1a_2+c_2a_1+c_2a_2^2-2c_1-2c_2a_2&amp;=0\\
c_1+a_2c_2-2c_2-1&amp;=0\\c_2-1&amp;=0
\end{align*}
and a solution is
$$
(a_1,a_2,c_1,c_2)=(-1,2,1,1)
$$
Therefore
\begin{align*}
\begin{pmatrix}\dot x_1\\\dot x_2\end{pmatrix} &amp;=\begin{pmatrix}0&amp;1\\-1&amp;2\end{pmatrix}\begin{pmatrix}x_1\\x_2\end{pmatrix} + \begin{pmatrix}0\\1\end{pmatrix}\\y&amp;=\begin{pmatrix}1&amp;1\end{pmatrix}\begin{pmatrix}x_1\\x_2\end{pmatrix}
\end{align*}