Function types

Pick a function, a domain and a codomain, then slide a horizontal line over the graph: it meets the graph more than once where the function is not one-one, and misses it where the function is not onto. See the range, a pair of x with the same y, a value nothing maps to, and the inverse as a mirror image in y = x.

Keep it one tap away for everyday use.

Bookmark Function types?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Pick f(x)
  2. Set domain
  3. Slide line
  4. Verdict
Nothing is uploadedWorks offline once open

Pick a function

The horizontal line test

Drag up and down on the picture (or use the slider) to move the line y = k. Solid curve: the function on your domain. The thick bar on the y-axis is the range; the shaded band is the codomain.

The inverse

Try this

  • x² on ℝ fails both tests: y = 4 meets it twice (x = −2 and 2), and y = −1 never. Restrict the domain to [0, ∞) and the codomain to [0, ∞): now every line meets it exactly once, and the inverse is √x.
  • x³ − 3x is onto ℝ but not one-one: the line y = 0 meets it three times.
  • eˣ is one-one, and onto (0, ∞) but not onto [0, ∞): nothing maps to 0. Its inverse is ln x.
  • 1/x is one-one but misses 0, so it is not onto ℝ.
  • sin x on [−π/2, π/2] onto [−1, 1] is a bijection: this is how sin⁻¹ x is built.

Check yourself

