In short

The general quadratic expression in two variables is ax^2 + 2hxy + by^2 + 2gx + 2fy + c. When you set it equal to zero, the curve it traces can be a pair of straight lines — but only when a specific condition on the coefficients holds. That condition is abc + 2fgh - af^2 - bg^2 - ch^2 = 0, which is the same as saying a certain 3 \times 3 determinant is zero.

Take two straight lines in the plane. Say 2x + y - 3 = 0 and x - y + 1 = 0. Each one, on its own, is a perfectly ordinary linear equation — first-degree in x and y. Now multiply them:

(2x + y - 3)(x - y + 1) = 0

Expand the left side:

2x^2 - 2xy + 2x + xy - y^2 + y - 3x + 3y - 3 = 0

Collect terms:

2x^2 - xy - y^2 - x + 4y - 3 = 0

Something interesting has happened. The equation looks like a single second-degree curve — there are x^2, xy, and y^2 terms mixed together. But you know it is really two straight lines in disguise, because you built it by multiplying two linear factors. Every point on either of the two original lines satisfies this equation.

The question this article answers: given a second-degree equation in x and y, how do you tell whether it is secretly a pair of straight lines? And if it is, how do you find those lines?

The general second-degree expression

Any expression that is at most second-degree in x and y can be written

S = ax^2 + 2hxy + by^2 + 2gx + 2fy + c

The coefficients a, b, c, f, g, h are real numbers. The factors of 2 in 2h, 2g, 2f are there by convention — they make the formulas cleaner later, just as writing the quadratic formula with b rather than 2b would change the shape of everything downstream.

The six terms of the general second-degree expression in two variablesA diagram showing the six terms ax squared, 2hxy, by squared, 2gx, 2fy, and c arranged in a row, with labels indicating which are second-degree, which are first-degree, and which is the constant. ax² 2hxy by² 2gx 2fy c degree 2 terms degree 1 terms constant S = ax² + 2hxy + by² + 2gx + 2fy + c
The six terms of the general quadratic in $x$ and $y$. Three are second-degree (involving $x^2$, $xy$, or $y^2$), two are first-degree, and one is a constant. The factors of $2$ in the mixed terms are a deliberate convention.

Setting S = 0 gives you a conic section — the family of curves that includes circles, ellipses, parabolas, and hyperbolas. But there is one more possibility that is often overlooked: the equation S = 0 might not represent a smooth curve at all. It might represent a pair of straight lines — a "degenerate conic."

Your job is to figure out when that degenerate case happens.

When does a quadratic split into two lines?

Start with the simplest version of the problem. Suppose there is no y at all — just

ax^2 + 2gx + c = 0

This is a quadratic in the single variable x, and it factors into two linear pieces exactly when the discriminant (2g)^2 - 4ac = 4(g^2 - ac) is non-negative. The roots give you two vertical lines (or one repeated line).

Now bring y back. The equation S = 0 represents two lines if you can write

ax^2 + 2hxy + by^2 + 2gx + 2fy + c = (l_1 x + m_1 y + n_1)(l_2 x + m_2 y + n_2)

for some real constants l_1, m_1, n_1, l_2, m_2, n_2. Expanding the right side and matching coefficients gives you six equations relating the six original coefficients to the six new ones. The question is whether those six equations have a consistent solution.

There is a clean answer, and it involves a determinant.

The condition: the discriminant determinant

Arrange the coefficients of S into a symmetric 3 \times 3 matrix:

\Delta = \begin{vmatrix} a & h & g \\ h & b & f \\ g & f & c \end{vmatrix}

Expanding this determinant:

\Delta = a(bc - f^2) - h(hc - fg) + g(hf - bg)
= abc - af^2 - h^2 c + fgh + gfh - bg^2
= abc + 2fgh - af^2 - bg^2 - ch^2
The 3 by 3 symmetric matrix whose determinant controls whether the quadratic splits into two linesA three-by-three matrix with entries a, h, g in the first row, h, b, f in the second row, and g, f, c in the third row. Arrows indicate the symmetry: the matrix equals its own transpose. The determinant Delta is shown below the matrix. Δ = a h g h b f g f c ← symmetric: entry (i,j) = entry (j,i) Δ = abc + 2fgh − af² − bg² − ch² Δ = 0 means S = 0 is a pair of straight lines
The symmetric matrix of the quadratic form. Its determinant $\Delta = abc + 2fgh - af^2 - bg^2 - ch^2$ is the single number that decides whether the equation $S = 0$ can be factored into two linear equations.

Condition for a pair of straight lines

