Contents / Precalculus / Functions & Graphs
Chapter 1
Functions & Graphs
Function notation, domain and range, symmetry, inverses, composition, transformations, and piecewise definitions.
Introduction
Function notation, domain and range, symmetry, inverses, composition, transformations, and piecewise definitions.
1.1Function (mathematics)
A function is a fundamental mathematical object that assigns to each input in its domain exactly one output. This precise relationship underpins almost all of precalculus, calculus, and higher mathematics.
What Is a Function
Definition 1.1 (Function). A function from a set (the domain) to a set (the codomain) is a rule that assigns to every element exactly one element . We write this as
The "exactly one" condition is essential: no input may produce two different outputs.
Functions can be presented in many forms: an algebraic formula such as , a table of input-output pairs, a graph in the coordinate plane, or even a verbal description. Only the last two hide the rule; the definition is the same in every case.
Proposition 1.2 (Vertical line test). A curve in the coordinate plane is the graph of a function of precisely when no vertical line intersects it more than once.
The test is the definition drawn: a vertical line collects all the outputs assigned to one input, so two intersections are two outputs for the same .
Definition 1.3 (Equality of functions). Two functions are equal if they have the same domain and produce the same output for every input in that domain.
Intuition. Think of a vending machine or a soda fountain button: press "A1" and you always get the same drink. If pressing A1 sometimes gave cola and sometimes orange, it would violate the function rule.
In programming, a pure function is deterministic: same inputs always yield the same output, making it reliable and testable.
Example 1.4 (Determining whether a relation is a function from a set of points). Given the set of ordered pairs: .
Solution. Group by input (first coordinate): input appears in both and , so it is paired with outputs and . Because input maps to two different outputs, this relation fails the "exactly one output" rule, so it is not a function. If we remove the pair , the remaining set is a function: each input () now appears exactly once. Sanity check the "shared output" case: inputs and both map to . This is fine — a function may send different inputs to the same output; only one input to two outputs is forbidden.□
Common Mistakes
- Vertical line test misapplied on non-graphs: The test only applies to graphs in the Cartesian plane; equations or sets of points require checking the definition directly.
- Forgetting that different inputs may share outputs: A function can send 1 and 2 both to 5; only the reverse (one input to two outputs) is forbidden.
- Confusing a function with being one-to-one (injective): Not every function is invertible; is a function but not one-to-one over all reals.
- Ignoring the domain when claiming two formulas define the same function: and agree where defined but have different domains.
- Assuming every relation or equation defines y as a function of x: Circles, vertical lines, and are classic counterexamples.
- Forgetting that the codomain is part of the definition: Two functions with same rule but declared different codomains are technically different (though range is what matters for outputs produced).
1.2Domain of a function
The domain tells us exactly where a function is allowed to receive inputs. It is the first thing to determine when analyzing or graphing any function given by a formula.
Domain of a Function
Definition 1.5 (Domain). The domain of a function is the complete set of input values for which the function produces a defined output.
When a function is given by a formula, the domain is not announced: it is whatever survives after we exclude the values that cause division by zero, negative numbers under even roots, or other undefined operations.
Method 1.6 (Reading the domain off a formula). Start from all real numbers and delete the inputs that break an operation.
- Denominators cannot be zero: for the domain is all reals except .
- Even roots require nonnegative radicands: requires .
- Logarithms require positive arguments: requires .
Intersect the surviving conditions, then write the answer in interval notation or set-builder notation.
Intuition. The domain is the "approved ingredients list" for the function recipe. You cannot feed the function something off the list or the calculation breaks (division by zero, square root of negative, etc.).
Example 1.7 (Finding the domain of ). Square root requires the inside : .
Solution.
- Denominator cannot be zero: .
- is already inside the interval from step 1, so we must exclude it explicitly.
- Combine both requirements: keep but remove . The domain is therefore (all with , ).
- Sanity check: test (excluded — denominator is ) and (included — gives , defined) ✓.
Common Mistakes
- Forgetting to exclude points that make radicands negative or logs undefined: Always check even roots and logs first.
- Stating the domain without considering simplification: A factor that cancels may turn an asymptote into a hole; simplify before deciding exclusions.
- Using incorrect interval notation: Remember to use parentheses for strict inequalities and brackets for inclusive; unions ∪ for disjoint pieces.
- Assuming all real numbers is always the answer: Most interesting functions have restrictions; defaulting to ℝ without checking is a common error.
- Confusing domain with range: Domain concerns inputs (x-values); range is outputs (y-values).
- Over-restricting for odd roots or polynomials: Cube roots and polynomials are defined for all reals; only even roots and certain denominators/logarithms restrict.
1.3Range (mathematics)
The range describes every value the function can actually output. Determining the range often requires more work than the domain: completing the square, analyzing extrema, or using the graph.
Range of a Function
Definition 1.8 (Range). The range (or image) of a function is the set of all possible output values as runs through the entire domain.
While the domain is often easy to read from the formula, the range may require analyzing the minimum/maximum values, solving for in terms of , or inspecting the graph. For example, (domain all reals) has range because squares are never negative and can be arbitrarily large.
Intuition. If domain is "what you can put in", range is "what you can possibly get out". A function that squares its input can never spit out a negative number no matter what you feed it.
Example 1.9 (Determining the range of ). Find every value this quadratic can output.
Solution. Complete the square: . for all real , with equality at . Therefore the smallest value of is (attained at ), and since grows without bound, can be arbitrarily large. Range is . Sanity check: ✓, matching the minimum we found.□
Method 1.10 (Finding a range by solving for the input). When there is no obvious minimum to complete-square, the general technique is to solve for in terms of and ask which produce a real, in-domain . The values of that fail are exactly the ones missing from the range.
Example 1.11 (Determining the range of (domain ) by solving for ). Set and solve for : multiply out to get , i.e. .
Solution.
- Gather -terms: .
- Solve: .
- This gives a valid for every except , where the denominator is zero (no maps to ).
- Range is all reals except : .
- Sanity check: would require , i.e. , which is impossible — confirming is never an output.
Common Mistakes
- Assuming range is always all reals when domain is: Even with full domain, never produces negatives.
- Confusing range with codomain: The codomain is what we say the function maps into; the range is the actual image of the domain under f.
- Forgetting to use completing the square or calculus for quadratics: Vertex form immediately reveals min/max for parabolas.
- Thinking range of 1/x is all nonzero: Actually yes it is, but students sometimes claim positive only.
- Ignoring holes or asymptotes when reading range from graph: A function may approach but never reach a horizontal asymptote, excluding that value from range.
- For exponential or log: exp range (0,∞), log domain (0,∞) but range all reals; mix them up.
1.4Even and odd functions
Symmetry in functions is a powerful shortcut. Even functions mirror across the y-axis; odd functions rotate 180° around the origin. Recognizing them saves work in graphing, integration, and series.
Even and Odd Functions
Definition 1.12 (Even and odd functions). A function is even if
and odd if
The graph of an even function is symmetric with respect to the y-axis; examples are , and . The graph of an odd function is symmetric with respect to the origin; examples are and .
Most functions are neither. Knowing symmetry can simplify integrals, graphing, and Fourier analysis later.
Intuition. Even is like a mirror down the y-axis: the left side of the graph is the mirror image of the right side.
Odd is point symmetry through the origin: if you rotate the graph 180 degrees around (0,0) it looks the same.
Example 1.13 (Classifying and proving the property). The test is always the same: compute , then compare it to both (even?) and (odd?).
Solution. Compute . (Recall for even .) Since for every real , the function is even. Graphically this means the graph is symmetric left-right about the y-axis.
Contrast with a function that is neither. Take .
Compute . Is it even? (they differ unless ), so not even. Is it odd? , and , so not odd. Since matches neither nor , is neither even nor odd. This is the typical outcome when a formula mixes even powers (like ) with odd powers (like ).□
Common Mistakes
- Forgetting to check the entire domain: Symmetry must hold for every x in the domain, not just some points or positive x.
- Misclassifying polynomials by degree only: Even degree can be odd if only odd powers (e.g. x^3 + x is odd); check the powers present.
- Confusing even/odd with increasing/decreasing: Monotonicity is different from y-axis or origin symmetry.
- Thinking constant functions are odd: Constants (nonzero) are even; only the zero function is both.
- Sign errors when testing odd: f(-x) must equal exactly the negative, including all terms.
- Assuming trig functions: sin is odd, cos even, tan odd: Always verify with the definitions rather than memorizing only.
1.5Inverse function
Inverses let us reverse processes. Not every function has one; it must be one-to-one. The inverse swaps domain and range.
Inverse Functions
Definition 1.14 (Inverse function). If a function is one-to-one (injective), its inverse function is the function satisfying
The inverse "undoes" the original function.
Proposition 1.15 (Horizontal line test). A function has an inverse if and only if it is one-to-one; on its graph this is the horizontal line test — no horizontal line may meet the graph more than once.
The domain of is the range of , and vice versa: reversing the arrows swaps the two sets.
Method 1.16 (Finding a formula for an inverse).
- Write .
- Swap and .
- Solve the new equation for ; that expression is .
- Check both compositions return the input, and record the swapped domain and range.
Intuition. An inverse is like an undo button. If turns 3 into 7, the inverse turns 7 back into 3. Only functions that never repeat an output value have a true undo button.
Example 1.17 (Finding the inverse of ). Set .
Solution.
- Swap: .
- Solve: .
- Therefore .
- Verify both directions: ✓, and ✓.
Example 1.18 (Inverting a non-injective function by restricting the domain). on all reals has no inverse, because : the output has two preimages, so there is no unique way to "undo" it (it fails the horizontal line test).
Solution. Restrict the domain to make one-to-one. Choose ; now each nonnegative output comes from exactly one input. Set with and solve: (we take the positive root because the restricted domain is ). Swapping names, . Track domains and ranges: the restricted has domain and range , so has domain and range — the swap of the original. Verify: for , ✓ (the last equality holds precisely because ; this is exactly why the domain restriction matters).□
Common Mistakes
- Trying to invert non-injective functions without restricting domain: x² has no inverse over reals; restrict to [0,∞) first.
- Forgetting to swap x and y then solve: The swap step is essential; simply negating or other shortcuts fail.
- Ignoring domain/range swap: The inverse's domain is the original range; formulas may need adjustment for the new domain.
- Not verifying the composition is identity: Always check f(f^{-1}(x))=x and f^{-1}(f(x))=x on the proper domains.
- Assuming all functions have inverses: Linear, exp, log do (with care); quadratics, trig over full periods do not.
- Sign or algebra errors when solving for inverse: Isolate carefully after the swap; common in linear and rational cases.
1.6Composition of functions
Composition chains functions: the output of one becomes input to the next. It is the mathematical version of "do this, then that."
Composition of Functions
Definition 1.19 (Composition of functions). The composition of and is the function
We apply first, then feed the result into .
Proposition 1.20 (Order matters, grouping does not). Composition is associative,
but it is not commutative: in general .
This operation lets us build complicated functions by chaining simpler ones, exactly as we do when describing multi-step processes.
Intuition. Composition is "function of a function": first do one transformation, then do another to the result. Like "take the temperature in Celsius, convert to Fahrenheit, then tell me if it is above freezing."
Example 1.21 (Computing and simplifying a composition). Let and .
Solution. Compute . (Here we substituted the whole expression into wherever an appeared.) Compute . They are different (), showing order matters. Sanity check at : , and the formula gives ✓. Meanwhile , and its formula gives ; they coincide at this one point but not in general.
A note on domain (rigor): for to be defined, must be in the domain of and must be in the domain of . Here both and are defined on all reals, so the composition is too; but with roots or denominators inside, always intersect these two conditions. For instance, inherits the restriction from the inner .□
Common Mistakes
- Reversing the order of composition: f∘g means g inside; students often compute the outer function first.
- Forgetting that composition is not commutative: f(g(x)) ≠ g(f(x)) in general (e.g. sin(x^2) vs (sin x)^2).
- Not checking domains for the inner function: g(x) must be in domain of f; the overall domain is restricted to where g(x) is valid for f.
- Algebra errors when simplifying (f∘g): Expand carefully; (3x-1)^2 +1 is not the same as applying in wrong order.
- Assuming (f∘g)^{-1} = f^{-1} ∘ g^{-1}: Actually (f∘g)^{-1} = g^{-1} ∘ f^{-1} (reverse order).
- Confusing composition with multiplication or addition of functions: (f+g)(x)=f(x)+g(x) is pointwise, not chained.
1.7Transformation of functions
Transformations let us take a basic parent function and quickly obtain families of related graphs without starting from scratch each time.
Transformations of Functions
We can obtain new functions from old by shifting, stretching, reflecting, or flipping.
Proposition 1.22 (The basic transformations). Let be a function, and let , and be constants.
- Horizontal shift: shifts the graph right by (left if negative).
- Vertical shift: shifts up by .
- Horizontal stretch/compress: ( |c|>1 compresses toward y-axis).
- Vertical stretch: .
- Reflection: over x-axis; over y-axis.
These transformations preserve many important properties while allowing us to move graphs to convenient locations.
A useful mental split: everything inside acts on the input (horizontal, and behaves "backwards" — you solve for what the argument must be), while everything outside acts on the output (vertical, and behaves the way you'd expect). When several transformations combine, apply horizontal operations to the -coordinate and vertical operations to the -coordinate of each point, respecting how they are nested.
Intuition. Transformations are like giving the whole graph a "move and resize" command without changing its basic shape. Right/left for inside the function, up/down for outside.
Example 1.23 (Applying successive transformations to ). Start with parent (domain , range ).
Solution. To get , read the transformations off the formula: Inside : horizontal shift right 3 units. Multiply the root by 2: vertical stretch by factor 2. Subtract 4: vertical shift down 4 units. New domain: the inside must stay nonnegative, , i.e. domain . New range: , so , so ; range is . The corner point (originally ) moves to : the input makes the root , and then . Sanity check with a second point: on the parent, satisfies . Its image should be , , i.e. . Verify directly: ✓.□
Example 1.24 (A transformation with a reflection: locating the image of the corner point). Transform the parent into and find the image of the corner .
Solution. Horizontal: inside shifts right 1, so the -coordinate . Vertical, applied in order to the output: the root value at the corner is ; multiply by (reflect over the x-axis and stretch by 2) gives ; then gives . So the -coordinate . The corner lands at . Sanity check: ✓. (Note the reflection did not move the corner's height here only because the root is there; away from the corner, flips points below the shifted axis.)□
Common Mistakes
- Reversing horizontal shift direction: f(x-h) shifts right (h positive inside moves graph right); intuition often gets the sign backwards.
- Mixing inside vs outside multipliers: c f(x) is vertical stretch by |c|; f(c x) is horizontal.
- Forgetting reflections flip the whole graph including shifts already applied: Order of operations in successive transforms matters.
- Domain/range adjustments after shifts/stretches: Inside horizontal changes domain; vertical changes range. Always update both.
- Thinking -f(x) reflects over y-axis: -f(x) is over x-axis; f(-x) is over y-axis.
- Assuming stretches always expand: |c|<1 actually compresses (shrinks).
1.8Piecewise function
Piecewise functions use different rules in different intervals. They model real-world situations with thresholds (tax brackets, speed limits, absolute value).
Piecewise Functions
Definition 1.25 (Piecewise function). A piecewise function is defined by different formulas on different parts of its domain. We use a brace notation:
To evaluate, choose the piece that contains the input. To graph, draw each piece only on its interval and be careful at the "seams" (check continuity or jumps).
Piecewise definitions appear naturally when modeling real situations that change rules at thresholds (tax brackets, absolute value, etc.).
Intuition. A piecewise function is like having two (or more) different recipes and a rule that says "use recipe A on weekdays before noon, recipe B otherwise." The overall machine is still one function.
Example 1.26 (Evaluating and graphing a piecewise function). Let
Solution. Evaluate : since , use the first piece: . Evaluate : since , use the second piece: . Evaluate : since , use the second piece: . Check the seam at . Approaching from the left we follow the first piece: as , . Approaching from the right (and at itself) we follow the second piece: . The left limit () and the right value () disagree, so the graph has a jump discontinuity at : plot an open circle at on the line and a closed circle at on the parabola. Sanity check: each input satisfies exactly one condition (the conditions and partition the reals with no gap or overlap), so every evaluation used a single, unambiguous piece.□
Common Mistakes
- Evaluating at the boundary with the wrong piece: The definition specifies ≤ or < ; always check the exact condition at the point.
- Forgetting to graph only on the piece's interval: Do not extend a piece beyond its if-condition.
- Missing jump discontinuities: At boundaries, left and right limits may differ; plot open/closed circles correctly.
- Assuming the function must be continuous: Piecewise functions are often discontinuous by design (step functions, absolute value at 0 is continuous but many are not).
- Algebra mistakes when finding where pieces meet: Solve the boundary equations carefully when finding intercepts or intersections.
- Not stating the full domain when describing the function: The pieces together must cover the intended domain without gaps or overlaps in conditions.