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}$$

Start out writing
$$\frac{x^2+3x+2}{x^2-x+1}=\frac{1}{\frac{(x^2+3x+2)-(4x+1)}{x^2+3x+2}}=\frac{1}{1-\frac{4x+1}{x^2+3x+2}}$$
and then iterate doing the same with the fraction in the denominator.
EDIT: Complete solution:
By polynomial long division we have $\frac{x^2+3x+2}{4x+1}=\frac{x}{4}+\frac{11}{16}+\frac{21}{16}\frac{1}{4x+1}$. Hence the above expression equals
$$\huge
\frac{1}{1-\frac{1}{x/4+11/16+\frac{1}{40x/21+10/21}}}.
$$