The equation ax^2 + 2hxy + by^2 + 2gx + 2fy + c = 0 represents a pair of straight lines if and only if

\Delta = \begin{vmatrix} a & h & g \\ h & b & f \\ g & f & c \end{vmatrix} = 0

That is: abc + 2fgh - af^2 - bg^2 - ch^2 = 0.

Why does a vanishing determinant give you two lines? The key idea: the determinant of a matrix is zero precisely when the matrix is singular — when it does not have full rank. For a 3 \times 3 symmetric matrix, being singular means the associated quadratic form is degenerate. Geometrically, a degenerate conic is either a pair of lines (possibly coincident), a single point, or the empty set. The condition \Delta = 0 picks out exactly these cases, and when the expression can be factored over the reals, you get two lines.

The homogeneous part: lines through the origin

Before tackling the full six-coefficient expression, strip away the first-degree and constant terms. Look at just the second-degree part:

ax^2 + 2hxy + by^2 = 0

This is a homogeneous quadratic — every term has total degree 2. Since the origin (0, 0) satisfies this equation (plug in x = 0, y = 0 and every term vanishes), any pair of lines this represents must pass through the origin.

To factor it, divide both sides by y^2 (assuming y \neq 0) and set m = x/y:

am^2 + 2hm + b = 0

This is a standard quadratic in m. Its discriminant is 4(h^2 - ab).

Three cases for the homogeneous quadratic: two lines, one line, or just the originThree panels side by side. In the first, two lines cross at the origin, illustrating h squared greater than ab. In the second, a single line passes through the origin, illustrating h squared equals ab. In the third, only the origin is marked, illustrating h squared less than ab. h² > ab two lines h² = ab one repeated line h² < ab origin only
The three possible outcomes for the homogeneous equation $ax^2 + 2hxy + by^2 = 0$. When $h^2 > ab$, the expression splits into two distinct lines through the origin. When $h^2 = ab$, the two lines coincide. When $h^2 < ab$, the only real point satisfying the equation is the origin itself.

The slopes of the two lines (when they exist) are the two roots of am^2 + 2hm + b = 0, which by Vieta's formulas give:

m_1 + m_2 = -\frac{2h}{a}, \qquad m_1 \cdot m_2 = \frac{b}{a}

These relations let you read off the sum and product of the slopes directly from the coefficients of the homogeneous quadratic — without solving the quadratic at all. If a problem asks for the angle between the two lines, you can compute \tan\theta from m_1 and m_2 using the angle formula \tan\theta = \left|\frac{m_1 - m_2}{1 + m_1 m_2}\right|.

The general case: lines not through the origin

When first-degree and constant terms are present — the full expression ax^2 + 2hxy + by^2 + 2gx + 2fy + c — the pair of lines (if they exist) need not pass through the origin. The two lines are l_1 x + m_1 y + n_1 = 0 and l_2 x + m_2 y + n_2 = 0, and their intersection can be anywhere.

The factoring procedure is:

  1. Check that \Delta = abc + 2fgh - af^2 - bg^2 - ch^2 = 0. If not, the expression does not represent a pair of lines.
  2. Factor the homogeneous part ax^2 + 2hxy + by^2 to find the slopes of the two lines.
  3. Once you know the slopes, use the first-degree terms (2gx + 2fy) and the constant c to pin down the intercepts.

In practice, for simple coefficients, you often proceed by inspection — testing plausible linear factors and comparing.

Angle between the pair of lines

When ax^2 + 2hxy + by^2 + 2gx + 2fy + c = 0 represents two lines, the angle \theta between them depends only on the second-degree terms (the slopes are determined by a, h, b alone):

\tan\theta = \frac{2\sqrt{h^2 - ab}}{a + b}

Two special cases are worth remembering. If a + b = 0, then \tan\theta is undefined, meaning \theta = 90° — the lines are perpendicular. If h^2 = ab, then \tan\theta = 0, meaning \theta = 0° — the lines are parallel (or coincident).

Angle between a pair of lines represented by a second-degree equationTwo straight lines crossing at a point, with the acute angle theta marked between them. The formula for tan theta is displayed beside the angle arc. θ tan θ = 2√(h²−ab) ÷ (a + b)
The angle between the two lines depends only on $a$, $h$, and $b$ — the coefficients of the second-degree terms. The first-degree terms and the constant shift the lines but do not tilt them.

Two worked examples

Example 1: Show that $2x^2 + 5xy + 3y^2 + 6x + 7y + 4 = 0$ represents a pair of straight lines, and find them

Step 1. Identify the coefficients by comparing with ax^2 + 2hxy + by^2 + 2gx + 2fy + c.

