### Linear functions

Click here to review functions. Linear functions are the simplest of all the types of functions. A linear function takes a number x as input and returns the number m x + b as output:
m and b are constants. In words, x gets multiplied by m (this is called a scaling by factor m) and then gets b added on (this is called a shift by an amount b). Using function notation the linear function looks like this:
f (x) = m x + b.
If we let y = f (x) then it looks like this:
y = m x + b.
This is called the equation of a straight line because if we plot the points that satisfy this equation on a graph of y versus x then, as we will see below, the points all lie on a straight line.

A typical use of a linear function is to convert from one set of units to another. A simple example is if i is a distance measured in inches and c is the same distance measured in centimeters; then c = 2.54 i. This is just a scaling. A more complicated example is if c is a temperature measured in celsius degrees and f is the same temperature measured in fahrenheit degrees; then f = 1.8 c + 32. This is a scaling and a shift.

### The equation of a straight line

In section 6.1 we introduced the cartesian plane with an x axis drawn horizontally and a y axis drawn vertically. Suppose that m and b are constants. We wish to graph the linear function:
y = m x + b,
on this plane and show that the graph is a straight line. To do this we make the following table of values of y (that is, of the expression m x + b ) versus x:

Notice the following:
• Each row of the table gives a point on the graph.

• One of the rows says that when x = 0 then y = b. Thus the point (0, b) is a point on the graph. Because this point lies on the y axis, the number b is called the y intercept.

• As we proceed from one row of the table to the next, the value of x increases by 1 and the value of y increases by m. Because the increase is steady, the points must lie on a straight line and not some other curve.

• The larger m is, the faster y increases. If m is negative then the value of y actually decreases. The number m is known as the slope.

• x does not have to be an integer - it can be any real number. Because the real numbers are dense the graphed points are infinitely close together and form a solid line (i.e. there are no gaps).
 Conclusion: The equation y = m x + b, where m and b are constants, is the equation of a straight line. m is called the slope and b is called the y intercept. This form of the equation is called the slope-intercept form. There are other possible forms; click here to see them.

### Finding the equation of a straight line

Given the graph of a straight line, there are several ways to find its equation.

Method 1: This method works only if the y intercept is visible.
• Find any two points, (x1y1) and (x2y2), on the line and substitute their coordinates into the following formula to get m:
• Get b from inspection of the y intercept of the graph.
• Substitute the numbers that you have obtained for m and b into the equation y = m x + b.

Method 2: This method works even if the y intercept is not visible.
• As in method 1, find any two points, (x1y1) and (x2y2), on the line and substitute their coordinates into the following formula to get m:
• Substitute the number that you obtained for m into the equation y = m x + b. Also, take one of the points, say (x1y1), and substitute its coordinates into the equation. This gives:
y1 = m x1 + b
• It may not look like it, but this equation has only one variable, b, and you can easily solve for it.
• Substitute the numbers that you have obtained for m and b into the equation y = m x + b.

Method 3: This method has the advantage that it uses only algebra, not geometry, and can be applied to any type of function, not just the straight line:

• Find two points, (x1y1) and (x2y2), that are on the line. Take the first point, (x1y1), and substitute it into the straight line equation, y = m x + b. This gives:
y1 = m x1 + b
Similarly, take the second point, (x2y2), and substitute it into the straight line equation, y = m x + b. This gives:
y2 = m x2 + b
• Together, these two equations constitute a system of two equations in the two unknowns, m and b. We can solve them for m and b using the elimination method. To be specific, if we subtract the first equation from the second, then b is eliminated and we get the equation:
y2y1 = m x2m x1,
which, when solved for m, gives the same equation as in the other two methods, namely:
• Find b by back-substitution. To be specific, substitute the number that you obtained for m into one equation of the system of equations, say into y1 = m x1 + b. It may not look like it, but this equation has only one variable, b, and you can easily solve for it.

Example: Use method 1 to find the equation of the straight line in the graph to the right.

Solution: Two points on this line are (x1, y1) = (0, 15) and (x2, y2) = (3, 0). Substituting these coordinates into the slope formula gives
= −5.
By inspection the y intercept is
b = 15.
Substituting these two values for m and b into the straight line equation, y = m x + b, gives
y = −5 x + 15.

Example: Use method 3 to find the equation of the straight line in the graph to the right.

Solution: Two points on this line are (7, 15) and (1, 3). Substitute the coordinates of the point (7, 15) into the equation of the straight line, y = m x + b, and then do the same thing for the point (1, 3). This gives a system of two equations in the two unknowns, m and b. Unknown b can be eliminated by subtracting the equations:
Solving for m gives m = 2. Backsubstituting m = 2 into, say, the first equation, gives 15 = 7 · 2 + b, which is easily solved to give b = 1. Substituting these two values for m and b into the straight line equation, y = m x + b, gives
y = 2 x + 1.

 Algebra Coach Exercises

If you found this page in a web search you won’t see the