Polynomial Functions

Study Sheet

Polynomial Functions

Vocabulary, end behavior, division, zeros, and graphs

Polynomial Vocabulary

Concept
The language of polynomials

A polynomial in one variable is a sum of terms of the form anxna_n x^n, where each exponent is a whole number.

f(x)=anxn+an1xn1++a1x+a0f(x)=a_n x^n + a_{n-1}x^{n-1} + \cdots + a_1 x + a_0
  • [leftmargin=5mm,itemsep=1pt]
  • Degree: the greatest exponent on the variable.
  • Leading coefficient: the coefficient ana_n of the highest-degree term.
  • Standard form: terms written from highest degree to lowest.
  • Constant term: a0a_0, the term with no variable.

Classify by degree: 00 constant, 11 linear, 22 quadratic, 33 cubic, 44 quartic, 55 quintic.

Example
Reading off the parts

Consider g(x)=72x3+4xg(x)=7-2x^3+4x. Write in standard form: g(x)=2x3+4x+7g(x)=-2x^3+4x+7. Degree =3=3 (cubic), leading coefficient =2=-2, constant term =7=7.

Tip

Tip: A polynomial must have only whole-number exponents. Expressions like x1x^{-1}, x=x1/2\sqrt{x}=x^{1/2}, or 1x\dfrac{1}{x} are not polynomial terms.

End Behavior

Concept
What the “arms” do

The end behavior of a graph describes what happens to f(x)f(x) as x+x\to+\infty and xx\to-\infty. It depends only on the degree parity and the sign of the leading coefficient.

degreeleading coeff.end behavioreven+up-left, up-rightevendown-left, down-rightodd+down-left, up-rightoddup-left, down-right\begin{array}{c|c|c} \text{degree} & \text{leading coeff.} & \text{end behavior}\\\hline \text{even} & + & \text{up-left, up-right}\\ \text{even} & - & \text{down-left, down-right}\\ \text{odd} & + & \text{down-left, up-right}\\ \text{odd} & - & \text{up-left, down-right} \end{array}

     

Example
Predicting the ends

For f(x)=2x3+5x1f(x)=-2x^3+5x-1: degree 33 is odd and the leading coefficient 2-2 is negative, so the graph goes up on the left and down on the right. In symbols: as x, f(x)+x\to-\infty,\ f(x)\to+\infty, and as x+, f(x)x\to+\infty,\ f(x)\to-\infty.

Tip

Remember: Only the leading term controls end behavior. Every other term becomes negligible for very large x|x|.

Adding, Subtracting, and Multiplying Polynomials

Concept
Combining polynomials

Add / subtract: combine like terms. When subtracting, distribute the - sign to every term first. Multiply: distribute each term of one factor across the other, then combine like terms. The degrees add: (degm)(degn)(\deg m)\cdot(\deg n) product has degree m+nm+n.

Example
Three operations

Sum: (3x22x+1)+(x2+5x4)=4x2+3x3(3x^2-2x+1)+(x^2+5x-4)=4x^2+3x-3. Difference: (5x32x+4)(2x3+x1)=3x33x+5(5x^3-2x+4)-(2x^3+x-1)=3x^3-3x+5. Product: (x+3)(x22x+5)(x+3)(x^2-2x+5)

=x32x2+5x+3x26x+15=x3+x2x+15.= x^3-2x^2+5x+3x^2-6x+15 = x^3+x^2-x+15.
Tip

Tip: Line up like terms in columns for addition and subtraction, just like whole numbers. It prevents dropped terms.

Long Division and Synthetic Division

Concept
Two ways to divide

Long division works for any divisor. Synthetic division is a fast shortcut that works only when dividing by a linear factor xcx-c. The Division Algorithm says

f(x)=(divisor)(quotient)+remainder.f(x) = (\text{divisor})(\text{quotient}) + \text{remainder}.
Example
Long division: (2x3+3x2x+5)÷(x+2)(2x^3+3x^2-x+5)\div(x+2)
2x2 x+1x+2)2x3+3x2 x+5\begin{array}{r} 2x^2-\ x+1\\[-1pt] x+2\,\overline{)\,2x^3+3x^2-\ x+5}\\ \end{array}

Step by step the quotient is 2x2x+12x^2-x+1 with remainder 33, so

