Skip to main content

Function Evaluator (f(x) Calculator)

Evaluate a function at a specific input by substituting the value for x and simplifying — for a single number, a piecewise rule, a full table of values, or a comparison like f(a) vs. f(a+h) — with a distinct visual for every mode and full step-by-step substitution.

Background

In function notation, f(x) is a rule: whatever number you put in place of x, the formula tells you exactly what comes out. Evaluating a function at a value means substituting that value for every x in the formula and simplifying using order of operations. This calculator accepts polynomials, radicals (sqrt(...)), absolute value (abs(...)), and exponentials written with ^, and supports piecewise-defined functions, full tables of values, and evaluating at algebraic inputs like a+h.

Set up your function

Step 1 — What do you want to evaluate?

Step 2 — Enter your function

Use ^ for powers, sqrt(...) for square roots, and abs(...) for absolute value. Implicit multiplication like 2x or 3(x+1) works fine.

Step 2 — Enter each piece (leave a row blank if you only need fewer pieces)

Conditions can look like x < 5, x >= -2, or a range like -2 <= x < 3. Pieces are checked top to bottom — the first one that's true is used.

Step 3 — Evaluate at

Adding a label doesn't change the math — it just makes an abstract number concrete, e.g. "f(2) = 69 feet" instead of just "69".

Step 3 — Choose the table range

Up to 21 points per table. Step must be positive and the end must be at or after the start.

Step 3 — Choose values for a and h

The calculator evaluates f(a) and f(a+h) using the function from Step 2, then compares them.

Learning options

Result

No result yet. Enter your function above and click Evaluate.

How to use this calculator

  • Pick a mode: evaluate at one number, evaluate a piecewise function, build a table of values, or compare f(a) with f(a+h).
  • Type your function using ^ for powers, sqrt(...), and abs(...). For piecewise mode, enter each condition and its matching rule.
  • Click Evaluate to see the substituted value, the matching visual, and (if turned on) the full step-by-step substitution.
  • If a value is undefined (like dividing by zero or a negative under a square root), the calculator flags it clearly instead of guessing.

How evaluating a function works

1

Function notation f(x) names a rule for turning an input into an output. Evaluating f at a number means replacing every x in the formula with that number, then simplifying with order of operations.

2

A piecewise function gives a different rule for different parts of the domain. To evaluate it, check the conditions in order and use the formula attached to the first condition that's true for your input.

3

If an input satisfies none of the listed conditions, the function is undefined there — that input simply isn't part of the piecewise function's domain.

4

A table of values is just the same substitution repeated for several inputs. Plotting those (x, f(x)) pairs is exactly how a table turns into the picture of a graph.

5

f(a+h) means: first add h to a to get a new input, then run that new input through the same rule f. It is not the same as f(a) + h — the shift happens to the input, before the function acts on it.

6

Some inputs make a formula undefined — dividing by zero, or taking the square root of a negative number. A correct evaluation flags these rather than producing a made-up number.

Formulas & Equations Used

Direct substitution: f(a) = the formula for f(x) with every x replaced by a

Piecewise evaluation: f(x) = { rule₁ if condition₁ is true; rule₂ if condition₂ is true; ... }

Table of values: repeated substitution — compute f(x₁), f(x₂), ..., f(xₙ) for a list of inputs

Shifted input: f(a+h) = the formula for f(x) with every x replaced by (a+h)

Example Problems & Step-by-Step Solutions

Example 1 — Direct substitution

If f(x) = 3x² − 5x + 2, find f(4).

Step: f(4) = 3(4)² − 5(4) + 2 = 3(16) − 20 + 2 = 48 − 20 + 2.

Result: f(4) = 30.

Example 2 — A real-world formula

A ball's height is h(t) = −16t² + 64t + 5. Find h(2).

Step: h(2) = −16(4) + 64(2) + 5 = −64 + 128 + 5.

Result: h(2) = 69 feet.

Example 3 — Piecewise, right on a boundary

f(x) = 4.99 if x < 5; 9.99 if 5 ≤ x < 20. Find f(5).

Step: x = 5 fails "x < 5" but satisfies "5 ≤ x < 20", so the second rule applies.

Result: f(5) = 9.99 — boundary points belong to whichever condition actually includes them.

Example 4 — Outside every piece

f(x) = x² if 0 ≤ x < 5; 2x+1 if 5 ≤ x < 10. Find f(12).

Step: x = 12 doesn't satisfy either condition.

Result: f(12) is undefined — 12 isn't in this function's domain.

Example 5 — Building a table

For f(x) = x² − 4, build a table from x = −3 to x = 3.

Step: f(−3)=5, f(−2)=0, f(−1)=−3, f(0)=−4, f(1)=−3, f(2)=0, f(3)=5.

Result: The values rise, hit a minimum of −4 at x=0, then rise again — the shape of a parabola.

Example 6 — Comparing f(a) and f(a+h)

If f(x) = x², compare f(3) and f(3+0.1).

Step: f(3) = 9. f(3.1) = 3.1² = 9.61.

Result: The output changed by 0.61 when the input changed by only 0.1.

Frequently Asked Questions

What does "evaluate f(4)" actually mean?

It means replace every x in the formula for f(x) with the number 4, then simplify using the usual order of operations. Nothing more is happening — it's substitution followed by arithmetic.

How does the calculator decide which piece to use?

It checks the conditions in the order you entered them and uses the formula attached to the first one that's true for your x-value. If your pieces overlap, whichever is listed first wins.

What happens at a boundary, like x = 5 in "x < 5" vs. "x ≥ 5"?

Only one condition can actually include the boundary value, based on whether it uses a strict inequality (<, >) or one that includes equality (≤, ≥). Whichever condition's inequality is satisfied at that exact point is the one used.

Why is f(a+h) not the same as f(a) + h?

f(a+h) shifts the input first — you add h to a, then run that combined number through the whole function. f(a) + h instead runs the function on a alone, then tacks h onto the output afterward. Except for very specific functions, these give different results.

What does "undefined" mean in the result?

It means that specific input breaks the formula — usually a division by zero or a square root of a negative number. Undefined outputs are not zero and not an error in your typing; they're a real mathematical fact about that input.

Can I type "2x" instead of "2*x"?

Yes — implicit multiplication is supported, so 2x, 3(x+1), and even sqrt(x)x are all read correctly without needing an explicit multiplication sign.

What does the optional "label" field do?

It doesn't change the calculation at all — it just tags the number with units so the result reads like "f(2) = 69 feet" instead of a bare "69". It's purely for making an abstract output concrete.

Why does the f(a) vs. f(a+h) mode also show f(a) + h?

Because that's the exact value a lot of students mistakenly think f(a+h) equals. Showing both side by side makes the difference between "shift the input, then evaluate" and "evaluate, then shift the output" concrete instead of abstract.

Back to all calculatorsAll calculators