Solve 1 equation and 3 unknowns So I know that I should have infinite solutions when this is the case, but I don't know how to derive the solution without just using some logic and it seems like there should be a way to solve it mathematically (maybe some simple linear algebra?)
$$
s^2 + 2s = b(s^2+3s+2) + a_1(s+2) + a_2
$$
Clearly the only term with an $s^2$ on it it is $b$ and since we only want one $s^2$ we see that $b=1$. Now we need to cancel out one of the $3s$ we got because we only want $2s$ so $a_1$ must be $-1$. Conveniently this canceled out the $2$ for us so $a_2 = 0$.
While this makes sense, I want to use math to solve it.

Alright although the question is already solved I'll provide a little bit more background for the question if future people are curious.
I'm given
$$
G(s) = \begin{bmatrix} \frac{1}{s+1} \\ \frac{1}{(s+1)(s+2)}\end{bmatrix}
$$
$G(s) = C(sI-A)^{-1}B + D$ but in the problme I'm given that $D$ is a vector of zeros, and C is the identity matrix.
My goal was to find A and B that satisfied.
$$
\begin{bmatrix}
\dot x_1 \\
\dot x_2
\end{bmatrix}
=
\begin{bmatrix}
a_1 & a_2 \\
a_3 & a_4
\end{bmatrix}
\begin{bmatrix}
x_1 \\
x_2
\end{bmatrix}
+
\begin{bmatrix}
b_1 \\
b_2
\end{bmatrix}
$$
Given $G(s)$.
 A: Precisely.
All you need to do is expand the RHS and collect like terms: $$b(s^2+3s+2)+a_1(s+2)+a_2=(b)s^2+(3b+a_1)s+(2b+2a_1+a_2)$$ and match co-efficients with the LHS, i.e.: $$\begin{cases} b=1 \\ 3b+a_1=2 \\ 2b+2a_1+a_2=0\end{cases}$$
Which is easily solved for $(b, a_1,a_2)=(1,-1,0)$
A: It is not very clear from the question what is known and what is unknown, but in this answer I presume you want to find $b, a_1, a_2$ such that:
$$s^2 + 2s = b(s^2+3s+2) + a_1(s+2) + a_2$$
as a polynomial in $s$, i.e. that all the coefficients (multiplying the powers of $s$) in the LHS are the same as all the coefficients in the RHS.
For that, re-origanise RHS as a polynomial in $s$:
$$s^2 + 2s +0= \underbrace{b}_1 s^2+\underbrace{(3b+ a_1)}_2 s +\underbrace{(2b+2a_1+ a_2)}_0$$
which yields a system of three equations in three unknowns:
$$\begin{array}{rrrcl}b&&&=&1\\3b&+a_1&&=&2\\2b&+2a_1&+a_2&=&0\end{array}$$
which has a unique solution: $b=1, a_1=-1, a_2=0$.
A: Is the $s$ an unknown variable to solve?
If so there really isn't much to say you have $1$ equation and $4$ unknowns and although you can solve for $s$ with that quadratic equation and have the solution in terms of $a_1, a_2, b$ so long as they are so that the radicand is not negative, there isn't much point as $a_1, a_2, b$ are for all practical purposes unlimited.
(That is to say $s^2(1-b) + (2-3b -a_1)s -a_2 = 0$ so
$s = \frac {3b +a_1-2 \pm \sqrt{(2-3b-a_1)^2 + 4a_2(1-b)}}{2-2b}$
so long as $(2-3b-a_1)^2 + 4a_2(1-b) \ge 0$ and $b\ne 1$ we can have $a_1, a_2, b$ be anything at all)
.....
Or is this supposed to be true for all $s$ no matter what $s$ is?
Then you don't have $1$ equation and $3$ unknowns; you have infinite equations and three unknowns.
So $s=0$ and $a_2 = 0$.
Let $s = 1$ and you have $(1-b) + (2-3b - a_1) = -4b-a_1 + 3 = 0$ so $a_1 = 3-4b$.
Let $s = -1$ and you have $(1-b)-(2-3b -a_1) = 2b +a_1 -1 = 0$ so $a_1 = 1-2b$
So $3-4b = 1-2b$ so $2b = 2$ so $b =1$ and $a_1=3-4 =1-2 = -1$.
....
Saying it true for all $s$ is equivalent so say we have an equation between polynomials.
$s^2 + 2s = b(s^2+3s+2) + a_1(s+2) + a_2$
On the LHS we have the polynomial $P(s) = s^2 + 2s$ and on the RHS we have the polynomial $R(x) = bs^2 + (3b + a_1) s + (2a_1 + 2b + a_2)$
Two say two polynomials are equal is to say 1) the always have the same value for all $s$ OR it is to say 2) the coefficients are equal.
ANd if the coefficients are equal then ... well, then its three equations (one for each coefficient) and $3$ unknowns.
The three equations are
1)$1=b$
2)$2=3b+a_1$
3)$0 = 2a_1 + 2b+a_2$
So $b= 1$ and $2=3+a_1$ so $a_1 = -1$ and $2(-1)+2 + a_2 = 0$ so $a_2 = 0$.