a = 2, \quad 2h = 5 \implies h = \tfrac{5}{2}, \quad b = 3, \quad 2g = 6 \implies g = 3, \quad 2f = 7 \implies f = \tfrac{7}{2}, \quad c = 4

Why: the standard form uses 2h, 2g, 2f — so you halve the coefficients of xy, x, and y to extract h, g, f.

Step 2. Compute \Delta = abc + 2fgh - af^2 - bg^2 - ch^2.

abc = 2 \cdot 3 \cdot 4 = 24
2fgh = 2 \cdot \tfrac{7}{2} \cdot 3 \cdot \tfrac{5}{2} = \tfrac{105}{2} = 52.5
af^2 = 2 \cdot \tfrac{49}{4} = \tfrac{49}{2} = 24.5
bg^2 = 3 \cdot 9 = 27
ch^2 = 4 \cdot \tfrac{25}{4} = 25
\Delta = 24 + 52.5 - 24.5 - 27 - 25 = 0

Why: \Delta = 0 confirms this equation represents a pair of straight lines. If you got a non-zero value, no factoring would be possible.

Step 3. Factor the homogeneous part 2x^2 + 5xy + 3y^2. Treat it as a quadratic in x: 2x^2 + 5xy + 3y^2 = (2x + 3y)(x + y). Check: 2x \cdot x = 2x^2, 2x \cdot y + 3y \cdot x = 5xy, 3y \cdot y = 3y^2. Correct.

Why: the second-degree part gives you the slopes of the two lines. The factors (2x + 3y) and (x + y) tell you the lines have slopes -2/3 (from 2x + 3y = \text{const}) and -1 (from x + y = \text{const}).

Step 4. Now look for constants p and q such that

2x^2 + 5xy + 3y^2 + 6x + 7y + 4 = (2x + 3y + p)(x + y + q)

Expand the right side: 2x^2 + 2xy + 2qx + 3xy + 3y^2 + 3qy + px + py + pq

= 2x^2 + 5xy + 3y^2 + (2q + p)x + (3q + p)y + pq

Match with the original: 2q + p = 6, 3q + p = 7, pq = 4.

Subtract the first from the second: q = 1. Then p = 6 - 2(1) = 4. Check: pq = 4 \cdot 1 = 4. All three conditions hold.

Result. The two lines are 2x + 3y + 4 = 0 and x + y + 1 = 0.

The pair of lines 2x plus 3y plus 4 equals 0 and x plus y plus 1 equals 0A coordinate plane showing two straight lines. The line 2x plus 3y plus 4 equals 0 has slope negative two-thirds and passes through the point (1, minus 2). The line x plus y plus 1 equals 0 has slope negative 1 and passes through (0, minus 1). The two lines intersect at the point (1, minus 2). x y 1 2 −1 1 −1 −2 intersection (1, −2) 2x + 3y + 4 = 0 x + y + 1 = 0
The equation $2x^2 + 5xy + 3y^2 + 6x + 7y + 4 = 0$ is not a smooth conic — it is two straight lines: $2x + 3y + 4 = 0$ and $x + y + 1 = 0$. They intersect at $(1, -2)$. Every point on either line satisfies the original second-degree equation.

The point of intersection is found by solving the system: from x + y + 1 = 0, y = -x - 1. Substituting into 2x + 3(-x - 1) + 4 = 0 gives -x + 1 = 0, so x = 1, y = -2. The two lines meet at (1, -2).

Example 2: Check whether $x^2 - 4xy + 4y^2 - 2x + 4y + 1 = 0$ represents a pair of lines, and interpret the result geometrically

Step 1. Read off the coefficients.

a = 1, \quad 2h = -4 \implies h = -2, \quad b = 4, \quad 2g = -2 \implies g = -1, \quad 2f = 4 \implies f = 2, \quad c = 1

Why: same extraction as before — halve the coefficients of xy, x, and y to get h, g, f.

Step 2. Compute \Delta.

abc = 1 \cdot 4 \cdot 1 = 4
2fgh = 2 \cdot 2 \cdot (-1) \cdot (-2) = 8
af^2 = 1 \cdot 4 = 4
bg^2 = 4 \cdot 1 = 4
ch^2 = 1 \cdot 4 = 4
\Delta = 4 + 8 - 4 - 4 - 4 = 0

Why: \Delta = 0, so the equation does represent a degenerate conic — a pair of lines (possibly coincident).

