# Expand a rational function in a one degree partial fraction, but not include a two degree expression?

How can I expand a rational function into a one degree partial fraction, and not include a two degree expression? For example, for

Apart[] will get

but I want the following result:

What shall I do?Thanks a lot!

• Why are there i's in the result? Are those imaginary numbers? Commented Oct 4, 2014 at 4:18
• Please post code, not just images. Commented Oct 4, 2014 at 4:20

expr = 1/(-4 - 2 x + 2 x^2 + 3 x^3 + x^4);

expr2 = Factor[expr, GaussianIntegers -> True] // Apart


expr == expr2 // Simplify


True

If the denominator cannot be factored with integers or Gaussian integers

expr = 1/(x^2 + x + 1);

expr2 = Numerator[expr]/
(Times @@ (x - (x /.
Solve[Denominator[expr] == 0, x]))) //
Apart


expr == expr2 // Simplify


True

• Thanks a lot. But when use Solve[x^2 + x + 1 == 0, x], we can get {{x -> -(-1)^(1/3)}, {x -> (-1)^(2/3)}}, how to directly apart 1/(x^2 + x + 1) to (-1)^(2/3)/(1 + (-1)^(1/3))/(x + (-1)^(1/3)) - (-1)^(2/3)/( 1 + (-1)^(1/3))/(x - (-1)^(2/3)) , that is, the denominators are all one degree? Commented Oct 4, 2014 at 4:50
• Edited my answer to address this case as well. Commented Oct 4, 2014 at 5:12
• Very good, Thanks! Commented Oct 4, 2014 at 7:50