A linear function of x is a function of the form y = ax + b, where a
and b are constants. It's called a "linear" function because a
plot of the x and y coordinates for which this equation is true takes the shape
of a straight line.
Here's an example of a table of x and y values similar to
ones in (my son) Matthew's 6th grade math book:
x 
y 
7 
13 
10 
20 
13 
27 
22 
____ 
28 
____ 

The student is supposed to see a pattern, and fill in the blanks, then write
an equation for calculating the values in the table.
Here is the procedure for solving this type of problem.
 Start by assuming the relationship between x and y is linear. That
means whenever x increases by some specific amount (the xincrement), y will
increase by some other specific amount (the yincrement). The
yincrement depends only on the xincrement, not the value of x.
 Look for a basic xincrement. The first two x values differ by
3. The next two differ by 3. The next difference is 9, and the
final difference is 6. These are all multiples of 3, so the basic
xincrement is 3.
 Look for the ratio of the yincrement to the xincrement. Do this
using two rows of the table that have both x and y values shown.
Calculate the xincrement for these two rows by subtracting the x
values. Calculate the yincrement by subtracting the two y
values. Divide the yincrement by the xincrement to get the ratio of
the yincrement to the xincrement. In the example above, using the
first two rows, the xincrement is 10  7, or 3. The yincrement is 20
 13, or 7. The ratio of the yincrement to the xincrement is
7/3. This means when the xincrement is 3, the yincrement is 7, which
is the basic yincrement.
 Check to see if the x values are multiples of the xincrement by dividing
the lowest x value by the basic xincrement, and looking at the
remainder. In our example, the lowest x value is 7. 7 divided by
the basic xincrement, 3, is 2 with a remainder of 1. I'll call this
the xconstant.
 At this point, you are almost ready to calculate the yvalue for any
xvalue. Here's the procedure:
 Start with the xvalue.
 Subtract the xconstant.
 Divide by the basic xincrement.
 Multiply by the basic yincrement.
 Add the yconstant.
 This gives you the yvalue.

In our example, let's start with the first xvalue, 7.
Subtracting the xconstant, 1, leaves 6.
Dividing by the basic xincrement, 3, gives 2.
Multiplying by the basic yincrement, 7, gives 14.
Now add the yconstant  wait a minute! What's the yconstant?
The next step answers that question:
 To find the yconstant, use a row of the table that has both an
"x" and "y" value filled in. Now do the procedure,
above, through step "e". Subtract the result from the actual
yvalue to get the yconstant. If the result of step e is bigger than
the actual yvalue, then the yconstant is a negative number. In our
example, the result of step "e" was 14, and the actual yvalue is
13 so the yconstant is 1.
So far I've taught you how to get the yvalue if you know the xvalue.
Suppose it's the other way around. What do you do if you know the
yvalue, but not the xvalue? It's simple. Just do the same
procedure, just switching the x's and y's.
 Here's how to find the xvalue if you know the yvalue:
 Start with the yvalue.
 Subtract the yconstant.
 Divide by the basic yincrement.
 Multiply by the basic xincrement.
 Add the xconstant.
 This gives you the xvalue.

In our example, let's start with the first yvalue, 13.
Subtract the yconstant, 1 (remember subtracting a negative is really
adding) giving 14.
Divide by the basic yincrement, 7, giving 2.
Multiply by the basic xincrement, 3, giving 6.
Add the xconstant, 1, giving 7, which is the right answer!
 Now to write the formula, it's simple:
y = yincrement/xincrement * (x  xconstant) + yconstant
In our example, the formula is this:
y = 7 / 3 * (x  1)  1
Do you have any questions about this procedure? Send me
an email.
Related pages in this website
Procedures
Matrix Math  a way of solving much more
complicated linear systems involving several variables. This section
includes determinants, the Reduced Row Echelon method, also called
GaussJordan Elimination and Cramer's rule.
The webmaster and author of this Math Help site is
Graeme McRae.