2x3+3x2x+5x+2=2x2x+1+3x+2.\frac{2x^3+3x^2-x+5}{x+2}=2x^2-x+1+\frac{3}{x+2}.
Example
Synthetic division: (x34x2+5x2)÷(x1)(x^3-4x^2+5x-2)\div(x-1)

Use c=1c=1 with the coefficients 1, 4, 5, 21,\ -4,\ 5,\ -2:

114521321320\begin{array}{c|rrrr} 1 & 1 & -4 & 5 & -2\\ & & 1 & -3 & 2\\\hline & 1 & -3 & 2 & 0 \end{array}

The bottom row gives quotient x23x+2x^2-3x+2 and remainder 00. Since the remainder is 00, (x1)(x-1) is a factor:

x34x2+5x2=(x1)(x23x+2)=(x1)2(x2).x^3-4x^2+5x-2=(x-1)(x^2-3x+2)=(x-1)^2(x-2).
Tip

Watch out: Include a 00 placeholder for every missing power before you divide. For x37x^3-7 use coefficients 1, 0, 0, 71,\ 0,\ 0,\ -7.

The Remainder and Factor Theorems

Concept
Evaluating by dividing

Remainder Theorem: When f(x)f(x) is divided by xcx-c, the remainder equals f(c)f(c). Factor Theorem: (xc)(x-c) is a factor of f(x)f(x) if and only if f(c)=0f(c)=0 (that is, cc is a zero).

Reminder — Remainder and Factor theorems:P(x)=(xc)Q(x)+P(c)(xc)P(x)    P(c)=0P(x)=(x-c)Q(x)+P(c) \quad\Longrightarrow\quad (x-c)\mid P(x) \iff P(c)=0
Example
Testing a factor

Is (x2)(x-2) a factor of f(x)=x34x2+5x2f(x)=x^3-4x^2+5x-2? Evaluate:

f(2)=816+102=0.f(2)=8-16+10-2=0.

Because f(2)=0f(2)=0, yes---(x2)(x-2) is a factor, and x=2x=2 is a zero.

Tip

Tip: Synthetic division and the Remainder Theorem agree: the last number in a synthetic-division row is f(c)f(c).

Factoring Higher-Degree Polynomials

Concept
A factoring toolkit
  • [leftmargin=5mm,itemsep=1pt]
  • GCF first: always pull out the greatest common factor.
  • Grouping: for four terms, group in pairs and factor each.
  • Sum of cubes: a3+b3=(a+b)(a2ab+b2)a^3+b^3=(a+b)(a^2-ab+b^2).
  • Difference of cubes: a3b3=(ab)(a2+ab+b2)a^3-b^3=(a-b)(a^2+ab+b^2).
  • Quadratic form: treat x45x2+4x^4-5x^2+4 like u25u+4u^2-5u+4 with u=x2u=x^2.
Example
Four factoring moves

GCF: 6x49x3+3x2=3x2(2x23x+1)=3x2(2x1)(x1)6x^4-9x^3+3x^2=3x^2(2x^2-3x+1)=3x^2(2x-1)(x-1). Grouping: x3+2x29x18=x2(x+2)9(x+2)=(x+2)(x29)=(x+2)(x3)(x+3)x^3+2x^2-9x-18=x^2(x+2)-9(x+2)=(x+2)(x^2-9)=(x+2)(x-3)(x+3). Difference of cubes: 8x31=(2x1)(4x2+2x+1)8x^3-1=(2x-1)(4x^2+2x+1). Quadratic form: x45x2+4=(x21)(x24)=(x1)(x+1)(x2)(x+2)x^4-5x^2+4=(x^2-1)(x^2-4)=(x-1)(x+1)(x-2)(x+2).

Tip

Remember: “Factor completely” means keep going until every factor is prime over the integers (or as far as the problem allows).

Finding All Zeros

Concept
Rational Root Theorem, multiplicity, and depressing

Rational Root Theorem: any rational zero of a polynomial with integer coefficients has the form pq\dfrac{p}{q}, where pp divides the constant term and qq divides the leading coefficient. Strategy: test candidates until one works, use synthetic division to depress the polynomial to a lower degree, then repeat or factor the result. Multiplicity: the number of times a factor repeats. A zero of multiplicity 22 makes the graph touch (bounce off) the xx-axis; odd multiplicity makes it cross.

Example
Find all zeros of f(x)=x32x25x+6f(x)=x^3-2x^2-5x+6

