6

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

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

Gappy Hilmore
  • 1,253
  • 1
  • 9
  • 17

2 Answers2

8

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.

Dr. Wolfgang Hintze
  • 13,039
  • 17
  • 47
  • would there be any way to do something like: ExpToTrig[ Apart[Factor[1/(1 + x^4), Extension -> Roots[1 + x^4 == 0, x]]]] – Gappy Hilmore Jun 22 '15 at 18:27
  • @grdgfgr How about ExpToTrig[Apart[Factor[1/(1 + x^4), Extension -> (x /. Solve[1 + x^4 == 0, x])]]]? – kirma Jun 22 '15 at 18:36
  • @ 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. – Dr. Wolfgang Hintze Jun 22 '15 at 19:43
  • @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). – Michael E2 May 05 '22 at 13:37
3

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))
*)
Michael E2
  • 235,386
  • 17
  • 334
  • 747
  • 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. – Nasser May 05 '22 at 08:13
  • @Nasser With so many top-level (System) functions in Mathematica, you would think ComplexApart would be among them. – Michael E2 May 05 '22 at 13:33