Use "Apart" to split an expression into partial fractions
as in the examples below.

Click anywhere in the cell, then hold the shift key while hitting "Enter" to run the following cell.

Apart[(2*x+1)/(x^2+3*x+2)]

Apart[(x^4+3*x+2*x^2+1)/(x^2+3*x+2)]

or try

Clear[fred];
fred=(x^4+3*x+2*x^2+1)/(x^2+3*x+2);
Apart[fred]