Sub topic 1
Terms, coefficients, and degree
Prerequisites
This chapter assumes you can evaluate algebraic expressions, add and subtract negative integers, and read exponents such as x^3. You should also know the distributive property: a(b + c) = ab + ac.
Terms, coefficients, and degree
A polynomial is a sum of terms. Each term is a number times a variable raised to a whole-number power, such as 3x^2. The number in front is the coefficient, so 3 is the coefficient of 3x^2. The degree of a single term is its exponent. The degree of the polynomial is the highest degree among its terms with a nonzero coefficient.
In 4x^3 - x + 7, the terms are 4x^3, -x, and 7. The coefficients are 4, -1, and 7. The degree is 3.
def degree(coeffs):
# coeffs[i] is the coefficient of x^i, constant term first
for i in range(len(coeffs) - 1, -1, -1):
if coeffs[i] != 0:
return i
return None # the zero polynomial has no degree
print(degree([1, 2, 3])) # 2, for 3x^2 + 2x + 1
print(degree([4, 0, 0])) # 0, for the constant 4Writing a polynomial in standard form
Standard form lists terms from highest degree to lowest. Write 7 - x + 4x^3 as 4x^3 - x + 7.
Recognizing like terms
Like terms have the same variable raised to the same power. 5x^2 and -2x^2 are like terms. 5x^2 and 5x are not, because their exponents differ. Constants such as 3 and -8 are like each other.
Adding polynomials
Add polynomials by combining like terms. Add their coefficients and keep the variable part:
(5x^2 + 2x + 1) + (x^2 - 6x + 4) = 6x^2 - 4x + 5
The distributive property as a tool
The distributive property removes parentheses. A sign in front of parentheses applies to every term inside. So -(x^2 - 3) = -x^2 + 3.
> Callout:
Exercise
Exercise
What are the coefficients and the degree of 5 - 3x^2 + x, written in standard form?
Show answer
In standard form the polynomial is -3x^2 + x + 5. The coefficients are -3, 1, and 5, and the degree is 2.