On this page
Multiply out (y − m₁x)(y − m₂x) = 0 and you get one equation for two lines through the origin, with every term of degree two. Written as ax² + 2hxy + by² = 0, it gives you three results straight from a, h and b: the angle between the lines, when they are perpendicular or coincident, and their angle bisectors.
What does ax² + 2hxy + by² = 0 represent?
It represents a pair of straight lines, real or imaginary, through the origin, as the CodeCogs reference on pairs of straight lines states.
To see the two lines, assume b ≠ 0, put y = mx and divide by x² to get bm² + 2hm + a = 0. Its roots m₁ and m₂ are the slopes, with m₁ + m₂ = −2h/b and m₁m₂ = a/b. The lines are real and distinct when h² > ab, coincide when h² = ab, and are imaginary when h² < ab.
How do you find the angle between the pair of straight lines?
Start from the angle between two lines with slopes m₁ and m₂: tan θ = |m₁ − m₂|/|1 + m₁m₂|. Then use the sum and product of the roots.
(m₁ − m₂)² = (m₁ + m₂)² − 4m₁m₂ = 4h²/b² − 4a/b = 4(h² − ab)/b².
So |m₁ − m₂| = 2√(h² − ab)/|b|.
And 1 + m₁m₂ = 1 + a/b = (a + b)/b.
Divide: tan θ = 2√(h² − ab)/|a + b|.
For the pair ax² + 2hxy + by² = 0, the acute angle θ between the lines satisfies tan θ = 2√(h² − ab)/|a + b|. The CodeCogs page writes the denominator as (a + b); taking its absolute value picks the acute angle.
When are the lines perpendicular or coincident?
Perpendicular: θ = 90° when the denominator is zero, so a + b = 0, as the CodeCogs reference notes. Example: x² + 5xy − y² = 0.
Coincident: θ = 0 when the numerator is zero, so h² = ab, and the equation is a perfect square, such as x² − 4xy + 4y² = (x − 2y)² = 0.
What is the equation of the angle bisectors?
The two lines that bisect the angles between the pair are (x² − y²)/(a − b) = xy/h, or without fractions, h(x² − y²) = (a − b)xy. The CodeCogs reference gives the same relation as (x² − y²)/xy = (a − b)/h. The cross-multiplied form also covers a = b, where it gives x² − y² = 0.
A built-in check: the coefficients of x² and y² are h and −h, which add to zero, so the bisectors are always perpendicular, as they must be. The three-dimensional version is in our post on the plane bisecting the angle between two planes.
Worked example: a JEE-style question
Question. For x² − 3xy + 2y² = 0, find the acute angle between the lines and their angle bisectors.
Read the coefficients: a = 1, 2h = −3 so h = −3/2, and b = 2.
h² − ab = 9/4 − 2 = 1/4, so √(h² − ab) = 1/2. The lines are real and distinct.
tan θ = 2 × (1/2)/|1 + 2| = 1/3, so θ = tan⁻¹(1/3).
Bisectors: h(x² − y²) = (a − b)xy gives (−3/2)(x² − y²) = −xy. Multiply by −2 to get 3x² − 3y² = 2xy, that is 3x² − 2xy − 3y² = 0.
Check by factorising. x² − 3xy + 2y² = (x − y)(x − 2y), so the lines are y = x and y = x/2. With slopes 1 and 1/2, tan θ = (1 − 1/2)/(1 + 1/2) = 1/3. The bisectors have slopes (−1 ± √10)/3, about 0.72 and −1.39. The first points at 35.8°, halfway between 45° and 26.6°, so it bisects the acute angle.
A five-step routine for any pair-of-lines question
Write the equation as ax² + 2hxy + by² = 0 and halve the xy coefficient.
Check h² − ab first: negative means no real lines, zero means one line.
Test a + b = 0 before computing anything; a perpendicular pair saves time.
Use tan θ = 2√(h² − ab)/|a + b| for the angle and h(x² − y²) = (a − b)xy for the bisectors.
Factorise, when easy, only as a check.
For a chapter plan, see our guides on preparing straight lines for JEE Main and straight lines and circles for JEE Advanced. Syllabi change, so confirm the topic is on your exam's current official syllabus, for JEE Advanced at jeeadv.ac.in.
If a right formula gives a wrong answer, the slip is usually in step 1 or a sign. The Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer, so you see which line went wrong. For the slope and angle idea itself, see the Fermi Concept Library.



