What does this tool do?
This calculator studies a function of x on an interval you choose. Type f(x) as you would write it in class, such as 2x + 3, x² − 2x − 3, sqrt(x) or sin(x), give the start, the end and the step, and you get a table of values, a graph of the curve and the zeros of f on that interval.
When the function is affine, f(x) = mx + p, the calculator recognises it and gives its slope m and its y-intercept p. For other functions it shows f(0) and the smallest and largest values of the table, which is a quick way to see where the curve goes up and down.
It uses the same parser as the scientific calculator, with x as the variable and angles in radians. It suits middle and high school students who need a table of values for a graph, or who want to check the shape of a curve before drawing it by hand.
How to use it
- Type the function with x as the variable, for example 2x + 3, x² − 4 or sqrt(x).
- Choose where the interval starts and ends, then the step between two values of x.
- Read the graph, the table of values and the results: zeros, smallest and largest values in the table, slope and intercept when f is affine.
You can write 2x for 2 × x, 3(x + 1) for 3 × (x + 1), and x² or x^2 for powers. The step must be positive and the table has at most 201 rows; the graph always uses 400 points, whatever the step. The Share button copies a link with the same function and interval.
Calculation method
f(x) = mx + p: p = f(0), m = f(1) − f(0)
f(x₁) and f(x₂) of opposite signs ⇒ a zero between x₁ and x₂ (bisection)
The table starts at the first value of x and adds the step each time, until it reaches the end of the interval. Each value is worked out from your expression, and a point where f does not exist is marked undefined instead of stopping the whole table.
To decide whether f is affine, the calculator computes p = f(0) and m = f(1) − f(0), then checks that f(x) equals mx + p at several other points. If it does everywhere, f is affine; otherwise it is not, even if it looks straight on a small interval.
A zero is a value of x where f(x) = 0. The calculator looks for places where f changes sign, then halves the gap again and again until the zero is known to many decimals. A change of sign through a vertical asymptote, as with 1/x at 0, is not counted.
Worked example
Example 1: an affine function, f(x) = 4x + 7
- Interval from 0 to 10 with a step of 2: x = 0, 2, 4, 6, 8, 10, so the table has 6 rows.
- Values: f(0) = 7, f(2) = 15, f(4) = 23, f(6) = 31, f(8) = 39, f(10) = 47.
- Intercept p = f(0) = 7, slope m = f(1) − f(0) = 11 − 7 = 4: each extra unit of x adds 4.
- The zero is x = −1.75, which is outside the interval, so no zero is listed.
f is affine with slope 4 and y-intercept 7: a fare of 7 DH plus 4 DH per km, for example.
Another scenario: a parabola, f(x) = x² − 2x − 3
- Interval from −2 to 4 with a step of 0.5: 13 rows.
- The table goes from f(−2) = 5 down to f(1) = −4, then back up to f(4) = 5.
- The curve crosses the x axis twice: the zeros are x = −1 and x = 3.
Not affine; smallest value in the table −4 at x = 1, zeros −1 and 3.
Understanding the results
Slope and y-intercept
In f(x) = mx + p, p is where the line crosses the y axis and m is how steep it is. A positive slope means the line goes up from left to right, a negative one that it goes down, and m = 0 gives a horizontal line.
Reading the table
A table only shows f at the values you chose. Between two rows the function can do anything, so a smaller step gives a more faithful picture. The graph uses 400 points to fill in the gaps.
Zeros and the graph
The zeros are where the curve meets the x axis. For a quadratic, they are the solutions of ax² + bx + c = 0: the quadratic equation solver gives them exactly, with radicals.
Undefined values
sqrt(x) has no value for x < 0, ln(x) needs x > 0 and 1/x is undefined at 0. The table marks those rows and the graph leaves a gap there instead of joining the points.
Tips and limitations
- Choose an interval that contains the interesting part of the curve, then shrink the step to see it in detail.
- Use brackets for fractions: write (x + 1)/(x − 1), not x + 1/x − 1.
- To find where f(x) equals a number k, study f(x) − k and read its zeros.
- For an exact solution of 2x + 3 = 0, the linear equation solver shows every step.
Mistakes to avoid
- Forgetting that trigonometric functions use radians here: sin(90) is not 1.
- Reading the minimum of the table as the minimum of the function: it may lie between two rows.
- Choosing a step so large that the table misses a zero or a peak.
- Calling a function affine because two points line up: it must hold for every x.
Frequently asked questions
How do I make a table of values?
Pick evenly spaced values of x, then work out f(x) for each one. With f(x) = 2x + 3 from 0 to 3 in steps of 1: f(0) = 3, f(1) = 5, f(2) = 7, f(3) = 9.
How do I find the slope of a linear function?
The slope m is how much f changes when x goes up by 1: m = f(1) − f(0). The y-intercept p is f(0). For 2x + 3, m = 2 and p = 3.
Why are some values “undefined”?
The function does not exist at that point: the square root of a negative number, a division by zero or the logarithm of a negative number. For example 1/x is undefined at x = 0.
Can I copy the table into a spreadsheet?
Yes. The Copy result button copies x and f(x) separated by a tab, one row per line, so it pastes into two columns.
How precise are the zeros?
They are refined by bisection to about ten significant digits, then rounded to four decimals for display. They are approximations, unlike the exact roots of the quadratic solver.