Candidates: ±1,±2,±3,±6\pm1,\pm2,\pm3,\pm6. Test x=1x=1: 125+6=01-2-5+6=0, so (x1)(x-1) is a factor. Depress:

112561161160\begin{array}{c|rrrr} 1 & 1 & -2 & -5 & 6\\ & & 1 & -1 & -6\\\hline & 1 & -1 & -6 & 0 \end{array}

The quotient is x2x6=(x3)(x+2)x^2-x-6=(x-3)(x+2). Therefore

f(x)=(x1)(x3)(x+2),zeros: x=1, 3, 2.f(x)=(x-1)(x-3)(x+2),\qquad \text{zeros: } x=1,\ 3,\ -2.
Example
A case with complex zeros: f(x)=x32x2+x2f(x)=x^3-2x^2+x-2

Test x=2x=2: 88+22=08-8+2-2=0. Depress with c=2c=2:

212122021010\begin{array}{c|rrrr} 2 & 1 & -2 & 1 & -2\\ & & 2 & 0 & 2\\\hline & 1 & 0 & 1 & 0 \end{array}

The quotient is x2+1x^2+1, which has zeros x=±ix=\pm i. So the zeros are x=2, i, ix=2,\ i,\ -i.

Tip

Tip: Once you depress down to a quadratic, stop dividing---finish with factoring or the quadratic formula.

Reminder — The quadratic formula:x=b±b24ac2a(a0)x=\frac{-b\pm\sqrt{b^{2}-4ac}}{2a}\qquad (a\neq 0)

Fundamental Theorem of Algebra

Concept
Counting zeros

Fundamental Theorem of Algebra: every polynomial of degree n1n\ge1 has exactly nn zeros in the complex numbers, counted with multiplicity. Complex Conjugate Theorem: if the coefficients are real and a+bia+bi is a zero, then its conjugate abia-bi is also a zero. Complex zeros always come in pairs, so a polynomial of odd degree with real coefficients has at least one real zero.

Example
Writing a polynomial from its zeros

(a) Zeros 2, 3, 52,\ -3,\ 5:

(x2)(x+3)(x5)=(x2+x6)(x5)=x34x211x+30.(x-2)(x+3)(x-5)=(x^2+x-6)(x-5)=x^3-4x^2-11x+30.

(b) Zeros 3, 2i, 2i3,\ 2i,\ -2i (the pair is required for real coefficients):

(x3)(x2+4)=x33x2+4x12.(x-3)(x^2+4)=x^3-3x^2+4x-12.
Tip

Tip: A pair of conjugate zeros a±bia\pm bi multiplies to the real quadratic x22ax+(a2+b2)x^2-2ax+(a^2+b^2)---no imaginary numbers left behind.

Graphing Polynomial Functions

Concept
Putting it all together

To sketch y=f(x)y=f(x):

  • [leftmargin=6mm,itemsep=1pt]
  • Find the end behavior from degree and leading coefficient.
  • Find the zeros (x-intercepts) and their multiplicities: cross at odd, touch at even.
  • Plot the y-intercept f(0)f(0).
  • A degree-nn polynomial has at most n1n-1 turning points.
  • Connect smoothly---polynomial graphs have no breaks or sharp corners.
Example
Graphing f(x)=x34x=x(x2)(x+2)f(x)=x^3-4x=x(x-2)(x+2)

Odd degree, positive leading coefficient: down-left, up-right. Zeros x=2,0,2x=-2,0,2, each multiplicity 11 (the graph crosses at each). The curve below shows all three crossings.

Example
A repeated zero: f(x)=(x+1)2(x2)=x33x2f(x)=(x+1)^2(x-2)=x^3-3x-2

Zeros x=1x=-1 (multiplicity 22, the graph touches and turns) and x=2x=2 (multiplicity 11, the graph crosses). Odd degree, positive lead: down-left, up-right.

Example
An even-degree graph: f(x)=x45x2+4f(x)=x^4-5x^2+4

Even degree, positive lead: both ends up. Four real zeros at x=2,1,1,2x=-2,-1,1,2 (each crossing).

Tip

Remember: The number of real zeros can be less than the degree---some zeros may be complex, appearing as “missing” xx-intercepts even though the Fundamental Theorem still counts them.

Going Deeper: Advanced Polynomial Ideas

