0
$\begingroup$

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

enter image description here

Apart[] will get

enter image description here

but I want the following result:

enter image description here

What shall I do?Thanks a lot!

$\endgroup$
2
  • $\begingroup$ Why are there i's in the result? Are those imaginary numbers? $\endgroup$ Commented Oct 4, 2014 at 4:18
  • 2
    $\begingroup$ Please post code, not just images. $\endgroup$
    – Yves Klett
    Commented Oct 4, 2014 at 4:20

1 Answer 1

7
$\begingroup$
expr = 1/(-4 - 2 x + 2 x^2 + 3 x^3 + x^4);

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

enter image description here

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

enter image description here

expr == expr2 // Simplify

True

$\endgroup$
3
  • $\begingroup$ 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? $\endgroup$
    – user20205
    Commented Oct 4, 2014 at 4:50
  • $\begingroup$ Edited my answer to address this case as well. $\endgroup$
    – Bob Hanlon
    Commented Oct 4, 2014 at 5:12
  • $\begingroup$ Very good, Thanks! $\endgroup$
    – user20205
    Commented Oct 4, 2014 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.