How to Write a Function Rule

In this lesson, you will learn to write a function rule using information given in a table.

In this lesson, you will learn

  • what a function rule is and which part is the input and which is the output
  • three steps to write a function rule from a table
  • how to use trial and error when the rule is harder to see
  • how to use slope and y = mx + b to write a function rule

What Is a Function Rule?

Examples of function rules: in y = 3x, C = 2πr and f(x) = x + 8, the letter on the left (y, C, f(x)) is the output and the letter on the right (x, r, x) is the input.

A function rule such as cost = p + 0.08p is an equation that describes a functional relationship.

cost = p + 0.08p

If p is the price of an item and 0.08 is the sales tax rate, the function rule above gives the total cost of the item.

In the rule cost = p + 0.08p, which quantity is the input?

Show answer

The price p. You choose the price, and the rule gives you the cost, so the cost is the output.

Writing a Function Rule From a Table

If you are given a table, usually you have to carefully examine the table to see what the function rule is.

Sometimes, it is easy to get the rule. Other times, it is not so easy. It may require some keen observation or using the concept of slope.

Rule

To write a function rule from a table, follow the same three steps each time.

  1. Show the relationship: find what math turns each input into its output.
  2. Define: choose a letter for the input and a letter for the output.
  3. Write the equation using those letters.

We will now show how to do this with some examples:

Example #1:

Suppose you are washing your clothes at a laundromat. The table below shows the relationship between number of loads and cost.

Write a function rule showing the relationship between number of loads and cost.

Number of loads12345
Cost3691215

First, show the relationship:

Cost is 3 × number of loads. For instance, 2 × 3 = 6

Second, define:

Let n be the number of loads

Let c be the cost.

Write the equation:

c = 3 × n

Example #2:

Write a function rule for the following situation:

Input12345
Output56789

First, show the relationship:

Output is 4 + input.

Second, define:

Let I = input

Let O = output.

Write the equation:

O = 4 + I

The inputs 1, 2, 3, 4 give the outputs 7, 14, 21, 28. Write a function rule. Use I for the input and O for the output.

Show answer

O = 7 × I. Each output is 7 times its input, for example 3 × 7 = 21.

A More Complicated Example Showing How to Write a Function Rule

Example #3:

Number of items soldRevenue
16
210
314
418
522

First, show the relationship:

It is not that easy to see what the relationship is in this case.

1 × 6 = 6. However, 2 × 6 is not equal to 10.

1 + 5 = 6. However, 2 + 5 is not equal to 10.

The function rule could be a combination of addition and multiplication.

You could pick a revenue say 10 for instance and ask yourself "What math should I do with the 2 to get this revenue?"

Trial and error can help.

My strategy of trial and error is shown below:

  • 2 × 1 + 8 = 10. However, 3 × 1 + 8 is not equal to 14. This rule does not work.
  • 2 × 2 + 6 = 10. However, 3 × 2 + 6 is not equal to 14. This rule does not work.
  • 2 × 3 + 4 = 10. However, 3 × 3 + 4 is not equal to 14. This rule does not work.
  • 2 × 4 + 2 = 10. Moreover, 3 × 4 + 2 is also equal to 14. This rule seems to work! In fact, it will work.

The relationship is then: revenue is number of items × 4 plus 2.

Second, define:

Let x be the number of items

Let R be the revenue

Write the equation:

R = x × 4 + 2
Common mistake

Checking a rule with only one pair from the table. The rule 2 × 3 + 4 = 10 works for 2 items, but 3 × 3 + 4 = 13, not 14. A function rule must work for every pair in the table, so test each one.

Does the rule R = 3x + 3 work for the table in Example #3?

Show answer

No. It works for 1 item (3 × 1 + 3 = 6), but for 2 items it gives 3 × 2 + 3 = 9, not 10.

How to Write a Function Rule Using the Concept of Slope

Let us do this for example #3. The goal is to use the equation y = mx + b.

y = mx + b
Remember

In y = mx + b, the slope m is how much the output changes when the input goes up by 1, and b is the output when the input is 0.

Using (1,6) and (2,10):

m = 10 − 62 − 1 = 41 = 4
y = 4x + b

Use (1,6) to find b.

6 = 4(1) + b
6 = 4 + b

Since 4 + 2 = 6, b = 2

y = 4x + 2

With x for the number of items and R for the revenue, this is R = 4x + 2, the same rule we found by trial and error.

Worked example: Write a function rule for the table with inputs 1, 2, 3, 4 and outputs 5, 8, 11, 14.
  1. Find the slope with (1, 5) and (2, 8): m = (8 − 5) / (2 − 1) = 3 / 1 = 3.
  2. Put m into y = mx + b: y = 3x + b.
  3. Use (1, 5) to find b: 5 = 3(1) + b, so 5 = 3 + b and b = 2.
  4. Check the last pair: 3(4) + 2 = 14. It works.

Answer: y = 3x + 2

A table contains the pairs (1, 9), (2, 11) and (3, 13). Use slope to write the function rule.

Show answer

y = 2x + 7. m = (11 − 9) / (2 − 1) = 2. Then 9 = 2(1) + b, so b = 7. Check: 2(3) + 7 = 13.

Summary

  • A function rule is an equation that shows how the output depends on the input.
  • To write a rule from a table: show the relationship, define the letters, then write the equation.
  • Some rules use one operation, such as c = 3 × n or O = 4 + I. Others mix multiplication and addition, such as R = 4x + 2.
  • A rule must work for every pair in the table, so check each one.
  • With y = mx + b, find the slope m from two pairs, then put one pair into the equation to find b.

Test Yourself: 10-Question Quiz

Now check what you learned. Every answer is explained, and each time you play you get new questions.

Question 1 of 10Score: 0