Step 3. Factor the homogeneous part: x^2 - 4xy + 4y^2 = (x - 2y)^2. This is a perfect square, which means h^2 = ab (4 = 1 \cdot 4). The two lines have the same slope — they are parallel or identical.

Why: when h^2 = ab, the two lines from the homogeneous part coincide. But the first-degree terms might separate them into two distinct parallel lines.

Step 4. Try factoring the full expression as (x - 2y + p)(x - 2y + q).

Expand: x^2 - 2xy + px - 2xy + 4y^2 - 2py + qx - 2qy + pq

= x^2 - 4xy + 4y^2 + (p + q)x - 2(p + q)y + pq

Match: p + q = -2, -2(p + q) = 4 (consistent, since -2 \cdot (-2) = 4), and pq = 1.

From p + q = -2 and pq = 1: the values p and q satisfy t^2 + 2t + 1 = 0, giving t = -1 (double root). So p = q = -1.

Result. The expression factors as (x - 2y - 1)^2 = 0, which is a single line x - 2y - 1 = 0 counted twice.

The repeated line x minus 2y minus 1 equals 0A coordinate plane showing a single straight line x minus 2y minus 1 equals 0 with slope one-half. The line is drawn thicker than usual to indicate it is counted twice. The equation factors as a perfect square. x y 1 2 −1 1 −1 x − 2y − 1 = 0 (counted twice) (x − 2y − 1)² = 0 → one line, multiplicity 2
The second-degree equation $x^2 - 4xy + 4y^2 - 2x + 4y + 1 = 0$ is a perfect square: $(x - 2y - 1)^2 = 0$. Geometrically, this is a single line $x - 2y - 1 = 0$ — but the equation "sees" it twice, just as $(x - 3)^2 = 0$ has a repeated root in one variable.

This is the two-variable analogue of a repeated root. The quadratic t^2 - 6t + 9 = 0 factors as (t - 3)^2 and has one root of multiplicity two. Here, the second-degree equation in x and y factors as a perfect square and represents one line of "multiplicity two." The condition h^2 = ab is what signals parallel or coincident lines, and the full condition \Delta = 0 confirms the factoring is possible.

Common confusions

Going deeper

If you came here to learn what the general quadratic in two variables looks like and when it splits into lines, you have the full picture — you can stop here. What follows connects this topic to the broader theory of conics and matrices.

The conic family

The equation ax^2 + 2hxy + by^2 + 2gx + 2fy + c = 0 represents a conic section. Which conic depends on the discriminant of the second-degree terms, h^2 - ab:

Condition Conic (when \Delta \neq 0) Degenerate case (\Delta = 0)
h^2 < ab Ellipse (or circle if a = b, h = 0) A point, or empty set
h^2 = ab Parabola Two parallel lines (or one repeated line)
h^2 > ab Hyperbola Two intersecting lines

The pair-of-lines case is the "degenerate" column — what happens when the smooth conic degenerates into something simpler. You can think of it this way: a hyperbola has two asymptotes that form an "X" shape, and the hyperbola wraps around those arms. As the hyperbola degenerates, it collapses onto its asymptotes, and you are left with just the two lines.

The matrix viewpoint

The expression ax^2 + 2hxy + by^2 + 2gx + 2fy + c can be written as a matrix product:

\begin{pmatrix} x & y & 1 \end{pmatrix} \begin{pmatrix} a & h & g \\ h & b & f \\ g & f & c \end{pmatrix} \begin{pmatrix} x \\ y \\ 1 \end{pmatrix} = 0

The 3 \times 3 matrix is exactly the one whose determinant you computed. Setting S = 0 is the same as asking when the vector (x, y, 1) is in the null space of this quadratic form. The determinant being zero means the matrix is singular — it has a non-trivial null vector — and that is the algebraic reason the conic degenerates.

This matrix perspective extends naturally. In projective geometry, every conic is represented by a symmetric 3 \times 3 matrix, and the classification of conics (ellipse, parabola, hyperbola, degenerate) is really the classification of these matrices by rank and signature. The pair-of-lines condition \Delta = 0 is rank \leq 2.

Joint equation of two given lines

If you are given two lines l_1 x + m_1 y + n_1 = 0 and l_2 x + m_2 y + n_2 = 0 and asked to write their "joint equation," simply multiply:

(l_1 x + m_1 y + n_1)(l_2 x + m_2 y + n_2) = 0

Expanding gives you the second-degree equation. This is useful in coordinate geometry problems where you need to work with the combined locus of two lines as a single equation — for instance, when finding the equation of the pair of tangents from an external point to a conic.

Where this leads next

The pair-of-lines condition is a gateway into both coordinate geometry and linear algebra.