Fresh numbers every time. Type a number or a fraction such as 3/4; nothing is saved or sent.

    What it shows

    A function sends every x in its domain to exactly one y in its codomain. Two questions decide whether it can be undone (whether it has an inverse):

    • One-one (injective): do different x always give different y? On a graph: no horizontal line meets the curve more than once.
    • Onto (surjective): is every y in the codomain actually reached? On a graph: every horizontal line at a height inside the codomain meets the curve at least once. Equivalently, the range (the values the function really takes) equals the codomain.

    A function that is both is a bijection, and only bijections have an inverse. The inverse’s graph is the mirror image of the function’s graph in the line y = x.

    This page draws the function on the domain you choose, lets you slide the line y = k up and down, and gives the range, a pair of x that share a y when the function is not one-one, a y that nothing reaches when it is not onto, and the inverse. It follows relations and functions in Class 11 maths (domain, range and graphs of functions) and Class 12 maths (types of functions, composition and invertible functions). For finite sets drawn as arrow diagrams, use the relation checker; to plot any function, the graphing calculator; and to see how restricting the domain gives sin⁻¹, cos⁻¹ and tan⁻¹, go on to inverse trig.

    How to use it

    1. Pick f(x): 2x + 1, x², x³, x³ − 3x, |x|, eˣ, ln x, sin x or 1/x, or choose My own… and type a formula in x (such as x^2 - 2x or sin(x)/x) with the ends a and b of the domain.
    2. Choose the domain (all real numbers, [0, ∞), (0, ∞), (−∞, 0], [−π/2, π/2], [0, π] or your own [a, b]) and the codomain (ℝ, [0, ∞), (0, ∞), [−1, 1] or its range).
    3. Drag up and down on the picture, or use the slider, to move the line y = k. The page says how many times the line meets the graph and where. Green line: once. Red: more than once. Amber: not at all.
    4. Read the verdict: domain, range (also drawn as a thick green bar on the y-axis), codomain (the shaded band), one-one?, onto? and bijective?
    5. Press Make it one-one to cut the domain down to one rising or falling piece, or Make it onto to shrink the codomain to the range.
    6. The second picture reflects the graph in y = x. When the function is a bijection the reflection (green) is the graph of f⁻¹; otherwise it is red and the page says why it is not an inverse.

    Worked example

    Start with f(x) = x² from ℝ to ℝ, with the line at k = 2. The page shows that the line meets the graph 2 times (x = −1.4142, 1.4142). The range is [0, ∞). One-one? No: f(−1) = f(1) = 1. Onto? No: nothing maps to −1, because a square is never negative.

    Now change the domain to [0, ∞): one-one becomes Yes, because on x ≥ 0 the curve only rises. Change the codomain to [0, ∞) as well: onto becomes Yes, and the function is a bijection. The second picture shows its mirror image in y = x, which is the graph of the inverse, √x, with domain [0, ∞).

    Things to notice

    • Whether a function is one-one depends on its domain; whether it is onto depends on its codomain. The same formula can be a bijection or not.
    • eˣ is onto (0, ∞) but not onto [0, ∞): it gets as close to 0 as you like but never reaches it.
    • 1/x is one-one, but there is no x with 1/x = 0, so it is not onto ℝ.
    • x³ has a flat point at x = 0 but still always rises, so it is one-one.

    Check yourself

    Five fresh questions: an inverse value of a straight-line function, the lowest point of a range, a horizontal line count, whether a function is a bijection, and how many one-one functions there are between two finite sets. Nothing is saved.

    FAQ

    How does the page know the range exactly? For the ready-made functions it cuts the graph at its turning points and at gaps in the domain, so that each piece only rises or only falls. Each piece covers every value between its two end values (or limits), and the range is the union of those intervals.

    And for my own formula? It samples 4000 points on [a, b], finds the turning points and gaps from them, and then works the same way. That is a strong hint, not a proof: a very fast wiggle between two sample points could be missed.

    What is the vertical line test? It checks that a graph is a function at all (each x gives one y). The horizontal line test checks that the function is one-one.

    Is this from my textbook? It covers the standard school topic with its own examples. It is an independent study aid and is not part of NCERT.

    Where the numbers come from

    • Standard school mathematics: functions, domain, codomain and range, one-one (injective), onto (surjective) and bijective functions, the horizontal line test and inverse functions. Written for fibub; no textbook text, figures or exercises are used.
    • Checked by hand and with sympy 1.14 (solveset for f(x) = y on each piece, function_range for the range) for the nine ready-made functions on several domains, including x² on [−1, 2], eˣ onto (0, ∞) and [0, ∞), 1/x on ℝ − {0} and x³ − 3x.

    Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

    Last updated 2026-11-09.

    Change log for Function types

    1. Add #1459 One-one and onto tester Details on GitHub

    Every change to fibub

    Related tools

    Graphing calculator #T369 Plot y = f(x), any equation in x and y, polar r(θ) and parametric (x(t), y(t)) curves together, with sliders, zoom, tap-to-trace, roots, turning points and crossings, plus 3D surfaces z = f(x, y). Download PNG, SVG or CSV. Runs in your browser. Unit circle #L86 Drag a point round the unit circle and watch sin, cos and tan drawn as waves. Angles in degrees and radians, exact values at 30°, 45° and 60°, the ASTC quadrant signs, sliders for y = a sin(bx + c) + d, and the inverse trig functions as the mirror image of the principal branch. Relation checker #L96 Tap a table or type pairs to build a relation on {1, ..., n}, see it as an arrow diagram, and check reflexive, symmetric, transitive and antisymmetric with a counterexample for every no. Find equivalence classes, closures, and whether the relation is a one-one, onto function. Inverse trig #L302 Reflect the graph of sin, cos, tan, cot, sec or cosec in the line y = x and see why only the principal branch gives a function. Type a value such as 1/2 or −sqrt(3)/2 to get the principal value in radians (as a fraction of π where it is a standard angle) and degrees, every other angle with the same ratio, and the sin⁻¹(sin θ) trap. LPP graphical solver #L310 Type Z = px + qy and up to five constraints (or pick a production, diet or farming story) and see the feasible region shaded, every corner point with its value of Z, and the objective line sliding to the best corner. Unbounded regions, problems with no maximum, ties along an edge and impossible constraints are all spotted and explained. Quadratic explorer #L68 Slide a, b and c and watch the parabola move: vertex, roots and the discriminant update live, completing the square is drawn with tiles, and the middle term is split for you. With fresh practice questions.