Skip to content
Math & Scientific

Function Rule Calculator

Function Rule Calculator

Find the linear function rule from two points

x1
y1
x2
y2
x

Your function rule

The Function Rule Calculator finds the rule of a straight line function from any two points you give it. If you know that a function passes through two points, this tool works out the slope, the intercept, and the full equation, and then uses that rule to find the function’s value at any x you choose. It turns a classic algebra problem into a few seconds of work.

Function rules show up everywhere in math class: homework problems, tests, and word problems about rates and totals. Instead of doing the fraction arithmetic by hand and risking a sign error, you can enter the two points, check the steps the calculator shows, and move on with confidence.

What This Calculator Does

The Function Rule Calculator takes two points, (x1, y1) and (x2, y2), and finds the linear function that passes through both of them. It gives you four things: the slope m, the y-intercept b, the function rule in the form y = mx + b, and the value of the function at the x-value you entered.

Along with the answers, it shows the arithmetic behind the slope and the intercept, so you can follow each step. If the two points have the same x-value, the tool stops with a clear message, because two points stacked vertically do not define a function at all.

Understanding Function Rules

A linear function rule is a recipe that turns every input x into exactly one output y. The most common way to write the recipe is y = mx + b. The letter m is the slope, which tells you how steep the line is and in which direction it tilts. The letter b is the y-intercept, which is the value of y when x equals zero, or the point where the line crosses the vertical axis.

Think of the slope as the rate of change. If the slope is 2, then every time x grows by 1, y grows by 2. If the slope is negative, y falls as x grows. If the slope is zero, the line is flat and the output never changes. The intercept tells you where the whole line sits: a bigger b shifts everything up, a smaller b shifts everything down.

Two points are enough to pin down exactly one straight line, as long as the points are not stacked on top of each other vertically. That is why the calculator needs exactly two points: from them it can recover the slope, then use the slope to recover the intercept, and then the full rule is known.

How to Use the Calculator

Start by typing the coordinates of your first point into the x1 and y1 boxes. Then type the second point into the x2 and y2 boxes. Decimals and negative numbers are fine. Finally, type the x-value you want to evaluate into the last box.

Press Find Rule. The result box shows the function rule in large text, followed by the slope calculation, the intercept calculation, and the evaluated value f(x). If you want to try new points, press Reset to clear everything.

The Math Behind the Calculator

The calculator uses three short formulas. First, the slope: m = (y2 minus y1) divided by (x2 minus x1). This is rise over run, the change in y divided by the change in x. It measures how much y moves for each step in x.

Second, the intercept: b = y1 minus m times x1. This comes from rearranging the rule y = mx + b. Since the first point sits on the line, plugging it in gives y1 = m times x1 plus b, and solving for b gives the formula the calculator uses.

Third, evaluation: f(x) = m times x plus b. Once m and b are known, any x can be plugged into the rule to find its matching y. That is the value shown as f(x) in the results.

Worked Examples With Full Arithmetic

Example one: the points (1, 2) and (3, 6), and evaluate at x = 5. Slope: m = (6 minus 2) divided by (3 minus 1) = 4 divided by 2 = 2. Intercept: b = 2 minus 2 times 1 = 2 minus 2 = 0. The rule is y = 2x. Evaluate at 5: f(5) = 2 times 5 = 10. The calculator shows the rule y = 2x and f(5) = 10.

Example two: the points (0, 4) and (2, 10), and evaluate at x = 7. Slope: m = (10 minus 4) divided by (2 minus 0) = 6 divided by 2 = 3. Intercept: b = 4 minus 3 times 0 = 4 minus 0 = 4. The rule is y = 3x + 4. Evaluate at 7: f(7) = 3 times 7 plus 4 = 21 plus 4 = 25. The calculator shows y = 3x + 4 and f(7) = 25.

Example three: the points (2, 8) and (6, 8), and evaluate at x = 100. Slope: m = (8 minus 8) divided by (6 minus 2) = 0 divided by 4 = 0. Intercept: b = 8 minus 0 times 2 = 8. The rule is y = 8. Because the slope is zero, the function is flat, so f(100) = 8. Any x you enter gives the same answer, 8.

Example four shows the error case: the points (4, 1) and (4, 9). Slope: m = (9 minus 1) divided by (4 minus 4) = 8 divided by 0, which is impossible. The points form a vertical line, and a vertical line fails the function test because one input x maps to many outputs. The calculator shows a message explaining that no function rule exists and asks for points with different x-values.

How to Read Your Result

The big line at the top of the result box is your function rule, such as y = 3x + 4. This is the complete recipe: multiply the input by the slope, then add the intercept.

Under it, the slope line shows m and the subtraction that produced it, and the intercept line shows b and its formula. The last line gives f(x), the function’s value at the x you entered. If you want the value at a different x, you can type the new number and press Find Rule again.

