Mathematics 1Week 4 · Polynomial Functions, Division Algorithm and Zeros
Week 4 Notes
Mathematics for Data Science 1
Polynomial functions: definition and classification, addition, subtraction, multiplication and division of polynomials, the division algorithm, the shape of their graphs, and zeros.
8 chapters~23 min read
PolynomialsAlgebra of polynomialsDivision algorithmZeros
A polynomial is a mathematical expression that consists of numerous mathematical terms added together.
The mathematician's view
A polynomial is an algebraic expression in which the only arithmetic is addition, subtraction, multiplication and “natural” exponents of the variables.
The word polynomial comes from polynomen: poly means many and nomen means name. In this chapter we deal only with polynomials in a single variable.
Definition: polynomial functionA polynomial functionf(x) of degree n is
f(x)=anxn+an−1xn−1+an−2xn−2+⋯+a0x0,an=0,n∈N
Figure 1. The general form of a polynomial function: terms with decreasing powers of x, the first coefficient not zero
Reading the diagram
Each box is one term: a number (the coefficient) times a power of x. The highest power, n, is the degree, and its coefficient an must not be zero, otherwise that term would vanish and the degree would be smaller. The last term has power 0, because x0=1.
Domain: all real numbers
A polynomial function can be treated as a function from R to R, so its domain is R.
Range: depends on f(x)
The range is not the same for every polynomial; it depends on the particular function f(x).
1.1Reading the definition: what is and is not a polynomial
Only addition, subtraction, multiplication and natural-number exponents are allowed. This decides what is and is not a polynomial.
Expression
Polynomial?
Why
5x3+x2+x
Yes
Natural exponents 3, 2, 1 combined by addition
2x+4
Yes
Exponents 1 and 0
7
Yes
A constant: 7x0
1/x
No
Division by the variable means the exponent −1, which is not natural
x
No
It is x1/2, and 1/2 is not a natural exponent
The slides have a heading “Example: Identification of a polynomial” but the example itself is blank in the PDF. The table above only applies the definition given on the slides.
1.2Going deeper
Coefficients can be any real numbers (including fractions and negatives); only the exponents must be natural numbers (extra remark).
A polynomial function gives one output per input. Put in x=2 in 5x3+x2+x: 40+4+2=46.
Why the first coefficient cannot be 0. If an=0 the term vanishes and the polynomial has a smaller degree, as with a=0 in the quadratic of Week 3.
Exam tips
Check each exponent: whole number, non-negative, and no variable in a denominator or under a root.
Common mistakes
Calling 1/x or x a polynomial.
Forgetting that a constant such as 7 is a polynomial.
Polynomials can be sorted in three ways: by the number of variables, by the degree, and by the number of terms.
2.1Based on the number of variables
Type of polynomial
Example
Polynomial in one variable
5x3+x2+x
Polynomial in two variables
5x3y+x2+xy
Polynomial in more than two variables
5x3yz+x2zy+xy
2.2Based on the degree
Degree of a variable in one term
The exponent on the variable in a term. In x5y4 the degree of x is 5.
Degree of a term
Add the degrees of all the variables in the term. The degree of x5y4 is 5+4=9.
Degree of the polynomial
The highest degree of any term with a non-zero coefficient. For f(x)=x3+x10 the degree is 10.
The zero polynomial
The degree of the zero polynomial is undefined.
Example 1: degrees in x³ + x⁵y⁴
For the polynomial in two variables x3+x5y4, find the degree of each term and of the polynomial.
Term x3: the only variable is x, with degree 3, so the term has degree 3.
Term x5y4: the degrees are 5 and 4, so the term has degree 5+4=9.
Polynomial: the highest term degree is 9, so the polynomial has degree 9.
The lecture gives the degrees of the term x5y4; the degree of the whole expression follows from the rule stated above. Polynomials are named by their degree:
Degree
Name
Examples
0
Constant polynomial
5,6,e,π
1
Linear polynomial
2x+4,−3x
2
Quadratic polynomial
2x2+4,−3x2
3
Cubic polynomial
2x3+4,−3x3
4
Quartic polynomial
2x4+4,−3x4
Link to earlier weeksLinear polynomials are the straight lines of Week 2 and quadratic polynomials are the parabolas of Week 3. Week 4 studies polynomials of any degree.
2.3Based on the number of terms
Name
Explanation
Examples
Monomial
Polynomial with one term
x10,6x9,e,5+4
Binomial
Polynomial with two terms
x10+10,6x9−x2,x2+3x+x
Trinomial
Polynomial with three terms
x10+x2+10,6x9−x2+2,x2+x+e
Like terms are combined before counting: 5+4 is the single term 9 (a monomial) and x2+3x+x is x2+4x (a binomial). These are the lecture's own examples; the remark explains why they sit in those rows.
2.4Going deeper
For one variable, the degree is just the largest exponent with a non-zero coefficient: 3x4−2x+7 has degree 4.
Constants other than 0 have degree 0 (7=7x0); only the zero polynomial has no degree.
Names combine.x3+x is a cubic binomial in one variable.
Exam tips
Combine like terms first, then count terms and find the degree.
When two polynomials are added, the like terms are combined: terms with the same variable and the same exponent.
Addition algorithmLet p(x)=∑k=0nakxk and q(x)=∑j=0mbjxj. Then
p(x)+q(x)=k=0∑m∨n(ak+bk)xk
Here m∨n denotes whichever of m and n is the maximum. If one polynomial is shorter, its missing coefficients are taken as 0.
Example 2: sum of two general cubics
Both have degree 3, so m∨n=3. Expand the sum over k=0,1,2,3:
(a3+b3)x3+(a2+b2)x2+(a1+b1)x+(a0+b0)
Example 3: sum of two numerical cubics
Find the sum of p(x)=x3+3x2+5x−10 and q(x)=3x3+5x2−6x−20.
List the coefficients by powera3,a2,a1,a0=1,3,5,−10 and b3,b2,b1,b0=3,5,−6,−20.
Add the coefficients of each power.
x³
x²
x
x⁰
p(x)
1
3
5
−10
q(x)
3
5
−6
−20
p + q
1 + 3 = 4
3 + 5 = 8
5 + (−6) = −1
−10 + (−20) = −30
Answer
4x3+8x2−x−30
Check by substitutionPut x=1 into everything: p(1)=1+3+5−10=−1, q(1)=3+5−6−20=−18, and the sum at x=1 is 4+8−1−30=−19=−1+(−18). A sum of polynomials always has the sum of their values. This check is added; the slides only show the addition algorithm.
3.2Subtraction
Subtraction algorithmWith p and q as above, p(x)−q(x)=∑k=0m∨n(ak−bk)xk. It works exactly like addition: subtract the coefficients of like terms.
Example 4: subtract −3x² + 2x − 2 from x³ + 2x² + 8x
Subtract q(x)=−3x2+2x−2 from p(x)=x3+2x2+8x.
Fill in the missing coefficients with zero so that both polynomials have the same powers: p has no constant term, q has no x3 term.
x³
x²
x
x⁰
p(x)
1
2
8
0
q(x)
0
−3
2
−2
Subtract power by power.
x³
x²
x
x⁰
p − q
1 − 0 = 1
2 − (−3) = 5
8 − 2 = 6
0 − (−2) = 2
Answer
p(x)−q(x)=x3+5x2+6x+2
Common slipSubtracting a negative coefficient adds it: 2−(−3)=5, and 0−(−2)=+2. Write the missing coefficients as 0 first so that nothing is left out.
3.3Going deeper
The degree of a sum can drop.(x3+x)+(−x3+2) has degree 1, because the x3 terms cancel (extra remark).
The degree of a sum is at most the larger degree, so polynomials stay polynomials under addition and subtraction.
Vertical layout. Line up the powers in columns, as in the tables above, and work column by column.
Exam tips
Write the powers in descending order and fill every gap with 0.
Check the answer at x=1: the coefficients add to the values.
Common mistakes
Forgetting to change every sign of the second polynomial when subtracting.
Multiplication algorithmLet p(x)=∑k=0nakxk and q(x)=∑j=0mbjxj. Then
p(x)q(x)=k=0∑m+n(j=0∑kajbk−j)xk
The coefficient of xk is the sum of all products ajbk−j whose subscripts add up to k. Coefficients beyond the degree (aj=0 for j>n and bj=0 for j>m) count as 0.
A discrepancy in the slideThe slides print the inner term as (aj−bk−j) with a minus sign, but their own table of calculations uses the products ajbk−j. The formula above follows the table.
Why the subscripts add to k
A term ajxj times a term bixi gives ajbixj+i. So the product has an xk term exactly when j+i=k, that is i=k−j. This reason is added to explain the formula; the slides state only the formula.
Example 5: multiply x² + x + 1 by x² + 2x + 1
List the coefficients (the degree is 2 for both, so k runs from 0 to 2+2=4, and all coefficients beyond k=2 are 0):
k
0
1
2
a_k
1
1
1
b_k
1
2
1
For each k add all products with subscripts adding to k:
k
Coefficient
Calculation
0
a₀b₀
1
1
a₁b₀ + a₀b₁
1 + 2 = 3
2
a₀b₂ + a₁b₁ + a₂b₀
1 + 2 + 1 = 4
3
a₀b₃ + a₁b₂ + a₂b₁ + a₃b₀
0 + 1 + 2 + 0 = 3
4
a₀b₄ + a₁b₃ + a₂b₂ + a₃b₁ + a₄b₀
0 + 0 + 1 + 0 + 0 = 1
Write the answer. The coefficients 1, 3, 4, 3, 1 are those of x0,x1,x2,x3,x4:
Answer
(x2+x+1)(x2+2x+1)=x4+3x3+4x2+3x+1
Check by substitutionAt x=1: p(1)=3 and q(1)=4, so the product is 12; the coefficients 1+3+4+3+1 also add to 12. The check at x=1 is added; the slides do not include it.
4.1Going deeper
The degree of a product is m+n. Here 2+2=4. The leading coefficient is anbm (extra remark).
It is just distributing. The formula is the rule “multiply every term of one polynomial by every term of the other, then combine like terms” written with subscripts.
Check by counting. A product of a 3-term and a 3-term polynomial has 3×3=9 products before combining.
Exam tips
Make a table of ak and bk and work down k=0,1,2,…,m+n.
Check with x=1: the product of the values equals the sum of the coefficients.
Common mistakes
Multiplying coefficients only on the same power (that is addition's rule).
Definition: polynomial divisionThe division of a polynomial by a monomial, binomial or another polynomial, using various methods, is known as polynomial division. One method is the division algorithm (long division) below.
5.1Terminology
Figure 2. The four parts of a division, shown for p(x) = x⁴ + 2x² + 3x + 2 divided by q(x) = x² + x + 1
Reading the diagram
Dividing p(x) (the dividend) by q(x) (the divisor) gives a quotient h(x) and a remainder r(x). Written as a fraction, q(x)p(x)=x2−x+2+q(x)2x. Multiplying by q(x) gives p(x)=q(x)h(x)+r(x).
5.2The division algorithm
Arrange the terms in descending order of the degree and add the missing exponents with 0 as coefficient.
Divide the first term of the dividend by the first term of the divisor to get a monomial.
Multiply the monomial with the divisor and subtract the result from the dividend.
Check whether the resulting polynomial has degree less than the divisor. If true, write it as the remainder; otherwise go back to Step 2.
Why Step 1 mattersMissing powers are written with coefficient 0 so that every column lines up. For example x4+2x2+3x+2 is arranged as x4+0x3+2x2+3x+2.
5.3Worked example: x⁴ + 2x² + 3x + 2 divided by x² + x + 1
Example 6: long division, step by step
Figure 3. The same division laid out as a long division: the quotient on top, each product being subtracted under the line above it, and the remainder at the bottom
Stop. The remainder 2x has degree 1, which is less than the degree 2 of the divisor.
x4+2x2+3x+2=(x2+x+1)(x2−x+2)+2x
Answer
Quotient x2−x+2, remainder 2x.
CheckMultiply back: (x2+x+1)(x2−x+2)=x4+0x3+x2+x+2, and adding the remainder 2x gives x4+2x2+3x+2, the dividend. The multiplying-back check is added; the slides show the long division and the quotient and remainder only.
5.4Lecture examples
Example 7: quotient of x⁵ − 4x⁴ + 3x³ + 3x² − 4 by (x − 2)²
If p(x)=x5−4x4+3x3+3x2−4 and q(x)=(x−2)2, then q(x)p(x) is
(a) x3+x+1
(b) x4−x2−1
(c) x3−x−1
(d) x4−x2+1
Expand the divisor:q(x)=(x−2)2=x2−4x+4. Arrange the dividend with the missing x term: x5−4x4+3x3+3x2+0x−4.
Figure 4. Long division of the degree 5 polynomial: the remainder is 0
Answer
The remainder is 0, so the division is exact and the quotient is x3−x−1: option (c).
Why not the othersThe degree of the quotient is the degree of p minus the degree of q, 5−2=3, so (b) and (d), which have degree 4, cannot be right. Between (a) and (c): round 1 leaves −x3+3x2−4, so the next quotient term is −x3÷x2=−x, negative; option (a) has +x, so it is ruled out.
Example 8: what should be subtracted from 6x⁴ + 5x³ + 4x − 4 to make it divisible by 2x² + x − 1?
(a) 4x
(b) 4x−3
(c) 6x−3
(d) 2x−3
Idea
Divide P(x) by the divisor. If the remainder is subtracted from P(x), what is left has no remainder, so it is divisible.
Figure 5. Long division of the degree 4 polynomial: quotient 3x² + x + 1 and remainder 4x − 3
Answer
The remainder is 4x−3 (degree 1, less than 2). Hence 4x−3 should be subtracted: option (b).
Check: (6x4+5x3+4x−4)−(4x−3)=6x4+5x3−1=(2x2+x−1)(3x2+x+1). The last line is added as a check of the answer; the slides stop at the remainder.
Example 9: degrees of the quotient and the remainder
Dividing p(x) by q(x) gives quotient h(x) and remainder r(x). (a) What is the maximum degree of r(x)? (b) If degp(x)<degq(x), which statements are correct: h(x)=0; degh(x)=degq(x); degr(x)=degq(x); degr(x)=degp(x)?
(a) The division stops only when the remainder has degree strictly less than the divisor. So the maximum degree of r(x) is degq(x)−1.
(b) If p has smaller degree than q, no division round can even begin, so the quotient is the zero polynomial, h(x)=0, and the remainder is p(x) itself, so degr(x)=degp(x). The correct statements are h(x)=0 and degr(x)=degp(x).
A note on the slideThe slides write “degh(x)=0” for the zero quotient, although elsewhere they say the degree of the zero polynomial is undefined. The meaning is simply that the quotient is the zero polynomial.
Remainder
degr(x)<degq(x), so at most degq(x)−1.
Small dividend
degp<degq: quotient h(x)=0 and remainder r(x)=p(x).
Example 10: find a so that two polynomials leave the same remainder
The polynomials x3+ax2+5x+7 and x3+2x2+3x+2a leave the same remainder when divided by x−2. Find a.
Idea
The remainder on division by x−2 is the value of the polynomial at x=2. So both polynomials must have the same value at x=2.
First polynomial at x=2: 8+4a+10+7=4a+25.
Second polynomial at x=2: 8+8+6+2a=2a+22.
Equate them:
4a+25=2a+22⇒2a=−3⇒a=−23
Check. With a=−23 both values equal 4a+25=19 and 2a+22=19. The slides use this substitution idea directly (without naming it) and simply state that both polynomials must have the same value at x=2.
5.5Going deeper
Same as number long division.17=5×3+2 has the same shape as p=qh+r, with the remainder smaller than the divisor.
Dividing by x−a. The remainder is the constant p(a): that is the idea behind Example 10 (the remainder theorem, an extra name not used on the slides).
Zero remainder means divisible. In Example 7 the remainder is 0, so q is a factor of p.
Keep columns aligned. Write each product under the matching powers, as in the long-division figures.
Exam tips
After each subtraction, drop the leading term (it is zero) and bring down the rest.
Check with p=qh+r.
Common mistakes
Forgetting the 0 coefficient for a missing power.
Not changing every sign when subtracting the product.
Stopping too early, or too late: the remainder's degree must be below the divisor's.
Polynomial functions of second degree or higher have graphs that do not have sharp corners; they are smooth curves.
Continuous: no breaks
Polynomial functions have graphs that have no breaks. Curves with no breaks are called continuous.
6.1Which graphs are polynomial functions?
Example 11: spot the polynomial graphs
Which of the graphs below represent polynomial functions?
Figure 6. The four graphs of the question, redrawn: (a) a smooth curve, (b) a straight line, (c) a V with a sharp corner at x = 0, (d) a curve with a break
(a) A smooth curve with no break: it represents a polynomial function.
(b) A straight line, which is smooth and continuous: it represents a polynomial function.
(c) It has a sharp corner at x=0, so it is not a polynomial function.
(d) It is not continuous (the curve is broken), so it is not a polynomial function.
Answer
The graphs in options (a) and (b) represent polynomial functions.
A note on the figureThe four graphs are redrawn from the lecture's picture, so the exact shapes are approximate; what matters is the smoothness and continuity of each.
Option
Smooth?
Continuous?
Polynomial?
(a)
Yes
Yes
Yes
(b)
Yes
Yes
Yes
(c)
No: sharp corner at x = 0
Yes
No
(d)
Yes
No: broken curve
No
6.2Going deeper
A pencil test. If you can trace the whole graph without lifting the pencil (continuous) and without a sharp turn (smooth), it could be a polynomial.
These are necessary, not sufficient. Every polynomial graph is smooth and continuous, but a smooth continuous graph such as y=2x is not a polynomial (extra remark).
The V is ∣x∣. The absolute value has a sharp corner at 0, so it is not a polynomial function (extra remark).
Exam tips
Look for corners and breaks first.
Common mistakes
Calling a straight line not a polynomial (it is a degree 1 polynomial).
Definition: zerosIf f is a polynomial function, the values of x for which f(x)=0 are called the zeros of f.
Factor method: set each factor to zero
If the equation of the polynomial function can be factored, set each factor equal to zero and solve for the zeros.
A zero gives a factor: x = a gives (x − a)
Any value x=a that is a zero of a polynomial function yields a factor of the polynomial of the form (x−a).
x-intercepts
At an x-intercept the output value is zero. So to find the x-intercepts of the graph, find the input values whose output is zero: the zeros of f.
7.1Illustrations
Example 12: zeros and factors of two polynomials
Find the zeros of f(x)=x2+2x−24=(x−4)(x+6) and of g(x)=(x+2)(x−1)(x−3), and show them on the graph.
f: set each factor to zero: x−4=0 gives x=4, and x+6=0 gives x=−6.
g:x+2=0, x−1=0, x−3=0 give x=−2,1 and 3.
Figure 7. The zeros are the x-intercepts: where each graph meets the x-axis. Each zero a matches a factor (x − a). Left: f(x) = x² + 2x − 24. Right: g(x) = (x + 2)(x − 1)(x − 3)
Polynomial
Zeros
Factors
x2+2x−24
4, −6
(x−4)(x+6)
x3−2x2−5x+6
−2, 1, 3
(x+2)(x−1)(x−3)
Checkg(x)=x3−2x2−5x+6 since (x+2)(x−1)=x2+x−2 and (x2+x−2)(x−3)=x3−2x2−5x+6. And g(−2)=g(1)=g(3)=0. These two examples are illustrations of the facts above; the slides state the facts without an example. The first polynomial is the one of Week 3, whose roots were found by factoring.
7.2Finding zeros in general
Quadratic: degree 2
Use the quadratic formula (Week 3).
Cubic and quartic: degrees 3 and 4
Formulas exist, but they are not simple enough to remember.
Higher degrees: general case
Formulas do not exist for general higher-degree polynomials.
For general polynomials, finding the zeros can be a challenging problem. Factoring is the main tool available when the polynomial factors.
7.3Going deeper
The number of zeros. A polynomial of degree n has at most n zeros: f (degree 2) has 2, g (degree 3) has 3 (extra remark).
Zero to factor and back. From the zero x=−6 you write the factor (x+6): the sign flips.
The graph and the zeros. A graph can also miss the x-axis completely, as x2+2x+5 does: no real zeros (Week 3, discriminant −16).