Show the dynamical system $\ddot x +f\dot x + gx=0$ can be written in the form$\vec {\dot x}=A\vec x$ I am given the dynamical system $\ddot x +f\dot x + gx=0$ and told that $f,g$ are constants.
I am asked to write it in the form $\vec {\dot x}=A\vec x$ and told that $\vec x = (x,z)$ where $z = a\dot x + bx$ and $a,b$ are also constants with $a \neq 0$, also that $A$ is a constant matrix which needs to be determined. 
One way I thought I could do, to determine $A$, was to set $z_1 = x$ and $z_2= \dot x$. This leads to equations 
$\dot z_1 = \dot x = z_2$ and $\dot z_2 = \ddot x = -f \dot x - gx = -fz_2 - gz_1$
this would lead me to a matrix $A$ = $$
        \begin{matrix}
        0 & 1  \\
        -g & -f   \\
        \end{matrix}
$$
But I don't think this is correct. Any hints would be very helpful. Thanks
 A: you shouldn't introduce some new variables $z_1,z_2$ as they already give you the transformation
$$
x=x; \quad z=a\dot x+b x
$$
Then the equations in those variables are,
$$
\dot x=\frac{1}{a}(z-b x)
$$
which is obtained just by solving for $\dot x$ in the definiton of $z$. And $$
\dot z=a\ddot x+b\dot x=a(-f\dot x-gx)+b\dot x=(-af+b)\frac{1}{a}(z-b x)-agx=(fb-ga-b^2/a)x+(b/a-f)z
$$
Where I replaced (using the differential equation) $\ddot x=-f\dot x-gx$. Then the matrix $A$ is
$$
\left(\begin{array}{cc}-\frac{b}{a}&\frac{1}{a}\\fb-ga-b^2/a&b/a-f\end{array}\right)
$$
You should note $a\neq0$ is necessary for $x,z$ to be a change of coordinates, otherwise you wouldn't be able to express $x,\dot x$ as a function of $x,z$.
A: Let
$$
z=\left(\begin{array}{c}x\\\dot{x}\end{array}\right).
$$
Then
$$
\dot{z}=\left(\begin{array}{c}\dot{x}\\\ddot{x}\end{array}\right)=\left(\begin{array}{c}\dot{x}\\-f\dot{x}-gx\end{array}\right)=\underbrace{\begin{pmatrix}0&1\\-g&-f\end{pmatrix}}_{A}\left(\begin{array}{c}x\\\dot{x}\end{array}\right)=Az
$$
