Sub topic 10
Building a quadratic from its roots
This chapter reverses the usual direction. Earlier you were given an equation and found its roots. Here you are given the roots, or facts about them, and you build the equation. CAT questions use this to test whether you can work with the sum and product of roots without solving anything.
Prerequisites: you can factorise a quadratic, you know the sum of roots is -b/a and the product is c/a, and you can expand two brackets.
The core rule
If a quadratic has roots p and q, then (x - p) and (x - q) are its factors. Expanding gives:
(x - p)(x - q) = x² - (p + q)x + pq
So with sum S = p + q and product P = pq, the monic equation is:
x² - Sx + P = 0
The middle coefficient is minus the sum. The constant term is the product, with its own sign. Mixing up these signs is the most common error in this topic.
Any non-zero multiple of this equation has the same roots. The full family is:
k(x² - Sx + P) = 0, with k ≠ 0
A question that says "form the equation" accepts any k. A question that says "with integer coefficients" or "with leading coefficient 3" fixes k.
Worked examples
Integer roots
Roots 2 and 3. S = 5 and P = 6, so the equation is x² - 5x + 6 = 0.
Roots -4 and 1. S = -3 and P = -4, so the equation is x² + 3x - 4 = 0. The minus in front of S turns the negative sum into a plus.
Fractional roots
Roots 1/2 and -3. S = -5/2 and P = -3/2, so x² + (5/2)x - 3/2 = 0. Multiply by 2 to clear the denominators:
2x² + 5x - 3 = 0
Check by factorising: (2x - 1)(x + 3) = 2x² + 5x - 3. The roots are 1/2 and -3, as required.
Irrational roots
If a quadratic has rational coefficients and one root is 2 + √3, the other root must be the conjugate 2 - √3. Then S = 4 and P = 4 - 3 = 1, so the equation is x² - 4x + 1 = 0.
Special cases you can read off
You can often recognise the shape of the equation from its roots.
| Root pattern | Effect on a x² + b x + c | Example |
|---|---|---|
| One root is 0 | c = 0 | roots 0 and 5: x² - 5x = 0 |
| Roots equal and opposite (p and -p) | b = 0 | roots 3 and -3: x² - 9 = 0 |
| Roots are reciprocals (p and 1/p) | a = c | roots 2 and 1/2: 2x² - 5x + 2 = 0 |
| Roots equal (repeated) | b² = 4ac | roots 4 and 4: x² - 8x + 16 = 0 |
Automating the construction
The function below builds the smallest integer-coefficient quadratic for two rational roots. It uses exact fractions to avoid floating-point error. It then checks that both roots satisfy the result. It needs Python 3.9 or later for math.lcm.
from fractions import Fraction
from math import lcm
def quadratic_from_roots(r1, r2):
"""Return (a, b, c) of the primitive integer quadratic with roots r1, r2."""
r1, r2 = Fraction(r1), Fraction(r2)
b = -(r1 + r2) # coefficient of x when a = 1
c = r1 * r2 # constant term when a = 1
a = lcm(b.denominator, c.denominator)
coeffs = (a, int(a * b), int(a * c))
for r in (r1, r2): # verify both roots
assert coeffs[0] * r * r + coeffs[1] * r + coeffs[2] == 0
return coeffs
print(quadratic_from_roots(2, 3)) # (1, -5, 6)
print(quadratic_from_roots(Fraction(1, 2), -3)) # (2, 5, -3)
print(quadratic_from_roots(4, 4)) # (1, -8, 16)Roots of a related equation
CAT questions often give you one equation and ask for another whose roots are a transformation of the original roots. You do not solve the original. You find the new sum and product from S and P.
Let α and β be the roots of the original equation, with sum S and product P.
| New roots | New sum | New product |
|---|---|---|
| α + k, β + k | S + 2k | P + kS + k² |
| kα, kβ | kS | k²P |
| -α, -β | -S | P |
| 1/α, 1/β | S/P | 1/P |
| α², β² | S² - 2P | P² |
| α/β, β/α | (S² - 2P)/P | 1 |
The squares row uses α² + β² = (α + β)² - 2αβ. The reciprocal rows require P ≠ 0, because a root of 0 has no reciprocal.
Example: squares of the roots
Take x² - 5x + 6 = 0, so S = 5 and P = 6. For roots α² and β², the new sum is 25 - 12 = 13 and the new product is 36. The new equation is x² - 13x + 36 = 0. Its factors are (x - 4)(x - 9), and 4 and 9 are the squares of 2 and 3.
Example: reciprocals
For roots 1/α and 1/β, the sum is 5/6 and the product is 1/6. So x² - (5/6)x + 1/6 = 0. Multiply by 6 to get 6x² - 5x + 1 = 0, which factorises as (2x - 1)(3x - 1) with roots 1/2 and 1/3.
Alternative: substitution
For a shift, you can also substitute directly. If the new roots are α + 1, write y = x + 1, so x = y - 1. Substitute into x² - 5x + 6:
(y - 1)² - 5(y - 1) + 6 = y² - 7y + 12
The roots are 3 and 4, which are 2 + 1 and 3 + 1. Substitution works well for shifts and scalings. The sum-and-product table works better for reciprocals and squares.
A CAT-style problem: copied wrongly
Two students copy the same quadratic x² + bx + c = 0 and each makes one mistake.
- The first student copies the constant term wrongly and gets roots 8 and 2.
- The second student copies the coefficient of x wrongly and gets roots -9 and -1.
What are the correct roots?
The first student's error was only in c, so the sum of roots is correct: 8 + 2 = 10 = -b, which gives b = -10. The second student's error was only in b, so the product is correct: (-9)(-1) = 9 = c. The true equation is x² - 10x + 9 = 0, with roots 1 and 9.
Common errors
- Sign of the middle term. Roots 2 and 5 give x² - 7x + 10, not x² + 7x + 10. Check by substituting a root: 4 - 14 + 10 = 0.
- Forgetting the constant multiplier. If the question states a leading coefficient or the coefficient of x, scale x² - Sx + P to match before answering.
- Applying the conjugate rule to irrational roots without rational coefficients. The rule needs a stated guarantee.
- Using α² + β² = S² + 2P. The correct identity is S² - 2P.
- Reciprocals with a zero root. If P = 0, the reciprocal equation does not exist.
Exercises
Exercise
Form the quadratic with integer coefficients whose roots are 2/3 and -1/2.
Show answer
S = 2/3 - 1/2 = 1/6 and P = (2/3)(-1/2) = -1/3. The equation x² - (1/6)x - 1/3 = 0 becomes, after multiplying by 6, 6x² - x - 2 = 0. Check: (3x - 2)(2x + 1) = 6x² + 3x - 4x - 2 = 6x² - x - 2.
Exercise
The roots of 2x² - 6x + 3 = 0 are α and β. Form the equation whose roots are α/β and β/α.
Show answer
S = 3 and P = 3/2. The new sum is (S² - 2P)/P = (9 - 3)/(3/2) = 4, and the new product is 1. The equation is x² - 4x + 1 = 0.
Exercise
A quadratic with rational coefficients has 3 - √2 as one root. Find the quadratic with leading coefficient 1.
Show answer
The other root is the conjugate 3 + √2. The sum is 6 and the product is 9 - 2 = 7. The equation is x² - 6x + 7 = 0.