Functions and the Elementary Families
Learning Objectives
- State what a function is (domain, codomain, range) and find the natural domain of an expression that involves a quotient, an even root, or a logarithm.
- Form a composition , find its domain, and explain why and are usually different functions.
- Decide when a function has an inverse, build it, and name the domain restriction that makes it exist.
- Recognize the six families the rest of the discipline uses (affine, quadratic, polynomial, exponential, logarithmic, trigonometric) and describe the shape, domain, and range of each.
- Use the logarithm to answer "how many doublings" and "how long to double" questions, and avoid the domain errors that logarithm laws invite.
Context & Motivation
Calculus studies how a quantity changes when another one does, so every statement in it is a statement about a function. A function is the mathematical version of a pure procedure: give it an input, get exactly one output, with no hidden state. Programmers already think this way, but with one difference that matters here. Code usually accepts "any integer" or "any float" and crashes or returns garbage outside the cases the author imagined. Mathematics asks for the set of legal inputs to be part of the definition, and most of the errors in calculus (a cancelled factor that removed a point, a logarithm of a negative number, an inverse that is not an inverse) are errors about that set.
This lesson also does something unusual for a calculus course: it absorbs the precalculus the later lessons assume. It is selective. It does not re-teach factoring or the unit circle from scratch. It collects the facts that limits, derivatives, and integrals will use again and again: what a domain is, how composition and inverses work, and the handful of function families that model almost everything. The exponential and logarithm get the most attention, because they connect directly to computing: the number of times you can halve a problem before it is solved is a logarithm, and a quantity that doubles each step is an exponential. The next lesson, limits-intuition-and-the-formal-definition, assumes everything here.
Core Theory
Functions, domain, and range
A function from a set to a set assigns to each in exactly one element of . is the domain, the codomain, and the set of values actually produced, , is the range. The range can be smaller than the codomain: with codomain has range .
When a formula is given without a domain, the natural domain is the set of real for which the formula makes sense. Three restrictions cover almost every case:
- a denominator must not be zero ( excludes );
- an even root needs a nonnegative argument ( needs );
- a logarithm needs a positive argument ( needs ).
A graph of represents a function only if every vertical line meets it at most once. Whether a function is one-to-one (never gives the same output for two different inputs) is the horizontal-line version of the test: every horizontal line meets the graph at most once.
In code, math.sqrt(-1) raises a ValueError in Python, which is the domain being enforced. NumPy returns nan instead, which is the domain being ignored, and the nan then travels through the rest of the computation. Knowing the domain in advance is the way to tell which one you got.
Composition and inverses
The composition applies first. Its domain is the set of in the domain of for which lies in the domain of . Order matters: with and , we get but .
A function has an inverse exactly when is one-to-one. The inverse is defined on the range of and undoes it:
The hypothesis is not decoration. on all of is not one-to-one, since , so it has no inverse. Restricting the domain to makes it one-to-one, and then the inverse is . Without the restriction, "undoing" fails: , not . The correct identity on all of is . The graph of is the graph of reflected across the line .
The families
- Affine, : domain . Constant rate of change ; is the value at .
- Quadratic, with : domain . A parabola with one vertex, so the range is bounded on one side.
- Polynomial, with : domain . At most real roots, and for large the term dominates.
- Exponential, with , : domain , range . Grows if , decays if .
- Logarithm, : domain , range . The inverse of .
- Trigonometric, , , : and have domain , range , and period ; excludes .
Quadratics. Completing the square rewrites as , which exposes the vertex and the range at once. The discriminant tells how many real roots there are: two if positive, one if zero, none if negative.
Exponentials and logarithms. Writing for the inverse of gives, for every real and every :
The laws and hold for . Changing base is a constant factor: . The special base is the one whose exponential has the simplest rate of change, which a later lesson, derivatives-of-exponentials-logarithms-and-trigonometric-functions, explains.
Trigonometry. Angles are measured in radians, so that the arc length on the unit circle equals the angle. The point at angle on the unit circle is , which gives the identity . Because and repeat every , neither is one-to-one on . Their inverses exist only after a restriction: returns values in and in .
Worked Examples
Example 1: domain and range
Find the natural domain of and the range of .
For , the root needs , so . The denominator forbids . The domain is .
For , complete the square: . A square is never negative, so , with equality at . Every value above 3 is reached, so the range is . The discriminant is , which agrees: the graph never touches the -axis. A numerical scan of over gives a minimum of exactly .
Example 2: composition and inverse
Let . Its range is . To invert, set , take of both sides (legal because ), and solve:
So with domain , the range of . Check both compositions:
A numerical check at gives and . The second identity needs . Without that restriction it fails, because does not exist.
For a composition domain, take and . Then , with domain : the inner function is defined everywhere, but its output must land in the domain of the square root.
Example 3: the logarithm in computing, and a trigonometric equation
How many doublings reach a billion? Start with and double until . We want the smallest integer with , that is , so . Running the loop confirms it: it stops after 30 iterations with . The same count appears when a search halves its range each step, which is why halving a range of items takes at most steps.
How long to double at 7% per year? We need , so years. Whole-year checks agree: is still short of 2, and has passed it.
Solve on . The inverse function gives , but is not one-to-one here, and the calculator reports only one answer. The symmetry gives the second solution . Both satisfy the equation numerically ( up to rounding). The inverse of a restriction returns one representative of the solution set, so you must supply the others.
Common Misconceptions & Pitfalls
- "Cancelling a factor does not change the function." and agree for every , but they are different functions: the first has no value at . This difference is the starting point of the next lesson.
- " means ." The in is the inverse under composition, not a reciprocal. is , while is .
- "." It equals . Squaring and rooting only undo each other on .
- "." The rule needs . For , the left side is , while does not exist. The safe form for all is .
- "Polynomials of degree have real roots." They have at most . The quadratic has none.
- "Degrees and radians are interchangeable." Calculus formulas for trigonometric functions assume radians. Computing
sin(30)in a language that uses radians answers a different question from . - "A computed is exactly 0." In double precision it is about , because itself is stored rounded. Numerical code compares to a tolerance, not to zero.
Summary
A function is a rule together with its domain, and many calculus mistakes are domain mistakes: a denominator that vanishes, an even root of a negative number, a logarithm of a nonpositive number. Composition applies one function after another and its domain is cut down by the inner output. An inverse exists only for a one-to-one function, which is why , , and need restricted domains before they can be inverted. The families to carry forward are affine (constant rate), quadratic (a vertex and a discriminant), polynomial (dominated by the leading term), exponential and logarithm (inverses of each other, with the logarithm counting doublings and halvings), and the periodic sine and cosine. The next lesson, limits-intuition-and-the-formal-definition, uses these functions to ask what a function does near a point where it may not be defined.