6
$\begingroup$

$$\text{Apart}\left[\frac{1}{x^4+1}\right]$$

Does nothing. How can I get it to expand it. Sometimes it is useful.

$\endgroup$
6
  • $\begingroup$ See this question: 68824. $\endgroup$
    – Mahdi
    Jun 22, 2015 at 17:47
  • $\begingroup$ @Mahdi $$\text{Apart}\left[\text{Factor}\left[\frac{1}{x^4+1},\text{Extension}\to i\right]\right]$$ gives only $$\frac{i}{2 \left(x^2+i\right)}-\frac{i}{2 \left(x^2-i\right)}$$ and $$\text{Apart}\left[\text{Factor}\left[\frac{1}{x^4+2},\text{Extension}\to i\right]\right]$$ straight up does not work $\endgroup$ Jun 22, 2015 at 17:56
  • $\begingroup$ What is expected result for the first one? For the second one: Apart@Factor[1/(1 + x^2), Extension -> {(-1)^(1/2), I}]? $\endgroup$
    – Mahdi
    Jun 22, 2015 at 18:05
  • 1
    $\begingroup$ Your question is a partial case of the Mittag-Leffler's theorem for the expansion of meromorphic functions. There is a nice demo here. $\endgroup$
    – yarchik
    Sep 27, 2020 at 15:47
  • 3
    $\begingroup$ Does this answer your question? Apart for complex roots? $\endgroup$
    – Michael E2
    May 25, 2022 at 15:46

2 Answers 2

8
$\begingroup$

I found by trial and error that Extension-> Sqrt[I] does the job.

ExpToTrig[Apart[Factor[1/(1 + x^4), Extension -> Sqrt[I]]]]

$$\frac{\frac{1}{4}+\frac{i}{4}}{\sqrt{2} \left(-x+\frac{1+i}{\sqrt{2}}\right)}+\frac{\frac{1}{4}+\frac{i}{4}}{\sqrt{2} \left(x+\frac{1+i}{\sqrt{2}}\right)}-\frac{\frac{1}{4}-\frac{i}{4}}{\sqrt{2} \left(-x-\frac{1-i}{\sqrt{2}}\right)}-\frac{\frac{1}{4}-\frac{i}{4}}{\sqrt{2} \left(x-\frac{1-i}{\sqrt{2}}\right)}$$

Here ExpToTrig is not really required but it does the final beautifying.

$\endgroup$
4
  • $\begingroup$ would there be any way to do something like: ExpToTrig[ Apart[Factor[1/(1 + x^4), Extension -> Roots[1 + x^4 == 0, x]]]] $\endgroup$ Jun 22, 2015 at 18:27
  • $\begingroup$ @grdgfgr How about ExpToTrig[Apart[Factor[1/(1 + x^4), Extension -> (x /. Solve[1 + x^4 == 0, x])]]]? $\endgroup$
    – kirma
    Jun 22, 2015 at 18:36
  • $\begingroup$ @ kirma : that seems to be the general rule setting the Extension to the roots of the polynomial in question. From Help: Extension is an option for various polynomial and algebraic functions that specifies generators for the algebraic number field to be used. $\endgroup$ Jun 22, 2015 at 19:43
  • $\begingroup$ @GappyHilmore Apart[Factor[1/(1 + x^4), Extension -> All]] works and so does Apart[Factor[1/(2 + x^4), Extension -> All]] (in V13 but maybe it didn't back then). $\endgroup$
    – Michael E2
    May 5, 2022 at 13:37
3
$\begingroup$

There's an internal function:

Integrate`ComplexApart[1/(1 + x^4), x]
(*
-((-1)^(1/4)/(4 (-(-1)^(1/4) + x))) +
 (-1)^(1/4)/(4 ((-1)^(1/4) + x)) -
 (-1)^(3/4)/(4 (-(-1)^(3/4) + x)) +
 (-1)^(3/4)/(4 ((-1)^(3/4) + x))
*)
$\endgroup$
2
  • $\begingroup$ fyi, in Maple they have 2 functions. parfrac and fullparfrac for using complex domain. screen shot !Mathematica graphics It looks like fullparfrac is like ComplexApart you show. $\endgroup$
    – Nasser
    May 5, 2022 at 8:13
  • $\begingroup$ @Nasser With so many top-level (System) functions in Mathematica, you would think ComplexApart would be among them. $\endgroup$
    – Michael E2
    May 5, 2022 at 13:33

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.