Chapter 03 · Algebra
Your notes
Bookmarks
Calculator
03.01
Functions
What a function is and the ways to give one; function notation and evaluating, including at expressions like a + h; the implied domain of a formula; the range from a graph or a formula; one-to-one and onto functions; and functions built from real situations.
About 40 minutes
You'll learn to
- →Decide whether a relation given by ordered pairs, a graph, an equation or a description is a function
- →Evaluate a function from a formula, a table or a graph, including at expressions, and find the inputs that give an output
- →Find the implied domain of a formula, and the practical domain in a real situation
- →Find the range of a function from its graph or its formula
- →Tell whether a function is one-to-one, onto or both, and restrict a domain to make it one-to-one
Summary video coming soon
A short video recap of the whole lesson is on its way.
1. What is a function?
Video coming soon
A short video for this part is on its way. Everything you need is in the text below.
Much of math is about how one quantity depends on another: the position of a car as time passes, the cost of a print run as the number of copies grows. The idea that ties two quantities together is the function, and it's the main character of every chapter from here on.
The definition
A function from a set to a set is a rule that assigns to every element of exactly one element of , called . The set of allowed inputs is the domain of , and , where the outputs live, is its codomain. We write .
Think of a machine: put in , get out . Two things are required of it:
- every input in the domain gives an output (the machine never jams), and
- each input gives exactly one output (the same input always gives the same result).
Nothing stops two different inputs from giving the same output. Squaring sends both and to , and it's still a function.
Five ways to give a function
- A formula, like .
- A table of inputs and outputs.
- A set of ordered pairs , like (sets are from section 01.08).
- A graph: the points in the plane (section 01.07).
- Words: "each person's age, in whole years".
A relation is any pairing of inputs with outputs, and a function is a relation that passes the "exactly one output" test.
is a function: the inputs , , each appear once. The repeated output is fine. But is not: the input has two outputs, and .
The vertical line test
On a graph, every point with input lies on the vertical line , because a point's input is its -coordinate. So a vertical line picks out one input and shows all the outputs the graph gives it: wherever the line meets the graph, the height of that point is an output for .
If the line meets the graph twice, say at and , then the input has two outputs, and a function can't do that. If it meets the graph once, has exactly one output. The test is the definition, "each input has exactly one output", checked one input at a time.
"Each input has exactly one output" says: no vertical line crosses the graph more than once. (A vertical line that misses the graph is fine: that input just isn't in the domain.)
Is a function of in ? Its graph is a circle, and the line crosses it twice:
Open in grapher (opens in a new tab)
Algebra says the same: with , , so or . Two outputs for one input, so it's not a function. Solving for in general gives , and the is the giveaway. By contrast, gives one for each , and its graph passes the test:
"Each student in a class that student's birthday" is a function: everyone has exactly one birthday, even if two students share one. "Each date the student born that day" is not: some dates have no student, and some have two.
- Thinking outputs must be different. Two inputs can share an output. Only one input with two outputs breaks the rule.
- Using a horizontal line for the test. The vertical line test checks inputs, which run along the -axis. (A horizontal line checks something else: whether a function is one-to-one, in "One-to-one and onto" below.)
- Calling an equation a function because it has and in it. Solve for , or try one -value: if some gives two 's, it isn't a function of .
A function from a set to a set assigns to every input in exactly one output in . is the domain. A function can be given by a formula, a table, a set of ordered pairs, a graph or a description in words.
Vertical line test: a graph is the graph of a function exactly when no vertical line crosses it more than once.
is a function: each input has one output, and two inputs may share one. is not.
2. Function notation and evaluating
Video coming soon
A short video for this part is on its way. Everything you need is in the text below.
Reading the notation
In , is the name of the function, is the input, and is the output at that input. The parentheses mean "at", not "times": is "the output of when the input is ".
When we write , is the independent variable (we choose it) and is the dependent variable (it depends on our choice).
The letter is only a placeholder. , and all describe the same function: "double the square, subtract five times the input, add one".
Evaluating at a number
Replace every with the input, wrapped in parentheses, then simplify (section 01.05).
For :
Without the parentheses, would be read as , and the answer would come out wrong.
Evaluating at an expression
The input can be any expression; the rule is the same. Replace each with the whole expression, in parentheses.
For the same ,
Notice that is not , and is not either. A function doesn't usually distribute over a sum.
Expressions like , the change in output when the input moves from to , are the starting point of calculus: dividing by gives an average rate of change, and the derivative (section 06.01) is what that becomes as shrinks to .
A table gives outputs directly: if the table of has , then is in the row under . On a graph, is the height of the graph above (or below) :
Open in grapher (opens in a new tab)
Here , and .
Going backwards: solving
Sometimes we know the output and want the input. Solve : find every in the domain whose output is . There may be one answer, several, or none.
For , means , so or : two inputs. And has no solution, since is impossible. On the graph of above, for and for every from to .
- Dropping the parentheses. needs , not .
- Replacing only some of the 's. Every in the formula gets the input, including the ones in later terms.
- Assuming or . Substitute into the formula and expand.
- Reading as times . is an output, not .
, read " of ", is the output of at the input ; it is not times . To evaluate, replace every in the formula with the input, in parentheses. The input can be an expression: for , . To solve , find every input whose output is .
gives .
3. Domain and implied domain
Video coming soon
A short video for this part is on its way. Everything you need is in the text below.
Stated and implied domains
A function's domain is part of its definition. Sometimes it's stated: " for ".
Often only a formula is given. Then the implied domain (or natural domain) is the set of all real numbers for which the formula produces a real number.
Find it by asking: which inputs break the formula? Everything else is in.
We write domains as intervals or unions of intervals (section 01.10), or with inequalities.
What breaks a formula
- Division by zero. is undefined at . Find the zeros of each denominator and leave them out.
- Even roots of negative numbers. , … need (section 01.02). Odd roots are fine everywhere: .
- Logarithms of zero or negatives. needs ; you'll meet it in section 03.16.
Polynomials such as never break: their domain is all real numbers, .
. The denominator is zero when , so at and . The domain is every other real number:
The numerator being zero (at ) is no problem: .
needs . Solve the inequality (section 01.06): , and dividing by reverses the inequality, . The domain is . Check: works, and doesn't. The endpoint is included because is fine.
. The root needs ; the denominator needs . Both must hold, so the domain is with removed:
And when a root sits in a denominator, as in , the inside must be strictly positive: would make the denominator zero. That domain is .
- Leaving out the zeros of the numerator. Only a zero denominator is a problem.
- Forgetting to reverse the inequality when dividing by a negative: gives , not .
- Missing a second zero. has two solutions, .
- Getting the endpoint wrong. Under a square root, is allowed (a bracket); in a denominator, it isn't (a parenthesis).
The domain is the set of allowed inputs. A formula given with no domain has an implied domain: every real number for which the formula gives a real number. Leave out inputs that would:
- make a denominator zero;
- put a negative number under an even root;
- take the logarithm of zero or a negative number (in section 03.16).
needs and : the domain is .
4. Range
Video coming soon
A short video for this part is on its way. Everything you need is in the text below.
Range
The domain is about inputs; the range is about outputs. It's the set of all values for in the domain:
The range sits inside the codomain, and it can be smaller: is a function from to , but it never outputs a negative number.
From a graph
Every output is the height of some point on the graph, so the range is the shadow of the graph on the -axis. Find the lowest and highest points, and check whether each is actually reached (a filled dot) or not (an open dot, or a graph that keeps going).
on the domain :
Open in grapher (opens in a new tab)
The lowest point is the left end, , and the highest is , in the middle. The range is . Plugging in only the endpoints would give and , and miss the top of the hump.
From a formula: build it up
Start from facts you know about the pieces:
and follow them through the formula. Then check that every value on the right side of the inequality is reached.
. Since , subtracting it from gives . Is every number reached? To get the output , we need , and that has a solution whenever . So the range is .
. The square root is and takes every value from up, so : the range is .
From a formula: solve for
A number is in the range exactly when the equation has a solution in the domain. Solving for shows which work.
. From , multiply by and divide by : . That gives an for every except (and is indeed impossible). The range is .
- Giving the domain instead. The range is read on the -axis, the domain on the -axis.
- Using only the endpoints. A graph can turn around in between, as in the first example.
- Including a value that's never reached. is never ; is never .
- Writing the interval backwards. , smallest first, not .
The range is the set of outputs the function actually produces. On a graph, it's the part of the -axis the graph covers. From a formula, build it from facts like and , or solve for and see which have a solution.
: since , , and . The range is .
5. One-to-one and onto
Video coming soon
A short video for this part is on its way. Everything you need is in the text below.
One-to-one functions
A function is one-to-one (or injective) when different inputs always give different outputs:
The second form is the contrapositive of the first (section 01.11), and it's the one to use in a proof: assume two outputs are equal, and show the inputs must be too.
is one-to-one. Suppose . Then , so , and .
To show a function is not one-to-one, one counterexample is enough: two different inputs with the same output.
is not one-to-one, because .
The horizontal line test
Points with the same output lie on one horizontal line. So a graph belongs to a one-to-one function exactly when no horizontal line crosses it more than once:
Open in grapher (opens in a new tab)
Restricting the domain
A function that isn't one-to-one can become one-to-one on a smaller domain. on keeps only the right half of the parabola, which rises the whole way, so no two inputs share an output. This is exactly how undoes : it only gives the non-negative answer.
Onto functions
A function is onto (or surjective) when every element of the codomain is an output: the range equals .
Whether a function is onto depends on the codomain we name:
- from to is not onto: no input gives , since has no solution.
- The same formula from to is onto: for any , the input gives .
Bijective functions
A function that is both one-to-one and onto is bijective: each element of the codomain is the output of exactly one input.
Then the function can be run backwards, from output to input. That reverse function is the inverse, the subject of section 03.05.
- Confusing the two line tests. Vertical: is it a function? Horizontal: is it one-to-one?
- Checking one pair and concluding "one-to-one". One pair with different outputs proves nothing about the others; use the algebra, or the horizontal line test.
- Forgetting the codomain. "Onto" is a question about a named target set. The same formula can be onto one set and not another.
- One-to-one (injective): different inputs always give different outputs; equivalently, forces . On a graph: no horizontal line crosses it twice.
- Onto (surjective): every element of the codomain is an output; the range is the codomain.
- Bijective: both. These are exactly the functions with inverses.
isn't one-to-one on , since ; on it is.
6. Functions from real situations
Video coming soon
A short video for this part is on its way. Everything you need is in the text below.
Most functions in calculus come from somewhere: a distance that depends on time, a cost that depends on how many are made. Turning a situation into a function takes three decisions.
- Name the variables, with units. What's the input? What's the output? " = hours after midnight; = temperature in °C."
- Write the rule. Often it comes from a formula you already know (area, volume, distance = rate × time).
- Find the practical domain: the inputs that make physical sense. The formula may accept more.
A plan costs dollars a month plus dollars per text. With texts in a month, the bill in dollars is
The formula accepts any real , but you can only send texts: the practical domain is the whole numbers . Then says: a month with texts costs dollars.
From a cm by cm card, cut a square of side cm from each corner and fold up the sides. The box is cm tall, and its base is cm by cm, so its volume in cm³ is
The formula is a polynomial, so its implied domain is every real number. But the cut needs , and the narrow side needs , so . The practical domain is . And means cm cuts make a box of cm³.
Reading function statements
In context, is a sentence: "when the input is , the output is ", with units. If is the temperature in °C hours after midnight, then says at 9 a.m. it was 17 °C. It doesn't say the temperature rose by , or that it was °C at 5 p.m.: the input goes in the parentheses, the output comes out.
- Using the implied domain. A box can't have a negative side; a plan can't have texts. Check the situation, not just the formula.
- Swapping input and output when reading .
- Dropping the units. "" means little until you say it's cm³ for a cm cut.
To model a situation, name the input and output with their units, write the rule, and find the practical domain: the inputs that make sense in the situation, which can be much smaller than the formula's implied domain. Read as "when the input is , the output is ".
A box made from a cm by cm card by cutting squares of side from the corners has volume , with practical domain .
Ready for more? The Practice tab has 9 more problems on the whole lesson.
Definitions
- Function
A rule that assigns to every element of a set exactly one element of a set . We write .
- Domain and codomain
The domain is the set of allowed inputs; the codomain is the set the outputs are taken from.
- Range
The set of outputs the function actually produces, . It lies inside the codomain.
- Implied domain
For a formula with no stated domain: every real number for which the formula gives a real number.
- Practical domain
The inputs that make sense in the situation a function models, often smaller than the implied domain.
- Vertical line test
A graph is the graph of a function exactly when no vertical line crosses it more than once.
- One-to-one (injective)
Different inputs always give different outputs: only when . On a graph: no horizontal line crosses it twice.
- Onto (surjective)
Every element of the codomain is an output: the range equals the codomain.
- Bijective
Both one-to-one and onto: each element of the codomain is the output of exactly one input.
- Independent and dependent variables
In , the input is the independent variable and the output the dependent one.
Formulas
Function notation
input in the domain , output in the codomain
Range
Domain: denominators
Domain: even roots
One-to-one
Change in output
the change in when the input moves from to
Study
Apply it
Real-world problems that take several steps. Work through them one step at a time, with each step checked as you go.
Practice
9 practice problems with instant feedback, hints and worked solutions.
Sign up free to practice