Sub topic 3
Constants and Coefficients
This chapter assumes you can do arithmetic with integers and fractions, including negative numbers, and that you know the order of operations. It also assumes you have met variables as letters that stand for numbers. Here you will learn to name the two kinds of number that appear in an expression: constants and coefficients. Reading them correctly is the first step toward spotting terms and combining like terms.
Constants: numbers that never change
A constant is a number written on its own, with no variable attached. Its value is fixed. In the expression below, the numbers 7 and -4 are constants.
5x + 7 - 4Here 5 is not a constant, because it is attached to the variable x. Only 7 and -4 stand alone.
Two details are easy to miss.
- The sign belongs to the constant. In
5x + 7 - 4, the constant is -4, not 4. Subtraction is the same as adding a negative number. - A constant can be a fraction, a decimal, or a number such as pi. In
x + 1/2, the constant is 1/2.
An expression can have several constants, and they can be added together. The expression 5x + 7 - 4 has the same value as 5x + 3, because 7 + (-4) = 3. This works because constants are all "like" each other. Chapter by chapter, you will see that this is the simplest case of combining like terms.
Coefficients: the number multiplying a variable
A coefficient is the number that multiplies a variable. In 5x, the coefficient of x is 5. The notation 5x means 5 times x. We omit the multiplication sign to keep expressions short.
3x + 2y - 8In this expression:
- The coefficient of x is 3.
- The coefficient of y is 2.
- The constant is -8.
A coefficient answers the question "how many of this variable do we have?" If x stands for the price of one apple, then 3x is the price of three apples.
Coefficients that are not written
Two cases cause most of the confusion. In both, the coefficient is there but you cannot see it.
| Written | Coefficient | Why |
|---|---|---|
| `x` | 1 | `x` means `1·x`. Multiplying by 1 changes nothing, so we leave the 1 out. |
| `-x` | -1 | `-x` means `-1·x`. The minus sign is the coefficient's sign. |
| `-y + 4` | -1 (for y) | The same rule applies when the term is not first. |
When you combine terms, you must put these hidden 1s back. For example, in 3x + x, the second term has coefficient 1, so the sum is 3 + 1 = 4 and the result is 4x. A common slip is to write 3x + x = 3x, which loses the second term.
Coefficients that are fractions or decimals
A coefficient can be any real number.
- In
x/2, the coefficient is 1/2, becausex/2means(1/2)·x. - In
0.75y, the coefficient is 0.75. - In
(2/3)z, the coefficient is 2/3.
Division by a number is the same as multiplying by its reciprocal, so a fraction such as x/4 is read as a coefficient of 1/4.
Coefficients can be negative
The sign in front of a term goes with its coefficient. In 4x - 6y, the coefficient of y is -6, not 6. Reading -6y as "subtract 6y" and as "add -6y" gives the same value. Many errors in later chapters come from dropping this sign, so practice attaching each sign to the number that follows it.
Telling constants and coefficients apart
The same number can play either role depending on what is next to it. Look at what the number touches.
9x + 9The first 9 is a coefficient, because it multiplies x. The second 9 is a constant, because nothing multiplies it. They look identical but do different jobs.
The diagram below shows how to decide.
What about exponents?
An exponent is not a coefficient. In 4x^2, the coefficient is 4 and the exponent is 2. The exponent tells you how many times x is multiplied by itself, so 4x^2 means 4·x·x. The coefficient multiplies the whole power x^2.
Be careful with (4x)^2. Here the parentheses mean the whole product is squared, so it equals 16x^2 and the coefficient is 16. Without the parentheses, only x is squared.
Several variables in one term
A term can contain more than one variable. In 6xy, you can read the coefficient as 6, and the variable part as xy. In general, the coefficient is the numerical factor, and everything else is the variable part. Some textbooks also call 6 "the coefficient of xy", and call 6x "the coefficient of y" when they want to treat x as a number. At this level, use the simple rule: the coefficient is the number multiplied in front.
Worked examples
Example 1: label every part
Expression: -2a + 5b - a + 9
- Constants: 9. There is only one stand-alone number.
- Coefficient of the first a term: -2.
- Coefficient of b: 5.
- Coefficient of the second a term: the term
-ahas the hidden coefficient -1.
Notice that a appears twice. The coefficients -2 and -1 will later add to -3, giving -3a. You do not need to do that yet. For now, only name the parts.
Example 2: spot a hidden constant
Expression: x/3 - 0.5 + 2x
x/3has coefficient 1/3.2xhas coefficient 2.- The constant is -0.5.
The constant carries its minus sign, so it is -0.5 and not 0.5.
Example 3: a missing constant
Expression: 7x - 3y
This expression has no constant term. You may say its constant is 0, because adding 0 changes nothing: 7x - 3y + 0. Both views are acceptable, but you should know the second one, since it helps when you compare expressions later.
Checking your reading with code
SymPy, a Python library for symbolic math, can pull out coefficients. The method coeff returns the coefficient of a given variable, and as_coeff_Add splits an expression into its constant and the rest. Install SymPy with pip install sympy if you do not have it.
from sympy import symbols
x, y = symbols('x y')
expr = 3*x + 2*y - 8
print(expr.coeff(x)) # 3
print(expr.coeff(y)) # 2
print(expr.as_coeff_Add()[0]) # -8, the constantThe coeff method also handles the hidden 1 and the hidden -1.
from sympy import symbols
x, y = symbols('x y')
expr = x - y + 4
print(expr.coeff(x)) # 1
print(expr.coeff(y)) # -1
print(expr.as_coeff_Add()[0]) # 4Note that as_coeff_Add() returns a pair. The first item is the constant part, and the second is everything else. If the expression has no constant, the first item is 0.
from sympy import symbols
x, y = symbols('x y')
expr = 7*x - 3*y
print(expr.as_coeff_Add()) # (0, 7*x - 3*y)Use this as a way to check your hand work. Write down the coefficients and constant first, then run the code and compare.
Why this matters for combining
Constants combine with constants. Coefficients of the same variable combine by adding. These two facts are the whole idea of combining like terms, and the later chapters build on them.
Common errors
- Forgetting the hidden 1. Writing the coefficient of x in
x + 5as 0 or "none" instead of 1. - Losing the sign. Reading the constant in
3x - 7as 7 instead of -7. - Treating the exponent as the coefficient. In
x^3, the coefficient is 1 and the exponent is 3. - Calling a number a coefficient when it stands alone. In
2x + 6, the 6 is a constant. - Mixing up
-x^2and(-x)^2. The first has coefficient -1 and equals-1·x^2. The second equalsx^2, with coefficient 1.
Practice
Exercise
List the coefficient of each variable and the constant in -4m + n - 6 + 2m/5.
Show answer
There are three variable terms and one constant. The coefficient of the first m term is -4. The coefficient of n is 1, because n means 1·n. The term 2m/5 has coefficient 2/5. The constant is -6, with its minus sign.
Exercise
In the expression 8 - x, what is the coefficient of x, and what is the constant?
Show answer
The coefficient of x is -1, because -x means -1·x. The constant is 8. The order of the terms does not change this: the expression equals -x + 8.
Exercise
What is the coefficient in (3x)^2, and how does it differ from the coefficient in 3x^2?
Show answer
(3x)^2 equals 9x^2, so its coefficient is 9. In 3x^2, only x is squared, so the coefficient stays 3.