## How do you find a linear function through two points?

The examples above demonstrate how to create points with a given slope between them. This is useful if we are given the function to begin with. However, we may also be given at least two points on the graph of the function and want to find the function’s formula. In this case we need to find the slope of the line passing through the points.

Suppose you are given two points (x_{1}, y_{1}), and (x_{2}, y_{2}), on a line. The slope of the line is found by calculating

When you use this formula be careful to subtract the *y* values in the numerator (the vertical change) and the *x* values in the denominator (the horizontal change). Also that you subtract in the proper order.

**Example 2 Find the Slope Between Two Points**

For each part, find the slope of the line passing through the two points.

a. (3, 1) and (5, 8)

**Solution ** Let (x_{1}, y_{1}) = (3, 1) and (x2, y2) = (5, 8) . Substitute these ordered pairs into the slope formula to yield

b. (-3, 2) and (4, -1)

**Solution ** Let (x_{1}, y_{1}) = (-3, 2) and (x2, y2) = (4, -1). Substitute these ordered pairs into the slope formula to yield

Once we have the slope between a pair of points, we can use the linear function form* f *(*x*) = *mx* + *b* to find the formula for the line.

**Example 3 Find the Function Passing Through Two Points**

Find the function for the line shown in the graph below.

**Solution ** To find the formula of the function *f* (*x*) = *mx* + *b*, we‘ll need to first find the slope between (x_{1}, y_{1}) = (2, 3) and (x_{2}, y_{2}) = (5, 2). The slope is

With this value for the slope, the linear function becomes *f* (*x*) = –^{1}/_{3} *x* + *b*. To find *b*, we must substitute one of the given points on the line into the function. If we input *x* = 2 into the function, the output should equal *y* = 3:

We can solve for b by solving . The first term simplifies to –^{2}/_{3}. Adding ^{2}/_{3} to both sides leads to b = ^{11}/_{3}. The function passing through the two points is

To check this function, substitute each point into the function to insure each *x* value yields the correct *y* value: