Jugami › Algebra › Functions and Their Graphs
Functions and Their Graphs
What a function is, how to name one, where it lives (its domain and range), and how to move the basic graphs around with a few simple rules.
Press a button on a vending machine and one snack drops out. Press the same button again and you get the same snack. That is the idea of a function: every input has exactly one output. In earlier units you graphed lines like y = 2x + 1 and parabolas like y = x2 − 4. Each of those is a function. This unit gives them a name, f(x), and shows how a handful of parent graphs, shifted and stretched, cover most of the graphs in high school algebra.
What is a function?
A function is a rule that assigns to each input exactly one output. The set of allowed inputs is the domain, and the set of outputs you actually get is the range. Two different inputs may share an output; what is not allowed is one input with two different outputs.
Suppose a pizza costs $12, plus $2 for each topping. The cost depends on the number of toppings, so the cost is a function of the toppings. Here are four ways to show it.
1. A table
| Toppings t | Cost C in dollars |
|---|---|
| 0 | 12 |
| 1 | 14 |
| 2 | 16 |
| 3 | 18 |
| 4 | 20 |
Each number of toppings appears once in the left column, with one cost next to it. As a formula, C = 12 + 2t.
2. A mapping diagram
Draw the inputs in one oval, the outputs in another, and an arrow from each input to its output. It is a function when every input has exactly one arrow leaving it.
3. A set of ordered pairs
Write each input with its output as a pair (input, output). Look for a repeated first number with a different second number.
Example 1: Is {(1, 4), (2, 5), (1, 6)} a function?
4. A graph
Plot each pair as a point. The pizza graph is five separate dots, not a line, because you cannot order half a topping. Its domain is the whole numbers 0 to 4 and its range is 12, 14, 16, 18 and 20.
Function notation and evaluating
Instead of y = 2x2 − 3x + 1 we often write f(x) = 2x2 − 3x + 1. Read f(x) as “f of x”: the output of the function f when the input is x. It does not mean f times x. The letter can change: g(x), h(t) and C(t) are all function names.
To evaluate f(a), replace every x in the rule with a, in brackets, and work it out.
Example 2: For f(x) = 2x2 − 3x + 1, find f(−2).
Example 3: For h(x) = 3x − 5, find x so that h(x) = 7.
You can also read values from a graph. To find f(2), go to x = 2 on the x-axis and move up or down to the graph; the height there is f(2). To solve f(x) = 3, go to height 3 and read across to the input.
Domain and range
The domain is every input the function accepts. The range is every output it produces. Unless a problem says otherwise, the domain is every real number that gives a real output. In this course, two things shrink it:
- You cannot divide by 0, so 1/x + 2 needs x ≠ −2.
- A square root of a negative number is not a real number, so √x − 3 needs x − 3 ≥ 0.
A real-world function may have a smaller domain: the pizza function only takes whole numbers of toppings.
Interval notation
Domains and ranges are often sets of numbers between two ends. Interval notation writes the two ends with a bracket on each side. A square bracket [ or ] means the end is included; a round bracket ( or ) means it is not. Infinity, ∞, is not a number you can reach, so it always gets a round bracket. The symbol ∪, “union”, joins two pieces.
| In words | Inequality | Interval |
|---|---|---|
| 3 or more | x ≥ 3 | [3, ∞) |
| less than 5 | x < 5 | (−∞, 5) |
| from −2, included, up to 4, not included | −2 ≤ x < 4 | [−2, 4) |
| every number except −2 | x ≠ −2 | (−∞, −2) ∪ (−2, ∞) |
| all real numbers | (−∞, ∞) |
Example 4: Find the domain of f(x) = √x − 3.
Example 5: Find the domain of g(x) = 1/x + 2.
Example 6: Find the range of f(x) = x2 + 1.
The vertical line test
On a graph, the input is the x-coordinate. A vertical line touches every point with one particular x-coordinate. So if some vertical line hits a graph twice, that input has two outputs.
Vertical line test
A graph is the graph of a function exactly when no vertical line crosses it more than once.
One vertical line that hits twice is enough to fail. To pass, the graph has to work for every vertical line, including ones you did not draw.
Parent functions
A parent function is the simplest member of a family of graphs. Learn these six shapes, and every graph in the next section is one of them moved, stretched or flipped.
| Family | Rule | Domain | Range | Key point |
|---|---|---|---|---|
| Linear | f(x) = x | (−∞, ∞) | (−∞, ∞) | (0, 0) |
| Quadratic | f(x) = x2 | (−∞, ∞) | [0, ∞) | vertex (0, 0) |
| Absolute value | f(x) = |x| | (−∞, ∞) | [0, ∞) | vertex (0, 0) |
| Square root | f(x) = √x | [0, ∞) | [0, ∞) | starting point (0, 0) |
| Cubic | f(x) = x3 | (−∞, ∞) | (−∞, ∞) | center (0, 0) |
| Reciprocal | f(x) = 1/x | (−∞, 0) ∪ (0, ∞) | (−∞, 0) ∪ (0, ∞) | (1, 1); asymptotes x = 0 and y = 0 |
The reciprocal graph has two asymptotes, drawn dashed gold: lines the graph gets closer and closer to but never reaches. It never touches x = 0 because 1/0 is undefined, and never touches y = 0 because 1/x is never 0.
Transformations: a · f(x − h) + k
Start from a parent f(x). The new function g(x) = a · f(x − h) + k has the same family shape, moved by three numbers.
| Change | What happens to the graph | Example with f(x) = x2 |
|---|---|---|
| f(x) + k | up k units (down if k is negative) | x2 + 3: up 3 |
| f(x − h) | right h units (left if h is negative) | (x − 2)2: right 2 |
| a · f(x), a > 1 | vertical stretch: a times as tall | 3x2: narrower |
| a · f(x), 0 < a < 1 | vertical compression | (1/2)x2: wider |
| −f(x) | reflection in the x-axis: upside down | −x2: opens downward |
The minus sign in x − h
f(x − 2) moves the graph right 2, not left. The vertex of (x − 2)2 is where x − 2 = 0, at x = 2. In the same way, f(x + 1) is f(x − (−1)), so h = −1 and the graph moves left 1.
Every point moves the same way: the key point (0, 0) of a parent goes to (h, k). For square root, absolute value and quadratics that is the starting point or vertex.
Example 7: Describe g(x) = −2|x + 1| + 3 and find its vertex.
Example 8: Write the rule for √x moved right 4 and down 2, and give its domain and range.
Try the interactive version at jugami.com/algebra/functions/
Transformation explorer
Pick a parent function, then change a, h and k in g(x) = a · f(x − h) + k. The parent stays on the grid as a dashed gray curve so you can see each move. The exponential parent here is f(x) = 2x.
Exponential functions
An exponential function has the variable in the exponent: y = a · bx, with a ≠ 0, b > 0 and b ≠ 1. The base b is the growth factor: each time x goes up by 1, y is multiplied by b. When x = 0, b0 = 1 (see zero and negative exponents), so y = a: the graph crosses the y-axis at (0, a).
- If b > 1 and a > 0, the function shows exponential growth: it rises faster and faster.
- If 0 < b < 1 and a > 0, it shows exponential decay: it falls, by the same fraction each step, toward 0.
Linear versus exponential
A linear function adds the same amount each step. An exponential function multiplies by the same factor each step. Compare y = 2x + 1 and y = 3x, which both start at 1:
| x | 2x + 1 | 3x |
|---|---|---|
| 0 | 1 | 1 |
| 1 | 3 | 3 |
| 2 | 5 | 9 |
| 3 | 7 | 27 |
| 4 | 9 | 81 |
Down the middle column each value is 2 more than the one above. Down the last column each value is 3 times the one above. At x = 4 the line has reached 9 but the exponential is already at 81. An exponential growth function with a > 0 always overtakes a linear function eventually.
Example 9: For f(x) = 5 · 2x, find f(3) and f(−1).
And f(−1) = 5 · 2−1 = 5 · 1/2 = 5/2, because a negative exponent means the reciprocal.
Example 10: A tank holds 100 liters, and each hour 20% of the water in it drains out. Write the amount left after x hours.
Common mistakes
Practice problems
Try each one, then open the answer to check your work.
- For f(x) = 3x2 − x, find f(−2).
Show answer
3(−2)2 − (−2)Put −2 in brackets12 + 23 · 4 = 12, and subtracting −2 adds 214 - For h(x) = 5 − 2x, solve h(x) = −7.
Show answer
5 − 2x = −7−2x = −12Subtract 5x = 6Divide by −2 - Is {(2, 3), (4, 3), (6, 1)} a function?
Show answer
yesEach input 2, 4 and 6 appears once. Sharing the output 3 is allowed - Find the domain of f(x) = √x + 5.
Show answer
x + 5 ≥ 0No negatives under the square rootx ≥ −5[−5, ∞) - Find the domain of g(x) = 4/x − 1.
Show answer
x − 1 ≠ 0No dividing by 0x ≠ 1(−∞, 1) ∪ (1, ∞) - Find the range of f(x) = |x| − 4.
Show answer
|x| ≥ 0An absolute value is never negative|x| − 4 ≥ −4Subtract 4[−4, ∞) - Write f(x) = x2 moved left 3 and up 2.
Show answer
(x − (−3))2 + 2Left 3 means h = −3; up 2 means k = 2(x + 3)2 + 2 - Find the vertex and range of g(x) = −(x − 1)2 + 5.
Show answer
(1, 5)h = 1 and k = 5(−∞, 5]a = −1, so the parabola opens downward and 5 is the highest output - For f(x) = 4 · 3x, find f(2).
Show answer
4 · 324 · 9Power first36 - For f(x) = 2x, find f(−3).
Show answer
2−31/23Negative exponent: reciprocal1/8 - Is y = 50(0.9)x growth or decay? What is its y-intercept?
Show answer
decay0 < 0.9 < 1, so each step keeps 90%(0, 50)a = 50, since 0.90 = 1
History: from “function” to f(x)
The idea of a function grew slowly. According to the MacTutor history of the function concept, Gottfried Leibniz used the word “function” in 1673 in its everyday sense, for lines that “perform some function” in a figure. In a letter to Leibniz in 1694, Johann Bernoulli described a function as a quantity formed in some way from variable and constant quantities.
The notation f(x) came later. Jeff Miller’s notes on the earliest uses of function symbols, citing Florian Cajori’s history of mathematical notations, say Leonhard Euler first used it in 1734, in a paper in the St Petersburg Academy’s journal Commentarii Academiae Scientiarum Petropolitanae. In 1748 Euler’s book Introductio in analysin infinitorum put functions at the center of his mathematics.
Euler still thought of a function mostly as a formula. The modern idea, any rule that gives one output for each input, formula or not, took another century to settle. MacTutor credits Joseph Fourier’s work on heat with pushing mathematicians that way, and in 1837 Peter Gustav Lejeune Dirichlet adopted Fourier’s general definition of a function and built on it. Miller also notes that Karl Weierstrass used the bars |x| for absolute value in an essay of 1841, although it may not have been printed until much later.
Connections
Every unit so far has been about functions without the name. A non-vertical line from Graphing Linear Equations is a linear function f(x) = mx + b, and m is how much the output changes when the input goes up by 1. The vertex form y = a(x − h)2 + k from Quadratic Equations is exactly a · f(x − h) + k with f(x) = x2.
The square root parent √x is x1/2, a rational exponent from Exponents and Radicals, and the zero-exponent rule b0 = 1 is why every exponential a · bx crosses the y-axis at a. Solving f(x) = 0 means finding the x-intercepts, and in Polynomials and Factoring those come from the factors.
Try the interactive version at jugami.com/algebra/functions/
Practice generator
Pick a level, or Mixed for a bit of everything. Type exponents with a caret, like x^2. For a domain or range, type an interval like [−2, inf) or an inequality like x >= −2; “all real numbers” works too. Type a rule like (x − 3)^2 + 1, with or without “g(x) =”, and a point like (2, −1). For yes-or-no questions, type yes or no.
Sources
- Jeff Miller, “Earliest Uses of Function Symbols”, hosted by MacTutor History of Mathematics, University of St Andrews: Function symbols (Euler’s f(x), 1734, citing Cajori, vol. 2, p. 268; Weierstrass’s absolute value bars, 1841).
- J. J. O’Connor and E. F. Robertson, MacTutor: The function concept (Leibniz 1673, Johann Bernoulli 1694, Euler’s Introductio 1748, Fourier, Dirichlet 1837), and the biographies of Leonhard Euler and Peter Gustav Lejeune Dirichlet.
- Common Core State Standards for Mathematics: Interpreting Functions (F-IF.A.1, F-IF.A.2, F-IF.C.7), Building Functions (F-BF.B.3, transformations) and Linear, Quadratic, and Exponential Models (F-LE.A.1), which this lesson supports.
Credits: all diagrams on this page are original SVG drawings made for Jugami. Every answer was double-checked.