       Re: Factor[1+x^4]

• To: mathgroup at smc.vnet.net
• Subject: [mg26889] Re: Factor[1+x^4]
• From: paradaxiom at my-deja.com
• Date: Fri, 26 Jan 2001 01:27:32 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```By default Factor[] factors over integers. If you want Factor[]
to factor into Sqrt and I you have to give this to the
Extension option:

In:= f = Factor[1 + z^4, Extension -> {I, Sqrt}]

Out= (1/4)*(Sqrt - (1 + I)*z)*
(Sqrt - (1 - I)*z)*
(Sqrt + (1 - I)*z)*
(Sqrt + (1 + I)*z)

In:= Expand[f]

Out= 1 + z^4

Of course, in general you don't know what Extension to pick beforehand.
So one thing you can do is the following:

In:= poly = 1 + z^4

Out= 1 + z^4

The find the extension you want by looking at the roots of the
polynomial:

In:= extension[poly_, z_] :=
ComplexExpand[
Roots[poly == 0, z] /. {_ == a_ -> a} /. {Or -> List}
]

In:= extension[poly, z]

Out= {(1 + I)/Sqrt,
-((1 - I)/Sqrt),
-((1 + I)/Sqrt),
(1 - I)/Sqrt}

In:= Factor[poly, Extension -> extension[poly, z]]

Out= (1/4)*(Sqrt - (1 + I)*z)*
(Sqrt - (1 - I)*z)*
(Sqrt + (1 - I)*z)*
(Sqrt + (1 + I)*z)

I hope this helps a bit. Perhaps someone knows a better way to