acalculator

What is the function table?

Type a function such as x^2 + 3x - 4, the first and last x, and the step. The function table calculator lists f(x) for every x in the range and draws the graph.

Your numbers

Use x, + - * / ^, brackets, pi, e, sqrt, ln, log10, sin, cos, tan, |x|.
f(x) values
-6, -6, -4, 0, 6

f(x) = x^2 + 3x - 4 from x = -2 to 2 gives -6, -6, -4, 0, 6.

Table
x = -2 → f(x) = -6; x = -1 → f(x) = -6; x = 0 → f(x) = -4; x = 1 → f(x) = 0; x = 2 → f(x) = 6
Rows
5
Smallest f(x)
-6
Largest f(x)
6

f(x) values: -6, -6, -4, 0, 6. f(x) = x^2 + 3x - 4 from x = -2 to 2 gives -6, -6, -4, 0, 6.

What is the table?

What does the graph look like?

How to calculate

Makes an input-output table of a function y = f(x) from a start value to an end value in equal steps, and draws its graph.

Example with the default inputs (Function f(x) x^2 + 3x - 4, Start x -2, End x 2, Step 1): f(x) = x^2 + 3x - 4 from x = -2 to 2 gives -6, -6, -4, 0, 6.

Method: x₀ = start, xₖ = start + k × step for k = 0, 1, 2, … while xₖ ≤ end; each row is (xₖ, f(xₖ)).

  • A row where f has no real value (the square root or logarithm of a negative number, a division by zero) shows “undefined”.
  • The table has at most 51 rows.

Machine-readable copies: Markdown, JSON.

Worked examples

Each example is checked against the calculator on every build.

  1. Function f(x) x^2 + 3x - 4, Start x -2, End x 2, Step 1 gives f(x) values -6, -6, -4, 0, 6, Rows 5, Smallest f(x) -6, Largest f(x) 6.Source: OpenStax, Algebra and Trigonometry 2e, §3.1 Functions and Function Notation (evaluating a function given by a formula, input-output tables), https://openstax.org/books/algebra-and-trigonometry-2e/pages/3-1-functions-and-function-notation (Example 6: f(2) = 4 + 6 − 4 = 6)
  2. Function f(x) 2x + 1, Start x 0, End x 1, Step 0.25 gives f(x) values 1, 1.5, 2, 2.5, 3, Table x = 0 → f(x) = 1; x = 0.25 → f(x) = 1.5; x = 0.5 → f(x) = 2; x = 0.75 → f(x) = 2.5; x = 1 → f(x) = 3.Source: OpenStax, Algebra and Trigonometry 2e, §3.1 Functions and Function Notation (evaluating a function given by a formula, input-output tables), https://openstax.org/books/algebra-and-trigonometry-2e/pages/3-1-functions-and-function-notation
  3. Function f(x) sqrt(x), Start x -1, End x 4, Step 1 gives f(x) values undefined, 0, 1, 1.414213562, 1.732050808, 2, Rows 6, Smallest f(x) 0, Largest f(x) 2.Source: OpenStax, Algebra and Trigonometry 2e, §3.1 Functions and Function Notation (evaluating a function given by a formula, input-output tables), https://openstax.org/books/algebra-and-trigonometry-2e/pages/3-1-functions-and-function-notation (domain of a function)
  4. Function f(x) x/10, Start x 0, End x 0.3, Step 0.1 gives f(x) values 0, 0.01, 0.02, 0.03, Rows 4.Source: OpenStax, Algebra and Trigonometry 2e, §3.1 Functions and Function Notation (evaluating a function given by a formula, input-output tables), https://openstax.org/books/algebra-and-trigonometry-2e/pages/3-1-functions-and-function-notation

How it works

  1. The x values. Start, end and step are read as the exact decimals you typed. The number of whole steps is n = ⌊(end − start) ÷ step⌋, worked out exactly, and the table has n + 1 rows: xₖ = start + k × step for k = 0 to n, each computed exactly and then rounded to the nearest double. So 0, 0.1, 0.2, 0.3 are exactly those decimals, and the end value is in the table whenever a whole number of steps reaches it.
  2. The outputs. Each f(xₖ) is evaluated in double-precision floating point, in the order the formula is written. Trig functions use radians. A value that is not a finite real number (√ of a negative, ln of 0 or less, 1 ÷ 0) is undefined.
  3. Smallest and largest f(x) are taken over the rows that have a value; with no such row they are not shown.