Concept
Vieta's formulas: roots to coefficients

For a monic polynomial with roots r1,,rnr_1,\dots,r_n (repeated by multiplicity), expanding (xri)\prod (x-r_i) shows that the elementary symmetric functions of the roots are the coefficients, with alternating signs. For a cubic x3+bx2+cx+dx^3+bx^2+cx+d with roots r1,r2,r3r_1,r_2,r_3:

r1+r2+r3=b,r1r2+r1r3+r2r3=c,r1r2r3=d.r_1+r_2+r_3=-b,\quad r_1r_2+r_1r_3+r_2r_3=c,\quad r_1r_2r_3=-d.

For a quartic x4+bx3+cx2+dx+ex^4+bx^3+cx^2+dx+e with roots r1,r2,r3,r4r_1,r_2,r_3,r_4:

ri=b,i<jrirj=c,i<j<krirjrk=d,r1r2r3r4=e.\sum r_i=-b,\quad \sum_{i<j} r_ir_j=c,\quad \sum_{i<j<k} r_ir_jr_k=-d,\quad r_1r_2r_3r_4=e.

Non-monic: for leading coefficient ana_n, divide through first---each symmetric function is (1)kank/an(-1)^k a_{n-k}/a_n.

Example
Using Vieta without finding the roots

The roots of x36x2+11x6x^3-6x^2+11x-6 satisfy r1+r2+r3=6r_1+r_2+r_3=6,  r1r2+r1r3+r2r3=11\ r_1r_2+r_1r_3+r_2r_3=11, and r1r2r3=6r_1r_2r_3=6. Find r12+r22+r32r_1^2+r_2^2+r_3^2 without solving. Use the identity

r12+r22+r32=(ri)22 ⁣i<jrirj=622(11)=14.r_1^2+r_2^2+r_3^2=\Big(\textstyle\sum r_i\Big)^2-2\!\sum_{i<j} r_ir_j = 6^2-2(11)=14.

(Check: the roots are 1,2,31,2,3, and 1+4+9=141+4+9=14.) Also 1r1+1r2+1r3=r1r2+r1r3+r2r3r1r2r3=116\dfrac{1}{r_1}+\dfrac{1}{r_2}+\dfrac{1}{r_3}=\dfrac{r_1r_2+r_1r_3+r_2r_3}{r_1r_2r_3}=\dfrac{11}{6}.

Concept
Power sums and Newton's identities

Let pk=r1k++rnkp_k=r_1^k+\cdots+r_n^k be the kkth power sum of the roots and let eke_k be the kkth elementary symmetric function (so e1=rie_1=\sum r_i, e2=i<jrirje_2=\sum_{i<j} r_ir_j, …). Newton's identities convert between them:

p1=e1,p2=e1p12e2,p3=e1p2e2p1+3e3,p_1=e_1,\quad p_2=e_1p_1-2e_2,\quad p_3=e_1p_2-e_2p_1+3e_3,
p4=e1p3e2p2+e3p14e4.p_4=e_1p_3-e_2p_2+e_3p_1-4e_4.

These let you compute rik\sum r_i^k from the coefficients alone---no roots needed.

Example
Power sums via Newton's identities

For x36x2+11x6x^3-6x^2+11x-6 we read off e1=6, e2=11, e3=6e_1=6,\ e_2=11,\ e_3=6. Then

p1=e1=6,p2=e1p12e2=66211=14,p3=e1p2e2p1+3e3=614116+36=36.\begin{aligned} p_1&=e_1=6,\\ p_2&=e_1p_1-2e_2=6\cdot6-2\cdot11=14,\\ p_3&=e_1p_2-e_2p_1+3e_3=6\cdot14-11\cdot6+3\cdot6=36. \end{aligned}

So r13+r23+r33=36r_1^3+r_2^3+r_3^3=36. (Check with roots 1,2,31,2,3: 1+8+27=361+8+27=36.)

Concept
Remainder of P(x)P(x) modulo (xa)(xb)(x-a)(x-b)

Dividing P(x)P(x) by a quadratic leaves a remainder of degree at most 11, say R(x)=mx+kR(x)=mx+k. Since P(x)=(xa)(xb)Q(x)+mx+kP(x)=(x-a)(x-b)Q(x)+mx+k, substituting the two roots kills the quotient term:

