Visual walkthrough — Inverse functions — finding f⁻¹(x), horizontal line test
This page rebuilds the whole idea of an inverse function in pictures, starting from nothing but "a machine that turns numbers into other numbers." We will earn every symbol before we use it. By the end you will see why the swap method works, why the graph reflects across a diagonal line, and exactly when the whole thing breaks.
Parent: 2.2.09 Inverse functions — finding f⁻¹(x), horizontal line test (Hinglish) — full topic note.
Step 1 — A function is a machine with arrows
WHAT. Picture a box. On the left sit some input numbers. On the right sit some output numbers. The box draws exactly one arrow out of each input, pointing to the output it produces. That box is a function. We write it , and if the arrow from lands on we write .
- ::: the input — a number you feed the machine.
- ::: the rule — the box that turns each input into one output.
- ::: the output — where the arrow from lands.
WHY. Everything about inverses is "can I follow the arrow backwards?" To ask that clearly, we first need the picture where arrows go forwards, one per input.
PICTURE. On the left, the inputs . On the right, their outputs under . Each input fires exactly one arrow.

Step 2 — The inverse is the same picture with the arrows reversed
WHAT. Take the arrow diagram of and flip every arrowhead around. Inputs become outputs, outputs become inputs. If this reversed picture is also a legal function — one arrow leaving each dot — we call it the inverse function and write . Crucially, the only dots that can start a reversed arrow are the ones that received one: the domain of is exactly the range of .
- ::: the reverse machine: it reads as "which did send to ?"
WHY. "Undoing" literally means "walk the arrow home." The reversed diagram is that walk. Nothing algebraic yet — just direction of travel.
PICTURE. Same dots as Step 1, but now the arrows point right-to-left. Feed into the reverse machine, follow the reversed arrow, land back on .

Step 3 — When reversing arrows is ILLEGAL
WHAT. Suppose two different inputs, and , fire arrows into the same output . Reverse the arrows: now two arrows leave . That violates the rule "exactly one arrow leaves each dot." So there is no legal reverse machine.
WHY. This is the entire reason not every function has an inverse. If , then and — two arrows crash into . Reversed, would have to be both and . A machine can't give two answers.
PICTURE. Two inputs and both shoot arrows into the single output . When reversed (dashed), two arrows leave — illegal.

Formally the "no collisions" rule is: .
Step 4 — The horizontal line test SEES the collisions
WHAT. Now draw as a curve on axes. A horizontal line is the set of all points sharing the output value . Wherever that line crosses the curve, an input produced output . Two crossings on one horizontal line = two inputs into = a collision from Step 3.
- ::: a flat line at height ; it collects every whose output is .
WHY. Step 3's collision was an abstract arrow crash. On a graph it becomes something you can literally see with a ruler: slide a horizontal line and count crossings. Notice also: a height the curve never reaches is a outside the range — there has nothing to return, matching Step 1's warning.
PICTURE. Left: the line cuts at and — two crossings, fails, no inverse. Right: any horizontal line cuts exactly once — passes, invertible.

Step 5 — Reversing arrows becomes a MIRROR across
WHAT. In Step 2 we reversed arrows. On axes, reversing an arrow means swapping which coordinate is input and which is output: the point on becomes the point on . Swapping the two coordinates of a point is exactly a reflection across the diagonal line .
- ::: a point of — " sends to ."
- ::: its mirror twin — " sends back to ."
- ::: the mirror line where input equals output.
WHY. We need to draw , not just imagine reversed arrows. The mirror is that drawing rule: fold the paper along and lands on .
PICTURE. Point on and its twin on , connected by a dashed segment that crosses at a right angle, midpoint sitting on the mirror.

Step 6 — The swap method is just "reverse the arrows" in algebra
WHAT. The mirror rule "" applied to the whole equation means: swap the letters and , then solve for . That is the algorithm, and now you know why it is nothing more than reversing arrows. And because the letters swap, the domain and range swap with them.
WHY. We want the rule for . Since maps while maps , everywhere had "input" we now write "output" and vice-versa. Swapping the symbols does exactly that bookkeeping — including which set the numbers are allowed to come from.
PICTURE. The worked line laid beside its graph: swap to , solve to , and the two curves shown reflecting across .

Step 7 — Degenerate case: rescue a broken machine by restricting its domain
WHAT. failed Step 4 because both halves of the parabola exist. Throw away one half. Keep only . Now every horizontal line hits the surviving curve once — it passes the test — and appears as the mirror image of that right half.
WHY. The collision came from having a left arm and a right arm at the same height. Delete one arm, delete the collision. This same trick tames the Trigonometric Functions (restricting to ) and is why Domain and Range must be tracked at every swap.
PICTURE. The full parabola greyed out; the kept right half in bold; its mirror drawn across ; the discarded left half faded to show what we sacrificed.

The one-picture summary
Everything at once: the machine, its reversed twin, the diagonal mirror, the passing/failing horizontal-line tests, and the restriction rescue — one frame.

Recall Retell it like Feynman (plain words, no symbols)
A function is a box that turns each number into one other number — picture one arrow leaving every number on the left. The right side comes in two flavours: the numbers you allowed as possible outputs, and the smaller batch the box actually hits. An inverse is the same picture with the arrows flipped backwards, so you can walk home — but you can only start the walk from a number that actually got hit, otherwise there is no arrow to follow. Flipping is only allowed if no two arrows ever crashed into the same landing spot — because a flipped crash would mean one number has to point two places, which a box can't do. To see whether any crash happened, draw the box as a curve and slide a flat horizontal ruler across it: if the ruler ever touches the curve twice at once, two numbers landed on the same spot — no inverse; and a height the curve never reaches is a number the box never hits, so the reverse machine has nothing to give there. When you draw the flipped picture on the same axes, flipping every arrow is exactly mirroring the curve across the slanted 45-degree line where input equals output — because swapping a point's two coordinates reflects it across that line, meeting it at a perfect right angle. In algebra, that mirror is just "swap the two letters and solve again," and when you swap the letters you must also swap which numbers are allowed in and out. And if a box did have crashes, like squaring, you fix it by throwing away half the inputs so no two ever collide again — then the flipped picture is a genuine function once more.
Related deep pillars: Function Composition · Domain and Range · Bijective Functions · Exponential and Logarithmic Functions · Trigonometric Functions.