One To One Function Calculator
A function is one-to-one when every output comes from exactly one input: no two different x-values share the same y. Most students meet this through the horizontal-line test, but drawing that line accurately for every formula is slow and error-prone. This calculator runs the test for you, on the interval you choose, and shows the exact colliding values when the test fails.
Supports: numbers, x, + – * / ^, parentheses, and sin cos tan exp log sqrt abs. Use ^ for powers: x^3.
Numeric test (201 sample points), valid for continuous functions. It is not a symbolic proof: sharp spikes between sample points could be missed.
Quick Answer
This calculator tests whether your function is one-to-one (injective) on the interval you enter. It parses your formula with a safe built-in parser, evaluates it at 201 points, and checks strict monotonicity. For example, f(x) = x3 – 3x on [-2, 2] is not one-to-one: the tool finds f(-2) = -2 = f(1). On [0, 5], f(x) = 2x + 1 is one-to-one: it rises strictly across the whole interval.
Key Takeaways
- One-to-one is a question about a function on an interval, not about the formula alone: x2 fails on [-2, 2] but passes on [0, 2].
- A continuous function on an interval is one-to-one exactly when it is strictly monotonic: always rising or always falling. That is what the tool checks.
- When the test fails, you get a concrete counterexample: two x-values with (nearly) the same output, like f(-2) = f(1) = -2 for x3 – 3x.
- The verdict is numeric, not a proof: 201 sample points catch every ordinary classroom function, but a spike narrower than the sampling step could hide between points.
How to use the one-to-one function calculator
Using the tool takes four steps. The sections below explain what the tool does at each one, so you can trust the verdict rather than take it on faith.
1. Type the formula
Enter f(x) with x, numbers, + – * / ^, parentheses and functions like sin, exp, log, sqrt, abs. Powers use ^, e.g. x^3-3*x.
2. Set the domain
Enter the interval start a and end b. The verdict applies only to [a, b]; change the domain and the answer can change.
3. Run the 201-point check
The tool evaluates f at 201 evenly spaced points and checks whether every step from left to right moves the same direction.
4. Read the verdict
One-to-one shows the direction of monotonicity; a failure shows a counterexample pair, so you can verify it by hand.
Formula rules worth knowing
Type the formula the way you would write it with a caret for powers: x^2 for squaring, x^(1/2) for a square root written with exponents, 2*x for multiplication (2x without the operator is not valid). The parser is a small built-in tokenizer and shunting-yard evaluator: your input is converted to numbers and never run as code, so there is no way to inject anything through the formula box. If the syntax is wrong, you get a plain-language error naming the problem, not a crash. Constants pi and e are recognized, and function names are case-insensitive, so Sin(x) and sin(x) both work.
Why monotonicity decides it
The horizontal-line test
The formal definition: f is one-to-one when f(u) = f(v) implies u = v. On a graph, that is the horizontal-line test: no horizontal line may cross the graph twice. For a continuous function on an interval, this graphical condition is equivalent to strict monotonicity, and that equivalence is what makes a numeric test possible at all.
Here is the logic in one paragraph. Suppose the function is strictly increasing: if u is less than v, then f(u) is less than f(v), so they cannot be equal. Two different inputs can never share an output. The same holds for strictly decreasing. In the other direction, a continuous function on an interval that is not strictly monotonic must turn around somewhere: by the Intermediate Value Theorem it repeats a value, so some horizontal line crosses twice. The tool checks the monotone condition numerically, with a tiny tolerance of 1e-9 to absorb floating-point noise: it flags the function as one-to-one only when every one of the 200 steps between the 201 sample points goes the same direction.
The test’s honest boundary
This is also the test’s honest boundary. A continuous function passes exactly when the sampled values are strictly monotone; a discontinuous function can slip through if each piece rises in the same direction across a jump, and a continuous function with a wiggle narrower than the sampling step (the interval divided by 200) can pass when it should not. The card states this under the results box, and the verdict is the working answer for homework and graphing intuition, not a symbolic proof.
Worked examples, checked against this exact tool
Every row below was run through the calculator’s own code and the output copied from the result. Try any of them yourself: the pre-filled example loads x3 – 3x on [-2, 2], the classic cubic that rises, falls, then rises again.
| Function | Interval | Tool verdict | Detail |
|---|---|---|---|
| x3 – 3x | [-2, 2] | Not one-to-one | f(-2.0000) = -2.0000 and f(1.0000) = -2.0000: two inputs, one output. |
| 2x + 1 | [0, 5] | One-to-one | Strictly increasing: every output comes from exactly one input. |
| x2 | [-2, 2] | Not one-to-one | f(-2.0000) = 4.0000 and f(2.0000) = 4.0000: the parabola’s two arms collide. |
| x2 | [0, 2] | One-to-one | Strictly increasing on the non-negative half: domain restriction saves it. |
| ex | [-5, 5] | One-to-one | Strictly increasing everywhere: each output has exactly one input (its natural log). |
| sin(x) | [0, 2π] | Not one-to-one | f(0.7226) = 0.6613 and f(2.4190) = 0.6613: periodic functions always repeat. |
The sin(x) row
The sin(x) row deserves a comment because it shows the counterexample engine doing something a hand-drawn horizontal line cannot: the tool does not just say “periodic, so it fails”; it finds the closest-colliding pair on the sampled grid and hands you numbers to check. On [0, 2π] those are x = 0.7226 and x = 2.4190, both giving 0.6613. Plug them back into any calculator and confirm: sin(0.7226) is 0.6613 to four decimals, and so is sin(2.4190).
The limits of a numeric test
Three things the tool will not do for you, stated plainly.
Discontinuities
First, discontinuities: 1/x on [-1, 1] blows up at x = 0, so the tool stops with the message “Function is not finite at x = 0.0000: split the domain around the break.” That is the correct behavior: a single test across the break is meaningless, so test [-1, -0.001] and [0.001, 1] separately.
Sharp spikes
Second, sharp spikes: if the function wiggles between sample points, the tool can miss it. Narrow the interval around anything suspicious, which quadruples the resolution.
Formulas the parser does not cover
Third, formulas the parser does not cover: piecewise definitions, implicit relations and functions of two variables are outside this tool’s scope. It says so with a parse error rather than guessing.
What this calculator covers in one place
This page covers the full injectivity test on one screen: the domain is first-class, the verdict is checkable, and the method is printed with every result.
Every step shown
The result prints the sample count (201 points), the direction of monotonicity, and the colliding pair when the test fails, so you can verify the verdict by hand.
Your interval, your function
Injectivity is a property of a function on an interval, not of the formula alone: x^2 on [0, 2] is one-to-one even though x^2 on [-2, 2] is not. The tool tests the function you typed on the interval you chose.
The distinctive moves on this page: (1) the domain inputs are first-class, because injectivity is a property of a function on an interval; (2) the counterexample is concrete numbers, not prose; (3) the parser is disclosed and safe, so formulas cannot execute code; (4) the method line is printed with every result, so the verdict is checkable. If you are studying inverses, the connection is direct: only a one-to-one function has an inverse that is itself a function, which is why reference pages for the inverse sine calculator and inverse tangent calculator restrict their domains. Try ex on [-5, 5] above, then compare with the exponential function calculator to see how quickly its values separate, and run a few linear functions to confirm every nonzero-slope line passes.
Frequently asked questions
Use the horizontal-line test: if any horizontal line crosses the graph more than once, the function is not one-to-one. Algebraically, the test is f(a) = f(b) implies a = b: if you can find two different inputs with the same output, it fails. This calculator automates both forms by checking strict monotonicity over 201 sampled points and reporting the colliding pair when the test fails.
Not on a symmetric interval like [-2, 2], because f(-1) = f(1): two different inputs share the output 1. Restricted to [0, 2], though, it is one-to-one, since the parabola is strictly increasing on the non-negative half. This is the classic case for why the interval matters more than the formula.
Yes, except constant functions. Any line with a nonzero slope is strictly monotonic, either always rising or always falling, so distinct inputs always give distinct outputs. A constant function like f(x) = 5 is not one-to-one: every input maps to 5, and the tool reports a counterexample pair on any interval.
Yes. The exponential function is strictly increasing everywhere, so each output has exactly one input, its natural log. Run exp(x) on [-5, 5] in the calculator above and the verdict reads one-to-one with strictly increasing direction.
Injective is the formal name for one-to-one: distinct inputs always give distinct outputs. A function f is injective when f(a) = f(b) forces a = b. It is one of three core function properties students learn alongside surjective (onto) and bijective (both at once).
Only one-to-one functions have inverses that are themselves functions. That is the gatekeeper for the natural log, arcsin, arctan, and every inverse trigonometric function, and it is why those functions come with restricted domains. In applied work, injectivity is what makes a mapping reversible: cryptography, data encoding, and calibration curves all depend on distinct inputs staying distinct.
It uses a built-in tokenizer and shunting-yard parser that converts your text into a sequence of arithmetic operations. Your input is never run as code, so a formula box cannot execute anything malicious. Supported input is numbers, x, the constants pi and e, + – * / ^, parentheses, and the functions sin, cos, tan, exp, log (natural), sqrt, and abs.
The seven named functions are sin, cos, tan, exp, log (natural logarithm), sqrt, and abs, plus + – * / ^ and parentheses. Write powers with ^, for example x^3, and write multiplication explicitly, for example 2*x. Constants pi and e are recognized, and function names are case-insensitive. Anything else, including piecewise definitions, returns a parse error rather than a guess.
Two hundred intervals between 201 points give enough resolution to find the turning points of typical textbook functions while keeping the calculation instant. The verdict is only as fine as the sampling step, which is the interval width divided by 200: if you suspect a wiggle between points, narrow the domain and rerun. For a rigorous proof rather than a working check, do the algebra.
One-to-one (injective) means distinct inputs always give distinct outputs, so no output is shared: f(a) = f(b) forces a = b. Many-to-one is still a function, but different inputs can share an output: x^2 on [-2, 2] is many-to-one because f(-2) = f(2) = 4. One-to-many is not a function at all: one input giving two outputs, such as 4 pairing with both 2 and -2, breaks the rule that each input has exactly one output. Only the one-to-one case has an inverse that is itself a function, which is why the domain restriction matters: x^2 is not one-to-one on [-2, 2], but it is one-to-one on [0, 2].
Add This Calculator to Your Website
Embed this calculator on your own site with the code below. Pick a size to preview it live, then copy the code.
Powered by Calculator Zilo
References
- OpenStax, Calculus Volume 1. 1.1 Review of Functions. Accessed October 23, 2026.
- OpenStax, Calculus Volume 1. 1.4 Inverse Functions. Accessed October 23, 2026.
- Wolfram MathWorld. Injective. Accessed October 23, 2026.
- Dana Ernst, Northern Arizona University. 8.2: Injective and Surjective Functions, Mathematics LibreTexts. Accessed October 23, 2026.
- F. Bouyer. Injective, Surjective and Bijective, Introduction to Pure Mathematics lecture notes. Accessed October 23, 2026.
