Factoring bivariate polynomial $P(x,y)$. What is the general theory for deciding if a bivariate polynomial $P(x,y)$ can be factored into a product of polynomials of degree $1$?
Specifically, suppose we have 
$$
P(x,y)=Ax^2+By^2+Cxy+Dx+Ey+F,
$$
when is it possible to write 
$$
P(x,y)=(ax+by+c)(dx+ey+f)
$$
for some numbers $a,\dots,f$ (in $\Bbb R$ or $\Bbb C$) and how to do that when it is possible?
Note: My background is mostly in analysis. I have very little knowledge of algebra beyond basic theory of group/ring/field, so if you decided to use some technical terms I'd really appreciate if they come with some explanations. 
 A: You may ask the equivalent question, when the quadratic form in $3$ variables $z^2 P(\frac{x}{z}, \frac{y}{z})$ is the product of two linear forms, or, equivalently, when a quadratic form $Q$ is the difference of squares of two linear forms. ( we use $u^2 - v^2 = (u+v)(u-v)$). This will happen if and only if the form has rank at most $2$.  For forms of $3$ variables, this is equivalent to : the determinant of the matrix of coefficients ( a symmetric matrix) is $0$, that is 
$$ \left| \begin{matrix} A & \frac{C}{2} & \frac{D}{2}\\
\frac{C}{2} & B & \frac{E}{2} \\
\frac{D}{2} & \frac{E}{2} & F \end{matrix} \right | = 0$$ 
Note the decomposition might be  only  over $\mathbb{C}$, depending on the signature of the quadratic form.
A: Just multiply out $(ax+by+c)(dx+ey+f)$ and compare coefficients. This will give you algebraic equations in $a,b,c,d,e,f$ for given $A,B,C,D,E,F$. We have
$A=ad$, $B=be$, $C=ae+bd$, $\ldots$, $F=cf$.
For example, take
$$
P(x,y)=2x^2 + 5xy - 3x + 3y^2 - 2y - 5.
$$
The equations in $a,b,c,d,e,f$ immediately give
$$
P(x,y)=(x+y+1)(2x+3y-5).
$$
Edit: Link to an almost identical question here
