Relations, Functions & the Vertical Line Test
A relation is any set of ordered pairs . A function is a special relation in which every input is paired with exactly one output . In other words: no -value is allowed to repeat with two different -values.
- The set of all allowed inputs is the domain.
- The set of all resulting outputs is the range.
A function assigns exactly one output to each input (the vertical line test). Transformations move a graph without redrawing it: shifts up, shifts right, reflects, stretches vertically. Composition feeds one function into another; the inverse reverses the input–output pairs and exists only when the function is one-to-one.
The vertical line test is the definition of a function in pictures. A vertical line collects every point with one particular input; if it meets a graph twice, that input has two outputs. The sideways parabola fails at , where and ; the tilted line meets every vertical line exactly once.
Consider .
The input appears twice, paired with both and . Since one input gives two outputs, is not a function.
Now is a function: every input is used once. (It is fine for two inputs to share an output, as and both give .)
Rejecting a relation because two inputs share an output: is a function. The rule forbids one input with two outputs, not two inputs with one output; a horizontal line may cross a function's graph many times.
A graph represents a function if and only if no vertical line crosses it more than once. A vertical line is a set of points with the same ; hitting the graph twice would mean one has two 's.
The tilted line and the sideways parabola from the tip below, on one set of axes.
Tip: The dashed vertical line on the right hits the sideways parabola twice, so that curve fails the test. A tilted straight line always passes.
Which are functions: ; ; ; ?
Show the answerHide the answer
The first is: each input once (sharing an output is fine). The second is not: input has two outputs. The circle is not: gives and . is: each gives one value.
Function Notation, Evaluating, Discrete vs. Continuous
We write (read “ of ”) for the output of function at input . The letter is a placeholder: to evaluate, substitute the given value everywhere appears and simplify.
Function notation keeps track of which input produced which output, so is a complete fact: the point is on the graph. Evaluating at an expression like is the same substitution, done symbolically, and it is how new functions (shifts, compositions) are built from old ones.
Let . Then
You can also evaluate at an expression: .
Evaluating as . For , , but . The whole input replaces .
A discrete function is defined only at separated points (draw dots), e.g. “number of students” vs. “number of pizzas.” A continuous function is defined on an unbroken interval (draw a solid curve), e.g. “temperature” vs. “time.”
Tip: does not mean times . It is a single output value.
For , find , , and all with .
Show the answerHide the answer
. . gives , so or .
Parent Functions and Their Graphs
Each family of functions is built from a simple “parent.” Memorize their shapes, domains, and ranges.
Every function in this course is one of these parents moved, stretched or flipped, so knowing six shapes lets you sketch hundreds of graphs. Their domains and ranges come from what the rule allows: needs , forbids and never outputs , and an even power like never outputs a negative.
Each parent is drawn on the window , .
Tip: and both open upward with a minimum at the origin, but the parabola is curved while the absolute value is two straight rays meeting in a sharp corner.
Giving the range by analogy with . An odd power keeps the sign: . The range of is all real numbers.
Give the domain and range of , and .
Show the answerHide the answer
: domain , range . : domain and range all reals except . : domain all reals, range .
Transformations:
Starting from a parent , the graph of is transformed as follows:
- : vertical shift — up if , down if .
- : horizontal shift — right if , left if (it moves opposite the sign inside).
- : vertical stretch if , vertical compression if .
- : reflection over the -axis. Replacing with reflects over the -axis.
Why does move right? The new graph takes the value had at , so to reproduce what happened at it must reach : every feature arrives units later, which is to the right. Outside changes act on outputs and move the graph the way they read: adds to every height, and multiplies every height, flipping it when .
Compare to the parent . Here , , , so is the parabola stretched vertically by , reflected over the -axis, shifted right and up . Its vertex is and it opens downward.
Shifting the wrong way: moves the graph RIGHT by . The input must be larger to produce the same output.
Tip (order of operations for graphs): apply horizontal shift and stretch/reflection first, then the vertical shift last. The vertex of is always .
Write the equation of reflected over the -axis, compressed by , shifted left and up . Where is its corner?
Show the answerHide the answer
. The corner moves from to , and the graph opens downward.
Operations on Functions
For two functions and :
The domain of the result is where both pieces are defined, and for the quotient we also exclude any with .
Functions add, subtract and multiply pointwise: at each input, combine the two outputs. So exists only where both and exist, which is why domains intersect, and a quotient loses any input where the denominator's output is .
Let and . Then
Forgetting the quotient's domain after simplifying: for and , , but is still excluded because .
Tip: Operations happen at the same input. Only the quotient forces you to worry about a zero denominator.
For and , find , and the domain of .
Show the answerHide the answer
. . needs (for ) and : .
Composition of Functions
The composition means: run first, then feed its output into . Composition is usually not commutative: in general.
A composition is a chain of machines: the output of becomes the input of . The order matters because the machines do different things: subtracting then squaring is not squaring then subtracting , which is why while .
Let and .
And numerically .
Multiplying instead of composing: . The circle means substitute: .
Tip: Work from the inside out. Substitute the whole expression for into every of .
For and , find , , and .
Show the answerHide the answer
, so . , so . .
Inverse Functions
The inverse undoes : it swaps inputs and outputs, so if then . To find it: replace with , swap and , then solve for .
An inverse reverses every input-output pair, so the point on becomes on . Swapping coordinates is reflecting across the line , which is why the two graphs are mirror images. A function has an inverse function only if no output repeats, because otherwise the reversed pairs would give one input two outputs.
Let . Swap and solve: , so .
Verify by composition:
Both compositions give , confirming the inverse.
Reading as . For , is the reciprocal; the inverse is . Check: .
Tip: The graph of is the mirror image of across the line . If passes the vertical line test and its inverse must too, must be one-to-one (pass the horizontal line test).
Find the inverse of and verify with one number.
Show the answerHide the answer
Swap and solve: , so : . Check: and .
Piecewise Functions
A piecewise function uses different formulas on different parts of the domain. To evaluate, first decide which interval the input falls in, then use that piece.
A piecewise function is still one function: every input belongs to exactly one piece, so it has exactly one output. The inequalities attached to the pieces are the rules for which formula applies, and the open and closed dots on the graph show who owns each boundary.
Watch the endpoints: at we use because that piece includes ().
Evaluating at a boundary with the wrong piece: . The first piece is for only; falls under , so .
Tip: A filled dot means the endpoint is included ( or ); an open dot means it is not ( or ). Only one piece may own each .
Parking costs for up to hours and for each additional hour or part of an hour, capped at . Find the cost for , and hours.
Show the answerHide the answer
h: . h: extra started hours, . h: , over the cap, so .
Going Deeper: Advanced Function Ideas
A functional equation constrains an unknown function instead of an unknown number. The classic trick: substitute a cleverly chosen input to generate a second equation, then treat and as two unknowns and eliminate. For equations mixing with , the magic substitution is , which swaps the two terms.
Write the given equation, then replace every with (note ):
Now eliminate : multiply (2) by and subtract (1):
So . Check: ✓
Composing with itself is written , so . Beware: this is iteration, not the power and not the inverse .
- If (the identity ) for some , then is periodic under iteration with period dividing , and depends only on .
- An involution is the special case : , so is its own inverse, . Its graph is symmetric across .
(a) Iteration. Let . Then
So : the map has period . To find , reduce the exponent: , hence .
(b) Involution. Let . Composing with itself,
so is an involution: . Any is self-inverse for the same reason.
Let and , and form . The domain needs two conditions, checked in order:
- must be legal for the inner : .
- The output must be legal for the outer , i.e. : .
Domain: with the two holes removed. Moral: the domain of is not just the domain of ; you must also delete inputs whose output lands in a forbidden spot for .
A function is invertible exactly when it is one-to-one (passes the horizontal line test). You do not need an explicit formula for to know it exists:
If is strictly increasing on its domain (or strictly decreasing), then is one-to-one, so exists.
For example, is a sum of the strictly increasing pieces , , and a constant, so it is strictly increasing and therefore invertible on all of — even though solving for by hand is hopeless. Monotonicity is also how you restrict a non-injective parent (like ) to make it invertible: choose a branch, e.g. .
A function is even if (graph symmetric across the -axis) and odd if (symmetric through the origin). Symmetry halves your work: knowing on determines it everywhere. Two facts worth memorizing:
- Products behave like parity signs: , , .
- Every function splits uniquely into an even part plus an odd part: @@BLOCK0@@
Tip: If is odd then (set in ). And if a problem asks for and you already know , don't recompute — just flip the sign for odd, copy for even.
Choose the constant so that
is continuous. Continuity at the seam requires the two pieces to agree there. The left piece gives ; the right piece approaches as . Set them equal:
With the graph joins with no jump. For any other there is a gap of height at .
A chain of transformations can always be collapsed into a single rule . Track what happens to a generic point, applying inner (horizontal) changes to and outer (vertical) changes to the whole expression. Order matters, because a horizontal shift done before a horizontal stretch is not the same as after.
Example. Starting from , reflect over the -axis, then shift left , then stretch vertically by , then shift up . Building inside-out, the horizontal reflect-and-shift turns the input into , and the outer stretch-and-shift wraps it:
A single expression now encodes all four moves — feed in one , get the fully transformed .
Why It Works
Why does shift right? The point that used to be at on now appears where , i.e. at : every point moved to the right. Vertical changes act on the output directly, so they read the natural way; horizontal changes act on the input, so they read backwards. The inverse function swaps and , which reflects the graph across the line — and a graph that fails the horizontal line test would fail the vertical line test after the swap, hence "one-to-one".
Do not read a proof the way you read a rule. Cover the last line, ask what the previous line forces, and only then uncover it. If a step feels like magic, that is the step to work by hand with a concrete number.
Formulas, Proofs & Tips
What it means. shifts right, shifts up, stretches vertically (flipping if negative), compresses horizontally.
Example. shifts right and up .
Why it works. Inside changes act on the input before does, so they run backwards: replacing by means the graph reaches a given output units later, i.e. shifted right. Outside changes act after , so they behave as written.
Tip. Inside the function: opposite of what it looks like. Outside: exactly what it looks like.
What it means. The inverse undoes the function; their graphs are mirror images across .
Example. has inverse , and .
Why it works. Swapping and in and solving for produces the rule that reverses each input–output pair. Reflecting across is exactly what swapping coordinates does geometrically.
Tip. Only one-to-one functions have inverses. If a horizontal line hits the graph twice, restrict the domain first.