P(a)=ma+k,P(b)=mb+k.P(a)=ma+k,\qquad P(b)=mb+k.

Solve this 2×22\times2 linear system for mm and kk. The remainder is then

R(x)=P(a)P(b)ab(xa)+P(a),R(x)=\frac{P(a)-P(b)}{a-b}\,(x-a)+P(a),

a form of linear interpolation through the points (a,P(a))(a,P(a)) and (b,P(b))(b,P(b)).

Example
Remainder when dividing by (x1)(x2)(x-1)(x-2)

Find the remainder of P(x)=x503x+7P(x)=x^{50}-3x+7 upon division by (x1)(x2)=x23x+2(x-1)(x-2)=x^2-3x+2. Evaluate at the two roots:

P(1)=13+7=5,P(2)=2506+7=250+1.P(1)=1-3+7=5,\qquad P(2)=2^{50}-6+7=2^{50}+1.

Write R(x)=mx+kR(x)=mx+k. Then m+k=5m+k=5 and 2m+k=250+12m+k=2^{50}+1. Subtracting,

m=2504,k=5m=9250.m=2^{50}-4,\qquad k=5-m=9-2^{50}.

So the remainder is R(x)=(2504)x+(9250)R(x)=(2^{50}-4)x+(9-2^{50}).

Concept
Building a polynomial from finite differences

Tabulate a degree-nn polynomial at equally spaced inputs and take successive differences of the outputs. The nnth differences are constant and equal ann!a_n\cdot n! (for step size 11), while the (n+1)(n+1)th differences are 00. This both detects the degree and reconstructs the leading coefficient.

x01234ff0f1f2f3f4Δf1f0f2f1Δ2const if deg 2\begin{array}{c|ccccc} x & 0 & 1 & 2 & 3 & 4\\\hline f & f_0 & f_1 & f_2 & f_3 & f_4\\ \Delta & & f_1-f_0 & f_2-f_1 & \cdots & \\ \Delta^2 & & & \text{const if deg }2 & & \end{array}

More generally, n+1n+1 data points determine a unique polynomial of degree n\le n (interpolation).

Example
Recovering a polynomial from a table

A cubic ff gives the values f(0),,f(4)=1,2,11,34,77f(0),\dots,f(4)=1,\,2,\,11,\,34,\,77. Build the difference table:

f12113477Δ192343Δ281420Δ366\begin{array}{c|ccccc} f & 1 & 2 & 11 & 34 & 77\\ \Delta & & 1 & 9 & 23 & 43\\ \Delta^2 & & & 8 & 14 & 20\\ \Delta^3 & & & & 6 & 6 \end{array}

Third differences are constant (66), confirming degree 33 with leading coefficient 6/3!=16/3!=1. Now fit f(x)=x3+bx2+cx+df(x)=x^3+bx^2+cx+d: from f(0)=1f(0)=1, d=1d=1; from f(1)=2f(1)=2 and f(2)=11f(2)=11,

1+b+c+1=2,8+4b+2c+1=11    b+c=0, 4b+2c=2,1+b+c+1=2,\qquad 8+4b+2c+1=11 \;\Rightarrow\; b+c=0,\ 4b+2c=2,

giving b=1, c=1b=1,\ c=-1. So f(x)=x3+x2x+1f(x)=x^3+x^2-x+1. (Check f(4)=64+164+1=77f(4)=64+16-4+1=77.)

Concept
Roots in arithmetic or geometric progression

When a problem promises the roots follow a pattern, choose symmetric variables so Vieta collapses nicely.

  • [leftmargin=5mm,itemsep=1pt]
  • Arithmetic (three roots): write them rd, r, r+dr-d,\ r,\ r+d. Their sum is 3r3r, so rr equals 13(coeff. of x2)-\tfrac13(\text{coeff. of }x^2) immediately---the middle root is forced by the sum.
  • Geometric (three roots): write them rs, r, rs\dfrac{r}{s},\ r,\ rs. Their product is r3r^3, so rr is the cube root of the product of the roots.
Reminder — Vieta's formulas:r1+r2=ba,r1r2=car_1+r_2=-\frac{b}{a},\qquad r_1 r_2=\frac{c}{a}
Example
Cubic with roots in arithmetic progression

