mathprecalc
functions + graphs
what a function is, how its graph moves when you change it, and how to undo one.
a function turns each input into one output. its graph is every (x, f(x)) pair drawn at once, and an edit to the formula moves that picture in a way you can read off.
- up k
- f(x) + k outside the function acts on y, as written
- right h
- f(x − h) inside acts on x, backwards. the minus moves it right
- stretch by a
- a · f(x) a negative a flips it over the x axis
- squeeze by 1/b
- f(bx) toward the y axis. a negative b flips it over the y axis
- compose
- f(g(x)) g runs first, then f. the other order differs
- inverse
- f⁻¹(f(x)) = x not 1/f(x). only a one-to-one function has one
- sketching y = 2(x − 1)² − 3 without plotting points
- reading a graph back into a formula
- solving for the input: undo the function
- the next pages, where exponents, logs and trig are graphs that move the same way
the idea
a function is a rule that takes an input and gives back exactly one output. names it: is the rule, is what goes in, and is what comes out. says square the input and subtract 1, so , and too. two inputs may share an output. one input never gets two.
the same function shows up three ways: a formula, a table of its values, and a graph, which is every point drawn at once.
| −2 | −1 | 0 | 1 | 2 | |
|---|---|---|---|---|---|
| 3 | 0 | −1 | 0 | 3 |
the graph is the table with the gaps filled in: a parabola with its lowest point at . edit the formula and the picture moves, and the move can be read straight off the edit. the movie makes three edits to , one at a time.
an animation on a plot from x = −6 to 6 and y = −4 to 5: y = x² turns into y = 2(x − 1)² − 3 one move at a time, with the vertex marked and the parent y = x² left behind, dashed. first the parabola slides right 1 and the vertex goes from (0, 0) to (1, 0). then every height doubles, stretching it up away from the x axis, and the vertex stays at (1, 0). then the whole graph drops 3 and the vertex lands at (1, −3).
functions are all over this site. the growth curves on the big o page are functions of , and an ease in gsap is a function from the share of the time that has passed to the share of the move that is done.
explore
pick a shape and slide the four numbers in . the parent shape stays behind, dashed. the readout gives the equation, where two of the parent’s points land, and the domain and range.
- x², the parent
- a parabola, the same on both sides of the y axis: (−2)² and 2² are both 4
- the vertex
- (0, 0) → (1, −3)
- the point
- (1, 1) → (2, −1)
- domain
- all x
- range
- y ≥ −3
a plot from x = −6 to 6 and y = −4 to 4 with a row of buttons for seven shapes, x, x², x³, √x, |x|, 1/x and 2ˣ, and four sliders for a, b, h and k in y = a·f(b(x − h)) + k. the parent shape stays behind, dashed, and the transformed graph is drawn over it with two points marked: where the parent's anchor lands, (h, k) for every shape but 2ˣ, whose (0, 1) lands at (h, a + k), and where its point at x = 1 lands, at (h + 1/b, a·f(1) + k). a readout gives the equation, the two points, and the domain and range. it opens on x² with a = 2, b = 1, h = 1 and k = −3: y = 2(x − 1)² − 3, the vertex at (1, −3), the point (1, 1) at (2, −1), domain all x, range y ≥ −3.
- moves the graph up, or down when it’s negative. moves it right: inside means right 1, and means left 2
- stretches it away from the x axis, and a negative flips it over the x axis
- squeezes it toward the y axis by , so is half as wide, and a negative flips it over the y axis
- for every shape, the point the parent had at ends up at , and the point it had at ends up at
try it
this is |x|, moved. which equation is it?
pick one.
a practice exercise with five kinds of question: pick the equation of a drawn graph, say where a moved shape's vertex, corner, start or center lands, work out f(g(n)) or g(f(n)) for two small functions, find f⁻¹ of a value, or give a formula's domain. it opens on the graph of y = |x + 2| − 1, then f(g(2)) for f(x) = x + 3 and g(x) = 2x, which is 7.
the rules
one output for each input
a function pairs each input in its domain with one output . the domain is the set of inputs it accepts, and the range is the set of outputs it reaches.
why one output: has to mean one number, or means nothing. on a graph this is the vertical line test. a vertical line is one input, so if it crosses the graph twice, that input has two outputs and the picture isn’t a function’s graph. a circle fails it. a parabola passes.
two things take inputs out of a domain: a square root of a negative number, and a division by zero. needs , and needs . the range comes from the shape: is never below , so its range is .
shapes to know by sight
seven parents, with their values at a few inputs and what each one takes and gives. the explore figure draws each one, and the next page is about the last.
| domain | range | ||||||
|---|---|---|---|---|---|---|---|
| −2 | −1 | 0 | 1 | 2 | all | all | |
| 4 | 1 | 0 | 1 | 4 | all | ||
| −8 | −1 | 0 | 1 | 8 | all | all | |
| – | – | 0 | 1 | 1.41 | |||
| 2 | 1 | 0 | 1 | 2 | all | ||
| −0.5 | −1 | – | 1 | 0.5 | |||
| 0.25 | 0.5 | 1 | 2 | 4 | all |
- and are even: , so each graph is its own mirror image across the y axis. and are odd:
- starts at the origin, only exists for , and climbs slower and slower. doubles with every step to the right and halves with every step to the left, so it never reaches 0
- has nothing at . its two arms hug the axes and never touch them
transformations
- : up by . every output gains , so every point of the graph rises by
- : right by . gets , so it sees when : what happened at now happens at
- : stretched by , away from the x axis. every output is multiplied by , and when each one lands on the other side of the axis: the graph flips over the x axis
- : squeezed by , toward the y axis. gets , so it reaches the value it had at when . when the graph flips over the y axis
outside the function, the changes act on as written. inside, they act on , and backwards: a minus moves right, a 2 halves the width. the order matters too. multiplies first, then adds, so the stretch comes before the shift up: doubles the heights, then drops them by 3. inside, squeezes first, then shifts: moves right 2, not 4. factor the inside before you read it.
composition
do first, then . the inner function runs on the input, and the outer one only ever sees its result. with and : , but . in general and , which are never equal.
the transformation rules are compositions. is after the shift , and is the map after . that is the whole reason inside and outside behave differently: a change inside alters what receives, and a change outside alters what returned.
inverses
undoes :
to find it, write , swap and , and solve for . the swap is why the graph of is the graph of mirrored across the line : every point on becomes on , and swapping coordinates is that mirror.
only a one-to-one function has an inverse. if two inputs share an output, the inverse would have to send that output back to both, and a function can’t. the horizontal line test checks it: a horizontal line that crosses the graph twice means two inputs with one output. fails, since and both give . restricting the domain fixes it: on passes, and its inverse is .
drag the point along f, or tab to it and use the arrow keys
- f(x) = x², for x ≥ 0
- f(1.5) = 2.25
- f⁻¹(x) = √x
- f⁻¹(2.25) = 1.5
- mirror
- (1.5, 2.25) ↔ (2.25, 1.5)
the dashed left half is cut away: with it, 2.25 would come from both 1.5 and −1.5
a plot from x = −5 to 5 and y = −4 to 4 with the line y = x dashed and buttons for four functions: 2x + 1, x² on x ≥ 0, x³ and 2ˣ. the function is drawn in cyan and its inverse in amber, its mirror image across y = x. a point on the function can be dragged along it, or moved with the arrow keys, and its twin on the inverse follows with the coordinates swapped. it opens on x² on x ≥ 0 at (1.5, 2.25), with the twin at (2.25, 1.5), and the readout reads f(1.5) = 2.25 and f⁻¹(2.25) = 1.5. the left half of the parabola is drawn dashed: it is cut away so that each output comes from one input, and a dotted horizontal line shows the second input it would have given, −1.5.
worked examples
sketch y = −|x + 2| + 1
read the formula from the inside out, starting from :
- is : left 2. the corner moves from to
- the minus in front: every height is multiplied by , so the v flips over the x axis and opens down
- : up 1. the corner lands at
the arms follow the same moves: lands at and at , so the graph crosses the x axis at and . domain: all . range: , since the corner is now the top.
read a graph back
a parabola has its vertex at and passes through . the vertex gives and :
the other point gives . at : , so and . check: .
compose two functions
and . for , runs first: , then . for : , then . as formulas, and .
find an inverse
. write , swap: , solve: . so . check that it undoes : and . and is something else entirely: the in is a name, not a power.
restrict a domain
has no inverse on all of : . on it does. swap and solve: , so . its domain is , the old range, and its range is , the old domain. an inverse swaps those too.
the key idea up close
why f(x − h) moves right
let and feed it the input :
whatever does at , does at . so every point of ‘s graph shows up on ‘s graph as : the same height, further right. the minus inside is a delay. has to wait until its input reaches before it sees what saw at . with and : is at , and is at .
the same argument covers . has , so ‘s point at lands at : closer to the y axis when , and on the other side of it when . changes outside the function need no argument at all. they act on the output directly, so goes to .
in one line, the point of ‘s graph lands at
that is what the explore figure’s readout computes, and the first half is why the inside reads backwards: is divided by and has added, the reverse of what the formula does to it.
pitfalls
- moves right, not left. sees when , so what was at the origin is now at . the same way, moves left 2
- isn’t . with , while . the is a label for the function that undoes
- and differ. and above. check which one runs first before you compute
- one output per input, but not the other way. is fine for . a circle isn’t a function’s graph, since a vertical line through it hits two points
- domain gaps. a square root of a negative and a division by zero are the two to look for: needs and needs . in , also has to land in ‘s domain
- a squeeze inside can look like a stretch outside. , so for a squeeze by 2 and a stretch by 4 draw the same graph. for most functions they differ: , not , and
- factor the inside. is : squeezed by 2, then right 2, not right 4
practice
-
. find and , and say why a function may do that.
answer
and . two inputs sharing an output is allowed: the rule only promises one output for each input, not one input for each output. it is the other direction, two outputs for one input, that a function can’t do.
-
give the domain of .
answer
the square root needs , so . the fraction needs , so . both at once: and .
-
describe how comes from , give its vertex, and say where the parent’s point lands.
answer
inside, : left 1. outside, : stretched by 2 and flipped over the x axis. then : up 4. the vertex goes from to , and the parabola opens down. the point lands at .
-
a parabola has its vertex at and passes through . write its equation.
answer
from the vertex. at : , so . the equation is .
-
and . find and , then find every with .
answer
and . in general and . setting them equal gives , which never holds, so there is no such : for this pair the order always matters.
-
. find and , and check it. then say whether has an inverse, and give one on a restricted domain.
answer
swap and solve: , so and . then , and the check: .
has no inverse on all , since fails the horizontal line test. on it does: gives , with domain and range .