Continued Fractions Approximation I have come across continued fractions approximation but I am unsure what the steps are. 
For example How would you express the following rational function in continued-fraction form:
$${x^2+3x+2 \over x^2-x+1}$$

This might be what you are looking for:
$$
\begin{align}
\frac{x^2+3x+2}{x^2-x+1}
&=1+\cfrac{4x+1}{x^2-x+1}\\[4pt]
&=1+\cfrac1{\frac14x-\frac5{16}+\cfrac{\frac{21}{16}}{4x+1}}\\[4pt]
&=1+\cfrac1{\frac14x-\frac5{16}+\cfrac1{\frac{64}{21}x+\frac{16}{21}}}
\end{align}
$$
At each stage, we are doing a polynomial division instead of an integer division, but otherwise, the process is the same as with continued fractions with integers.
We can get the Bezout polynomials by truncating the continued fraction:
$$
1+\cfrac1{\frac14x-\frac5{16}}=\frac{4x+11}{4x-5}
$$
That is, we can write the polynomial GCD (a constant since they are relatively prime) as
$$
(4x+11)(x^2-x+1)-(4x-5)(x^2+3x+2)=21
$$
