Sub topic 11
Sum and Product of the Roots
Assume you can expand polynomials, factor simple quadratics, and use the quadratic formula. This chapter develops a fast way to check quadratic roots without solving the equation again.
Vieta's formulas
Consider a quadratic in standard form:
\[ ax^2+bx+c=0,\qquad a\ne 0 \]
Let its roots be \(r1\) and \(r2\). If the roots are known, the quadratic can be written in factored form:
\[ a(x-r1)(x-r2)=0 \]
Expand the factors:
\[ a(x^2-(r1+r2)x+r1r2)=0 \]
\[ ax^2-a(r1+r2)x+ar1r2=0 \]
Compare this expression with \(ax^2+bx+c=0\). The coefficients give:
\[ \boxed{r1+r2=-\frac{b}{a}} \]
and
\[ \boxed{r1r2=\frac{c}{a}} \]
These relationships are called Vieta's formulas. They work for real roots and complex roots, including repeated roots.
| Quantity | Formula |
|---|---|
| Sum of the roots | \(r_1+r_2=-b/a\) |
| Product of the roots | \(r_1r_2=c/a\) |
Checking a solution
Take the equation
\[ 2x^2-7x+3=0 \]
The coefficients are \(a=2\), \(b=-7\), and \(c=3\). Therefore, any two roots must satisfy
\[ r1+r2=-\frac{-7}{2}=\frac72 \]
and
\[ r1r2=\frac32 \]
The quadratic formula gives
\[ x=\frac{7\pm\sqrt{49-24}}{4} =\frac{7\pm5}{4} \]
So the roots are \(3\) and \(1/2\). Check them:
\[ 3+\frac12=\frac72,\qquad 3\left(\frac12\right)=\frac32 \]
Both relationships hold.
Vieta's formulas are especially useful when a calculation produces complicated expressions. You can check the sum and product separately instead of substituting both roots into the original equation.
Using the formulas to find missing information
Suppose one root of
\[ 3x^2-10x+c=0 \]
is \(2\), and you want to find the other root. Let the other root be \(r\). The sum formula gives
\[ 2+r=-\frac{-10}{3}=\frac{10}{3} \]
so
\[ r=\frac43 \]
The product then predicts
\[ c=3(2)\left(\frac43\right)=8 \]
Thus the equation is consistent with \(3x^2-10x+8=0\).
For complex roots, the formulas still work. If the coefficients are real and the roots are \(p+qi\) and \(p-qi\), their imaginary parts cancel in the sum:
\[ (p+qi)+(p-qi)=2p \]
Their product is
\[ (p+qi)(p-qi)=p^2+q^2 \]
because \(i^2=-1\). This explains why nonreal roots of a real quadratic occur as conjugate pairs.
A programmatic check
def vieta_check(a, b, c, r1, r2, tolerance=1e-9):
expected_sum = -b / a
expected_product = c / a
actual_sum = r1 + r2
actual_product = r1 * r2
return (
abs(actual_sum - expected_sum) < tolerance
and abs(actual_product - expected_product) < tolerance
)
print(vieta_check(2, -7, 3, 3, 0.5)) # TrueThe tolerance allows for tiny rounding differences in decimal calculations.
Exercise
The roots of \(4x^2+6x-1=0\) are \(r1\) and \(r2\). What are \(r1+r2\) and \(r1r2\)?
Show answer
\(r1+r2=-6/4=-3/2\), and \(r1r2=-1/4\).