On this page
This is a standard Class 12 three-dimensional geometry problem, and good practice for JEE Main: the direction cosines l, m, n of a line satisfy l + m + n = 0 and l² + m² − n² = 0. Find them, and the angle between the two lines. It comes down to one factorisation and a careful split into cases.
What do l + m + n = 0 and l² + m² − n² = 0 mean?
Direction cosines are the cosines of the angles a line makes with the positive x, y and z axes (Wikipedia: Direction cosine). They always obey one extra rule: l² + m² + n² = 1, because (l, m, n) is a unit vector along the line (same source).
So you really have three equations. The first says the line is perpendicular to (1, 1, 1), so it lies in the plane x + y + z = 0. The second, l² + m² = n², puts it on a cone around the z-axis whose lines all make 45° with that axis. A plane through a cone's vertex cuts it in at most two lines, which is why the answer comes in two sets.
If the idea of direction cosines still feels shaky, start with our walkthrough on how to find direction cosines of a line in 3D and come back.
How do you find the two sets of direction cosines?
From the first equation, n = −(l + m).
Put this into the second: l² + m² − (l + m)² = 0.
Expand: l² + m² − l² − 2lm − m² = 0, which leaves −2lm = 0, so lm = 0.
Case 1, l = 0: then n = −m, so the direction ratios are 0 : 1 : −1.
Case 2, m = 0: then n = −l, so the direction ratios are 1 : 0 : −1.
Divide each set by √(0² + 1² + 1²) = √2 to make it a unit vector.
The two sets of direction cosines are (0, 1/√2, −1/√2) and (1/√2, 0, −1/√2). You can also write each with every sign flipped; that is the same line pointing the other way, not a third answer.
Check the first set: 0 + 1/√2 − 1/√2 = 0, and 0 + 1/2 − 1/2 = 0. Both equations hold, and the squares add to 1.
What is the angle between the two lines?
The cosine of the angle between two unit vectors is their dot product, l₁l₂ + m₁m₂ + n₁n₂ (Wikipedia: Direction cosine). For lines, you take the absolute value so that you get the acute angle.
cos θ = |(0)(1/√2) + (1/√2)(0) + (−1/√2)(−1/√2)| = 1/2.
So θ = 60°, or π/3. Our post on the angle between two lines in 3D from direction ratios shows the same formula when the ratios are not yet normalised.
A second route checks the first. Add l² + m² + n² = 1 to l² + m² = n² and you get 2n² = 1, so n = ±1/√2 for both lines. That matches both sets above and catches an arithmetic slip fast.
Where do students lose marks on this problem?
Dividing by l or m and losing a whole line.
Forgetting l² + m² + n² = 1 and leaving the answer as ratios when the question asked for cosines.
Writing 120° after a sign flip. The angle between lines is taken as the acute one unless the question says otherwise.
Treating (0, −1/√2, 1/√2) as a new answer. It is the same line.
If you keep losing marks at the same line of working, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.
How do you solve the harder version of this problem?
Try l − 5m + 3n = 0 and 7l² + 5m² − 3n² = 0 before reading on. The method is the same: substitute l = 5m − 3n, expand, and the quadratic becomes 30(2m − n)(3m − 2n) = 0.
If n = 2m, then l = −m, giving ratios −1 : 1 : 2 and direction cosines (−1/√6, 1/√6, 2/√6).
If 2n = 3m, then l = m/2, giving ratios 1 : 2 : 3 and direction cosines (1/√14, 2/√14, 3/√14).
The angle: cos θ = |−1 + 2 + 6| / (√6 · √14) = 7/√84, so θ is about 40.2°.
To see where this fits among planes and lines, read about the angle between two planes using normal vectors, or revise the underlying ideas in the Fermi Concept Library, which covers every concept in mathematics with its own lesson.



