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:
Expand the left side:
Collect terms:
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
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.
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
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
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:
Expanding this determinant:
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
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:
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:
This is a standard quadratic in m. Its discriminant is 4(h^2 - ab).
- If h^2 > ab: two distinct real values of m, giving two distinct lines through the origin.
- If h^2 = ab: one repeated value of m, giving one line (counted twice).
- If h^2 < ab: no real values of m — the equation has no real locus except the origin.
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:
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:
- Check that \Delta = abc + 2fgh - af^2 - bg^2 - ch^2 = 0. If not, the expression does not represent a pair of lines.
- Factor the homogeneous part ax^2 + 2hxy + by^2 to find the slopes of the two lines.
- 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):
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).
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.
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.
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
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 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.
Why: same extraction as before — halve the coefficients of xy, x, and y to get h, g, f.
Step 2. Compute \Delta.
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.
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
-
"If \Delta = 0, I always get two distinct lines." Not always. As Example 2 shows, you can get a single line counted twice (coincident lines). And in some cases, \Delta = 0 gives a single point or even no real locus at all (for instance, x^2 + y^2 = 0 has \Delta = 0 but represents only the origin). Always factor to see which case you are in.
-
"The angle between the pair of lines depends on all six coefficients." It depends only on a, h, and b — the second-degree coefficients. The first-degree terms and the constant translate the lines but do not change their directions.
-
"h^2 > ab is needed for the equation to represent two lines." That condition is needed for two distinct lines through the origin (the homogeneous case). For the general case, you need \Delta = 0 and the factored form to give real lines. It is possible for h^2 = ab (parallel lines) with \Delta = 0 to still give a valid pair.
-
"The factors of 2 in 2h, 2g, 2f are arbitrary." They are chosen so that the matrix \begin{pmatrix} a & h & g \\ h & b & f \\ g & f & c \end{pmatrix} is exactly the matrix of the quadratic form. Without those factors of 2, the matrix would not be symmetric in the clean way it is, and the determinant condition would have extra factors cluttering it.
-
"I can always find the two lines by solving a quadratic in x." You can — treat the equation as a quadratic in x with coefficients that depend on y — but the algebra gets heavy. For clean coefficients, pattern-matching the factored form (as in the examples) is usually faster.
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:
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:
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.
- Straight Lines — the systematic study of lines in the plane: slope, intercept, angle between lines, and all the standard forms.
- Coordinate Geometry — Basics — the foundational toolkit of distances, midpoints, and section formulas that underlies every geometric argument in this article.
- Determinants — the 3 \times 3 determinant that controls the pair-of-lines condition is your first meeting with a tool that appears everywhere in linear algebra.
- Quadratic Expressions and Functions — the single-variable quadratic, whose discriminant is the direct ancestor of the determinant condition here.
- Linear Equations in Two Variables — the building blocks: each line in a pair of lines is itself a linear equation in two variables.