Factoring a four degree polynomial, newbie question



You need to express the sqrt(2) in your input in terms of q:

ratsubst(q,sqrt(2),p);
  =>   -3*y^3+(q*x^2+q-3)*y^2+(q*x^2-q^3)*y+2*x^2+2

factor(%,q^2-2)
  =>   -(3*y-q*x^2-q)*(y^2+y+q)

It is important to use ratsubst rather than subst here, otherwise (e.g.)
2^(3/2) is not recognized as q^3. Also, subst will substitute in the
exponents, which you don't want.

             -s

On Thu, Jan 21, 2010 at 1:31 PM, gelu precup <geluprecup at yahoo.com> wrote:

> -(3*y^3-sqrt(2)*x^2*y^2-sqrt(2)*y^2+3*y^2-sqrt(2)*x^2*y+2^(3/2)*y-2*x^2-2)
>