# Factoring multivariate polynomial

I'm trying to factor

$$x^3+x^2y-x^2+2xy+y^2-2x-2y \in \mathbb{Q}[x,y].$$

The hint for the exercise is to use the recursive multivariate polynomial form. So I'm using $\mathbb{Q}[x][y]$:

$$x^3 + x^2(y-1) + x^1(y-2) + x^0(y^2-2y)$$

At this point I am stuck. Are their any general techniques to do this by hand?

-
factoring a quadratic might be easier. the discriminant is a perfect square. – Jack Schmidt Jun 26 '12 at 17:54

Let’s go back to the original polynomial,

$$x^3+x^2y-x^2+2xy+y^2-2x-2y\;.\tag{1}$$

That $2xy$ looks a lot like the middle term of $(x+y)^2$, and the $-2x-2y$ can certainly be written nicely in terms of $x+y$, so let’s try something along those lines. $(x+y)^2=x^2+2xy+y^2$, and we have the $2xy+y^2$, but instead of $x^2$, we have $-x^2$. In other words, we have $(x+y)^2-2x^2$. That’s not entirely promising, but let’s see where it goes. We can rewrite $(1)$ as

\begin{align*} (x+y)^2&-\;2x^2-2(x+y)+x^3+x^2y\\\\ &=(x+y)^2-2(x+y)+x^2(x+y-2)\\\\ &=(x+y-2)(x+y)+x^2(x+y-2)\\\\ &=(x+y-2)(x^2+x+y)\;. \end{align*}

Added: Alternatively, following the hint, interchange the rôles of $x$ and $y$, rewriting $(1)$ as $$y^2+(x^2+2x-2)y+(x^3-x^2-2x)\;.\tag{2}$$

Remember that linear factors of a polynomial correspond to zeroes. Set $(2)$ equal to $0$ and use the quadratic formula to solve for $y$:

\begin{align*} &(x^2+2x-2)^2-4(x^3-x^2-2x)\\ &\qquad=x^4+4x^3-8x+4-4x^3+4x^2+8x\\ &\qquad=x^4+4x^2+4\\ &\qquad=(x^2+2)^2\;, \end{align*}

so $$y=\frac{-x^2-2x+2\pm(x^2+2)}2\;,$$

and $y=-x^2-x$ or $y=-x+2$. Thus, $(2)$ factors as $$\Big(y-(-x^2-x)\Big)\Big(y-(-x+2)\Big)=(y+x^2+x)(y+x-2)\;.$$

-
Thanks for writing out the quadratic so that people can see how much better your simple grouping solution is. I already gave the +1 for your first version. The substitutions u=x+y and u=x-y are uncannily useful. – Jack Schmidt Jun 26 '12 at 18:15
How do I know that eg $x^2+x+y$ is irreduzible? – joachim Jun 26 '12 at 19:41
@joachim: I’d have thought that it was pretty clear by eye. The only way to get the $y$ term in a product is via $(y+\ldots)(1+\ldots)$, and that’s going to give you other terms involving $y$ unless the second factor is just $1$. – Brian M. Scott Jun 26 '12 at 19:53

A detailed explanation can be found here: Factorize the polynomial $x^3+y^3+z^3-3xyz$

The calculations for this example: $$x^3+x^2y-x^2+2xy+y^2-2x-2y$$ can be viewed as is a polynomial of $\mathbb{Q}[y][x]$ so $$p(x)=x^3+(y-1)x^2+(2y-2)x+(y^2-2y)$$ If this monic polynomial in $x$ of degree 3 is not irreducible it has a linear factor and therefore it has a zero. This zero must be a factor of the constant term $y(y-2)$. Checking all possibel values one finds $p(-y+2)=0$. So $x+y-2$ is a factor. Dividing $p(x)$ by $x+y-2$ gives $y+x^2+x$ which is irreducible.

-