Formula syntax. The variable is x. Write + − * / and ^ for a power, brackets ( ), |x| for the absolute value, and a number next to a letter or bracket for multiplication (3x, 2(x + 1)). Names: pi, e, sqrt, cbrt, abs, exp, ln (natural log; log also means ln), log10 (base 10), sin, cos, tan, sec, csc, cot, their inverses asin, acos, atan (or arcsin, arccos, arctan), and sinh, cosh, tanh. The formula is at most 200 characters.

How the formula is read. You can also type x², × or · for times, ÷ and the minus sign −. Names are lower case (LN(x) gives no answer). A multiplication without a sign has the same precedence as × and ÷, left to right: 1/2x is x ÷ 2, and 4 / 2(1 + 1) is 4. A − sign binds looser than ^: −2^2 is −4. A function name without brackets takes one power term: sin x^2 is sin(x²), and ln 2x is ln(2) × x. A negative base to a bracketed fraction of whole numbers with an odd bottom is the real root: (−8)^(1/3) is −2 and (−8)^(2/3) is 4. Any other negative base to a non-whole power is undefined, so (−8)^0.3333333333333333 is undefined. A number with two decimal points, such as 2.5.1, gives a message to fix it.

Rules. Start and end are from −1,000,000 to 1,000,000, the end not below the start. The step is more than 0 and at most 1,000,000. The table has at most 51 rows; more gives no answer.

Output format. The f(x) values are a comma-separated list, and the table one row per step as “x = … → f(x) = …”. Every number in the text has up to 10 significant figures, a plain hyphen for minus and no thousands separators. Smallest and largest show up to 10 significant figures.

Worked examples by hand

f(x) = x² + 3x − 4 from −2 to 2, step 1 (OpenStax Example 6). f(−2) = 4 − 6 − 4 = −6; f(−1) = 1 − 3 − 4 = −6; f(0) = −4; f(1) = 1 + 3 − 4 = 0; f(2) = 4 + 6 − 4 = 6. Five rows; smallest −6, largest 6.

f(x) = 2x + 1 from 0 to 1, step 0.25. x = 0, 0.25, 0.5, 0.75, 1 give 1, 1.5, 2, 2.5, 3.

f(x) = sqrt(x) from −1 to 4, step 1. √(−1) is not real: undefined. Then 0, 1, 1.414213562, 1.732050808, 2. Six rows; smallest 0, largest 2.

f(x) = x/10 from 0 to 0.3, step 0.1. (0.3 − 0) ÷ 0.1 = 3 exactly, so 4 rows: x = 0, 0.1, 0.2, 0.3 give 0, 0.01, 0.02, 0.03.

Other questions people ask

What is a function table?

A table of inputs and outputs. Each row holds one x and the value f(x) that the rule gives for it. For f(x) = x² + 3x − 4, the row for x = 2 holds 4 + 6 − 4 = 6.

How do I make a table of values for a function?

Pick the x values, usually a start, an end and a fixed step, and put each one into the rule. From −2 to 2 in steps of 1, f(x) = x² + 3x − 4 gives −6, −6, −4, 0 and 6.

How do I type the function?

Use x as the variable, + − * / and ^ for powers, and brackets. 3x means 3 × x. Functions include sqrt, ln (log is also the natural log), log10, sin, cos, tan, and |x| for the absolute value; pi and e are the constants.

Why does a row say undefined?

The function has no real value at that x: a square root or logarithm of a negative number, or a division by zero. sqrt(x) at x = −1 is undefined, so that row shows the word instead of a number.

Does the table always reach the end value?

Only if a whole number of steps fits. The table stops at the last x that is not past the end. From 0 to 1 in steps of 0.3 the rows are 0, 0.3, 0.6 and 0.9.

Are trig functions in degrees or radians?

In radians, as in most algebra and calculus books. sin(pi/2) is 1. To use degrees, multiply by pi/180: sin(x*pi/180).