Every second-degree curve in the plane is some conic section: a circle, an ellipse, a parabola, a hyperbola, or one of the degenerate cases where the curve collapses into lines. You can work out which one you have without plotting anything. Two numbers decide it.

Two notations, one equation

The general second-degree equation is usually written one of two ways:

Ax2+Bxy+Cy2+Dx+Ey+F=0Ax^2+Bxy+Cy^2+Dx+Ey+F=0

ax2+2hxy+by2+2gx+2fy+c=0ax^2+2hxy+by^2+2gx+2fy+c=0

Both describe the same curve. The second form carries factors of 22 so that the matrix below comes out symmetric, which is the only reason it exists.

NOTE

The two notations map onto each other as A=aA=a, B=2hB=2h, C=bC=b, D=2gD=2g, E=2fE=2f, F=cF=c. Textbooks switch between them without warning, so it is worth keeping this correspondence in mind — the rest of this post uses whichever form makes each formula cleaner.

Step one: is the conic degenerate?

The first number is the determinant Δ\Delta of the matrix of coefficients:

Δ=ahg hbf gfc=abc+2fghaf2bg2ch2\Delta=\begin{vmatrix}a&h&g\\\ h&b&f\\\ g&f&c\end{vmatrix}=abc+2fgh-af^2-bg^2-ch^2

If Δ=0\Delta=0 the conic is degenerate — the curve has collapsed into a point or a pair of lines. If Δ0\Delta\neq0 it is a genuine conic.

Step two: which one is it?

Which test you apply next depends on the answer to step one.

When Δ=0\Delta=0, the sign of h2abh^2-ab tells you what the curve degenerated into:

h2abh^2-abDegenerate case
>0>0Two distinct real lines
=0=0Parallel lines
<0<0Non-real lines

When Δ0\Delta\neq0, the discriminant B24ACB^2-4AC names the conic:

B24ACB^2-4ACConicExtra condition
>0>0HyperbolaRectangular when A+C=0A+C=0
=0=0Parabola
<0<0EllipseA circle when A=CA=C and B=0B=0; real when Δa+b<0\frac{\Delta}{a+b}<0

The two tests read the same quantity. Substituting the correspondence above gives B24AC=4h24ab=4(h2ab)B^2-4AC=4h^2-4ab=4(h^2-ab), so both are the sign of h2abh^2-ab up to a positive factor. What changes is the meaning of that sign, and that depends entirely on whether Δ\Delta vanishes.

The whole procedure

graph TD
  A["Second-degree equation"] --> B{"Determinant zero?"}
  B -->|"yes, degenerate"| C{"Sign of h squared minus ab"}
  B -->|"no, genuine conic"| D{"Sign of B squared minus 4AC"}
  C -->|"positive"| E["Two distinct real lines"]
  C -->|"zero"| F["Parallel lines"]
  C -->|"negative"| G["Non-real lines"]
  D -->|"positive"| H["Hyperbola"]
  D -->|"zero"| I["Parabola"]
  D -->|"negative"| J["Ellipse or circle"]

A worked example

Take x2+4xy+4y2+2x+4y3=0x^2+4xy+4y^2+2x+4y-3=0. Reading off the second notation gives a=1a=1, h=2h=2, b=4b=4, g=1g=1, f=2f=2, c=3c=-3.

The determinant is

Δ=(1)(4)(3)+2(2)(1)(2)(1)(2)2(4)(1)2(3)(2)2\Delta=(1)(4)(-3)+2(2)(1)(2)-(1)(2)^2-(4)(1)^2-(-3)(2)^2

=12+844+12=0=-12+8-4-4+12=0

So the conic is degenerate, and the second test applies: h2ab=44=0h^2-ab=4-4=0, which means parallel lines. The equation does factor as (x+2y+3)(x+2y1)=0(x+2y+3)(x+2y-1)=0 — two parallel lines, exactly as predicted, and we never had to draw anything.