The roots of x312x2+39x28x^3-12x^2+39x-28 are in arithmetic progression. Let them be rd, r, r+dr-d,\ r,\ r+d. By Vieta the sum is 3r=123r=12, so r=4r=4: one root is exactly 44. Check: f(4)=64192+15628=0f(4)=64-192+156-28=0. Depress by (x4)(x-4) to get x28x+7=(x1)(x7)x^2-8x+7=(x-1)(x-7), so the roots are 1,4,71,4,7---indeed an arithmetic progression with common difference 33.

Concept
Rational Root Theorem with bounds and Descartes' Rule

Three tools sharply narrow the candidate list before you test anything.

  • [leftmargin=5mm,itemsep=1pt]
  • Rational Root Theorem: every rational root is ±pq\pm\dfrac{p}{q} with pa0p\mid a_0, qanq\mid a_n.
  • Upper/lower bounds (synthetic division): if you divide by xcx-c with c>0c>0 and the bottom row is all nonnegative, then cc is an upper bound---no root exceeds it. If you divide by xcx-c with c<0c<0 and the bottom row alternates in sign, then cc is a lower bound.
  • Descartes' Rule of Signs: the number of positive real roots equals the number of sign changes in P(x)P(x), or less by an even number. Apply to P(x)P(-x) for the count of negative real roots.
Example
Pruning candidates with Descartes and bounds

For P(x)=x34x2+x+6P(x)=x^3-4x^2+x+6: the sign pattern of the coefficients +,,+,++,-,+,+ has 22 changes, so there are 22 or 00 positive roots. Then P(x)=x34x2x+6P(-x)=-x^3-4x^2-x+6 has pattern ,,,+-,-,-,+ with 11 change, so exactly 11 negative root. Rational candidates are ±1,±2,±3,±6\pm1,\pm2,\pm3,\pm6. Testing x=1x=-1: 141+6=0-1-4-1+6=0---the guaranteed negative root. Depressing gives x25x+6=(x2)(x3)x^2-5x+6=(x-2)(x-3), so the two positive roots are 22 and 33, matching Descartes exactly. Dividing by x4x-4 leaves all-nonnegative entries, confirming 44 is an upper bound.

Tip

The “(ab)P(a)P(b)(a-b)\mid P(a)-P(b)” idea: for a polynomial PP with integer coefficients and any integers a,ba,b,

(ab)  P(a)P(b).(a-b)\ \big|\ P(a)-P(b).

This is because each akbka^k-b^k is divisible by aba-b. It is a powerful screening tool: e.g. if PP has integer coefficients and P(0)=3P(0)=3, P(4)=6P(4)=6, no integer nn with P(n)=0P(n)=0 can exist between them that violates n3\,n\mid 3\, and (n4)3\,(n-4)\mid 3. It also proves that a polynomial taking the value 11 at three distinct integers can never equal 00 at an integer.

Formulas, Proofs & Tips

Tip
Remainder and Factor theorems
P(x)=(xc)Q(x)+P(c)(xc)P(x)    P(c)=0P(x)=(x-c)Q(x)+P(c) \quad\Longrightarrow\quad (x-c)\mid P(x) \iff P(c)=0

What it means. Dividing PP by xcx-c leaves remainder P(c)P(c); so xcx-c is a factor exactly when cc is a root.

Example. P(x)=x25x+6P(x)=x^2-5x+6: P(2)=0P(2)=0, so x2x-2 is a factor.

Why it works. Division gives P(x)=(xc)Q(x)+rP(x)=(x-c)Q(x)+r with rr constant (its degree is below 11). Substituting x=cx=c kills the first term and leaves P(c)=rP(c)=r.

Tip. Testing a possible root is one substitution — far faster than doing the division.

Tip
Vieta's formulas
r1+r2=ba,r1r2=car_1+r_2=-\frac{b}{a},\qquad r_1 r_2=\frac{c}{a}

What it means. The sum and product of a quadratic's roots read straight off its coefficients.

Example. x27x+12=0x^2-7x+12=0: the roots sum to 77 and multiply to 1212, so they are 33 and 44.

Why it works. If r1,r2r_1,r_2 are the roots then ax2+bx+c=a(xr1)(xr2)=a(x2(r1+r2)x+r1r2)ax^2+bx+c=a(x-r_1)(x-r_2)=a\left(x^2-(r_1+r_2)x+r_1r_2\right). Matching coefficients gives both formulas.

Tip. Great for "find the sum of the roots" questions — you never have to solve the equation.