Special Cases Worth Knowing

A slope of zero means a horizontal line. The rule becomes y = b, a constant function. No matter what x you evaluate, the answer is always b. Example three above is exactly this case.

A negative slope means the line falls from left to right. For example, through (0, 10) and (5, 0): m = (0 minus 10) divided by (5 minus 0) = negative 2, and b = 10 minus negative 2 times 0 = 10, so the rule is y = negative 2x + 10. Evaluating at x = 3 gives f(3) = 4.

Two identical points, such as (2, 5) and (2, 5), trigger the same message as the vertical line case, because x1 equals x2. You need two genuinely different points with different x-values to define a line.

Common Mistakes to Avoid

The most common mistake is mixing up the order of the points: subtracting x1 minus x2 in the top and bottom of the slope fraction inconsistently. The calculator handles the order for you, but if you check by hand, keep the same order in the numerator and the denominator.

Another frequent error is a sign slip when computing the intercept. The formula is b = y1 minus m times x1. If x1 is negative, subtracting a negative product adds instead. Let the calculator do this step and compare its intercept line with your own work.

Finally, remember that this tool finds straight line rules only. If your data curves, like a parabola or an exponential, two points are not enough and a line will not fit. The calculator will still return a line through your two points, so make sure a linear model is what you actually want.

Frequently Asked Questions

1. What is a function rule?

A function rule is an equation that tells you how to turn each input x into its output y. For a straight line, the rule looks like y = mx + b, where m is the slope and b is the intercept. This calculator finds that rule from two points.

2. Why do I need two points to find the rule?

Two points determine exactly one straight line. One point leaves infinite possible lines through it, and three points may not line up at all. Two points with different x-values give just enough information to recover both the slope and the intercept.

3. What does the slope tell me?

The slope tells you how fast y changes when x changes. A slope of 2 means y rises by 2 for every 1 that x rises. A negative slope means y falls as x rises, and a slope of zero means y never changes.

4. What does the y-intercept tell me?

The y-intercept is the value of the function when x equals zero. On a graph it is the point where the line crosses the vertical axis. In a word problem it often represents a starting amount before any change happens.

5. What does f(5) = 10 mean?

It means that when the input x is 5, the function rule produces the output 10. You get it by plugging 5 into the rule: for y = 2x, f(5) = 2 times 5 = 10. The calculator evaluates the rule at whatever x you type.

6. Why does the calculator reject points with the same x-value?

Two points with the same x form a vertical line. A vertical line is not a function because one input would have to map to many different outputs, and the slope fraction would divide by zero. The calculator explains this and asks for points with different x-values.

7. Can the slope be a fraction or a decimal?

Yes. Slopes are often fractions, like one half, or decimals, like 0.75. The calculator accepts decimal inputs and rounds its answers to four decimal places, which is plenty of precision for homework and tests.

8. What if my two points have the same y-value?

Then the slope is zero and the line is horizontal. The rule becomes y = b, where b is that shared y-value, and every x you evaluate returns the same number. The calculator handles this case normally.

9. Can I use negative coordinates?

Yes. Negative x and y values work exactly the same way. Just type the minus sign with the number, and the calculator applies the slope and intercept formulas, signs included.

10. Does the order of the two points matter?

No. Swapping the two points gives the same slope and the same rule, because both the numerator and the denominator of the slope fraction change sign together. You can enter the points in either order.

11. How is a function rule different from a table of values?

A table lists specific input and output pairs, while a rule is the pattern behind them. The rule lets you find the output for any input, even ones missing from the table. The calculator bridges the two: it reads two pairs and writes the rule.

12. Can this calculator find rules for curves?

No. This tool is built for straight lines only. Curves like parabolas need more points and different math. If your points come from a curved relationship, the line the calculator returns will only match at your two points.

13. How do I check the calculator’s answer by hand?

Compute the slope as (y2 minus y1) over (x2 minus x1), then the intercept as y1 minus slope times x1. Finally, plug both original points into y = mx + b. If both points satisfy the equation, your rule is correct.

14. What if I only know one point and the slope?

You can still find the rule by hand: use b = y1 minus m times x1 with your known slope and point. This calculator needs two points, so enter a second point on the line if you can find one, or work out the intercept with the formula.

15. Where are function rules used in real life?

Anywhere one quantity changes at a steady rate: taxi fares with a flag drop plus a per mile rate, phone plans with a base fee plus a per minute charge, or temperature converting between scales. The intercept is the starting amount and the slope is the rate.

Final Thoughts

The Function Rule Calculator takes the most repeated algebra chore, turning two points into y = mx + b, and does it with every step shown. Use it to check your homework, to evaluate the function at any x, and to build intuition for what slope and intercept really mean. Once the pattern clicks, you will find the rule by hand almost as fast as the tool does.