Writing a rational function from its graph
Quick review (2 minutes)
So far you were handed a formula and you drew its graph.
The first candidate formula, with the simplest factors, for a graph that crosses the x-axis at x = p and x = q, has vertical asymptotes at x = r and x = s, and has a hole at x = c is f(x) = a · with a ≠ 0. With no hole, leave out both (x − c) factors. Find a by plugging in one more point of the graph that is not on the x-axis. If the graph goes the same way on both sides of a vertical asymptote, square that bottom factor, the simplest even power. If the graph touches the x-axis at an intercept and turns back, square that top factor. Check the candidate against the rest of the graph: a graph can call for higher powers or for factors with no real zero, such as + 1.
Say what the question asks: build the fraction whose graph has exactly the features you see.
List the x-intercepts. For a crossing at x = p, write the factor (x − p) on the top, and for a touch that turns back, (x − p. If there are no x-intercepts, try a top with no x in it, the simplest choice; the rest of the graph can still call for a factor with no real zero, such as + 1.
List the vertical asymptotes. For a wall at x = r, write the factor (x − r) on the bottom. If the graph goes the same way (both up or both down) on the two sides of the wall, write (x − r instead.
Look for a hole (an open circle). For a hole at x = c, write (x − c) on both the top and the bottom.
Put an unknown number a in front of the fraction.
Pick one point on the graph that is not on the x-axis and is not the hole. The y-intercept is usually the most convenient. Plug in its x and its y, then solve for a.
Write the finished formula. Check it against a feature you did not use: the horizontal asymptote or a second point.
The graph shows a rational function. It has a vertical asymptote at x = −2, crosses the x-axis at (1, 0), crosses the y-axis at (0, −1), and levels off at the horizontal asymptote y = 2. Write a formula for it. In plain words: build the fraction whose graph has exactly these features.
f(x) = , which multiplies out to
Stopping after the factors. has the right crossing and the right wall, but its graph passes through (0, −) and levels off at y = 1. The graph in the example passes through (0, −1) and levels off at y = 2. Always write a in front and use a point to find it, even when a turns out to be 1.
List every feature the graph shows: x-intercepts, vertical asymptotes, holes, the horizontal asymptote, and at least one other point.
Turn each x-intercept at x = p into a factor on the top: (x − p) where the graph crosses, (x − p where it touches and turns back.
Turn each vertical asymptote at x = r into a factor (x − r) on the bottom, squared if both sides of the wall go the same way.
Turn each hole at x = c into a factor (x − c) on both the top and the bottom.
Write a in front, plug in a point that is off the x-axis and is not the hole, and solve for a.
Check the finished formula against a feature you did not use.
rational function
A function written as a fraction: one polynomial on top, another polynomial on the bottom. It is defined everywhere except where the bottom equals zero.
vertical asymptote
A vertical line x = a that the graph shoots up or down beside and never touches. It sits at an input where the bottom is zero after canceling. Say it AS-im-toht.
horizontal asymptote
A horizontal line y = b that the graph settles toward as x goes far right or far left. It describes the far ends only. The graph may cross it in the middle.
slant asymptote
A tilted line y = mx + b that the graph follows far out. It appears when the top's degree is exactly one more than the bottom's. Dividing gives its equation.
removable discontinuity
A single missing point in a graph, also called a hole. It appears when a factor (x − a) cancels from top and bottom with no copy of it left in the bottom: the curve looks unbroken, but that one input has no output.
1 In plain words
So far you were handed a formula and you drew its graph. This lesson runs the other way: you are handed the graph of a rational function and you write its formula. Think of tasting a soup and writing down the recipe. Each flavor you notice names one ingredient. On a graph, each feature names one piece of the formula. A place where the graph crosses the x-axis puts a piece on the top of the fraction. A vertical asymptote, the dashed wall the graph never touches, puts a piece on the bottom. A hole puts the same piece on both. The last question is how much: one number out in front, and one extra point on the graph tells you what it is.
2 Picture it
Reminder
Reminder: Subtracting a negative, When a factor is zero, Reading a point, Undoing a multiplication, Signs when multiplying and dividing, Horizontal asymptote by degrees, Height of a hole
- Subtracting a negative. x − (−2) = x + 2. A crossing or a wall at a negative number gives a plus sign inside the factor.
- When a factor is zero. (x − 4) is 0 only at x = 4, because 4 − 4 = 0.
- Reading a point. (0, −1) means the input is 0 and the output is −1: x = 0 and f(x) = −1.
- Undoing a multiplication. To free a in −3a = 6, divide both sides by −3: a = −2.
- Signs when multiplying and dividing. Two negatives make a positive: (−1)(−2) = 2 and = . One negative makes a negative: 6 ÷ (−3) = −2.
- Horizontal asymptote by degrees. Same degree on top and bottom: y is the ratio of leading coefficients, so levels off at y = = 2. Larger degree on the bottom: y = 0.
- Height of a hole. Cancel the shared factor first, then plug in: becomes , and at x = −1 that is = 2.
3 Why
Every earlier fact works in both directions. A zero of the simplified top where the original bottom is not 0 is an x-intercept, so an x-intercept at x = 1 means the top holds the factor (x − 1), the piece that equals 0 when x is 1. A zero of the bottom that survives is a vertical asymptote, so a wall at x = −2 means the bottom holds (x + 2). Multiplying the whole fraction by a number a ≠ 0 moves no crossing and no wall, because a times 0 is still 0. So the crossings and walls cannot tell you a. Once the factors are chosen, one point off the x-axis can, and so can the height of a horizontal asymptote other than 0.
4 The rule
The first candidate formula, with the simplest factors, for a graph that crosses the x-axis at and , has vertical asymptotes at and , and has a hole at is with .
With no hole, leave out both () factors. Find a by plugging in one more point of the graph that is not on the x-axis. If the graph goes the same way on both sides of a vertical asymptote, square that bottom factor, the simplest even power. If the graph touches the x-axis at an intercept and turns back, square that top factor. Check the candidate against the rest of the graph: a graph can call for higher powers or for factors with no real zero, such as .
The same idea, five ways
f of x equals a, times the crossing factors, over the wall factors.
A first candidate formula is a number a times one factor for each x-intercept, divided by one factor for each vertical asymptote, with the factor of any hole written on both the top and the bottom. Square a factor where the graph touches the x-axis and turns back, or where it goes the same way on both sides of a vertical asymptote. Then check the candidate against the rest of the graph, which can call for higher powers or for factors with no real zero.
- x-intercept at x = p where the graph crosses: factor (x − p) on the top
- x-intercept at x = p where the graph touches and turns back: factor (x − p on the top
- vertical asymptote at x = r, one side up and one side down: factor (x − r) on the bottom
- vertical asymptote at x = r, both sides the same way: factor (x − r on the bottom
- hole at x = c: factor (x − c) on the top and on the bottom
- point (, ) on the graph: solve = f() for a
Tasting a soup and writing the recipe: each flavor names an ingredient, and one spoonful tells you how much salt.
crossing at x = p: (x − p) on the top
wall at x = r: (x − r) on the bottom
hole at x = c: (x − c) on both
a in front
one point off the x-axis gives a
The same idea, other ways
Flatten the graph onto the x-axis and keep only two kinds of marks. An open circle sits where a wall stands: the function has no output there, so that number goes into a bottom factor. A tick sits where the graph crosses: the output is 0 there, so that number goes into a top factor. For the graph above, the open circle at −1 gives (x + 1) on the bottom and the tick at 2 gives (x − 2) on the top.
A friend describes a house over the phone: a door here, a wall there. You can draw the floor plan from that. You cannot tell how tall the house is until your friend gives you one measurement. Crossings and walls are the floor plan of the graph: they give the simplest factors of the formula. The one extra point, off the x-axis and away from the walls, is the measurement, and it sets a.
Start with , whose wall is at x = 0. You want the wall at x = 5, so make the bottom x − 5: now the bottom is 0 at 5, since 5 − 5 = 0. Suppose the graph passes through (6, 4). The formula gives = 1 at x = 6. That is four times too low, so a = 4. The formula is , and = 4.
Take any formula with the right factors and multiply it by 5. Where the top was 0, 5 × 0 is still 0, so the crossings stay. Where the bottom was 0, it is still 0, so the walls stay. Many formulas share the same crossings and walls, one for each value of a other than 0. A single point off the x-axis picks out one of them, because at that point different values of a give different heights.
Slide h. The wall stands at x = h every time, because the bottom x − h is 0 there. Now slide a to any value other than 0. The wall does not move and no crossing appears. Only the height of the curve at each input changes: the curve stretches, and a negative a also flips it over the x-axis. That is the reason a wall alone cannot give you a, and one point can.
| What you see on the graph | The simplest thing to write | Why |
|---|---|---|
| Crosses the x-axis at x = p | (x − p) on the top | The top is 0 there, so the output is 0. |
| Touches the x-axis at x = p and turns back | (x − p on the top | A square is never negative, so the output keeps its sign on both sides. |
| Vertical asymptote at x = r, one side up and one side down | (x − r) on the bottom | The bottom is 0 there and changes sign as x passes r. |
| Vertical asymptote at x = r, both sides the same way | (x − r on the bottom | A square is never negative, so both sides keep the same sign, as on the graph of . |
| Hole at x = c | (x − c) on the top and on the bottom | The factor cancels and leaves a gap at the one input that makes it 0. |
| Horizontal asymptote y = 0 | A lower degree on the top than on the bottom, or a top that is the constant 0 | When the bottom has the larger degree, the outputs shrink toward 0. A top that is the constant 0 makes every output 0. |
| Horizontal asymptote y = k with k ≠ 0 | Equal degrees on top and bottom; with factors like (x − p), a = k | With equal degrees the graph levels off at the ratio of leading coefficients, which is a. |
| One more point (x, y) off the x-axis | Plug in x and y, solve for a | Only one value of a makes the formula true at that point. |
5 How
- Say what the question asks: build the fraction whose graph has exactly the features you see.
- List the x-intercepts. For a crossing at x = p, write the factor (x − p) on the top, and for a touch that turns back, (x − p. If there are no x-intercepts, try a top with no x in it, the simplest choice; the rest of the graph can still call for a factor with no real zero, such as + 1.
- List the vertical asymptotes. For a wall at x = r, write the factor (x − r) on the bottom. If the graph goes the same way (both up or both down) on the two sides of the wall, write (x − r instead.
- Look for a hole (an open circle). For a hole at x = c, write (x − c) on both the top and the bottom.
- Put an unknown number a in front of the fraction.
- Pick one point on the graph that is not on the x-axis and is not the hole. The y-intercept is usually the most convenient. Plug in its x and its y, then solve for a.
- Write the finished formula. Check it against a feature you did not use: the horizontal asymptote or a second point.
Writing a rational function from its graph
- List every feature the graph shows: x-intercepts, vertical asymptotes, holes, the horizontal asymptote, and at least one other point.
- Turn each x-intercept at x = p into a factor on the top: (x − p) where the graph crosses, (x − p where it touches and turns back.
- Turn each vertical asymptote at x = r into a factor (x − r) on the bottom, squared if both sides of the wall go the same way.
- Turn each hole at x = c into a factor (x − c) on both the top and the bottom.
- Write a in front, plug in a point that is off the x-axis and is not the hole, and solve for a.
- Check the finished formula against a feature you did not use.
6 Worked example
Worked example
One crossing, one wall, one point
The graph shows a rational function. It has a vertical asymptote at x = −2, crosses the x-axis at (1, 0), crosses the y-axis at (0, −1), and levels off at the horizontal asymptote y = 2. Write a formula for it. In plain words: build the fraction whose graph has exactly these features.
Show the steps and the answer
- List what the graph tells you: a wall at , a crossing at , the point , and a horizontal asymptote at .These four facts are everything the picture gives. The first three build the formula. The fourth is saved for the check.
- The x-intercept is at , so write () on the top.(x − 1) is 0 when x = 1, since 1 − 1 = 0. A top of 0 gives an output of 0, which is a crossing.
- The vertical asymptote is at , so write () on the bottom.x − (−2) = x + 2, and −2 + 2 = 0. A bottom of 0 that does not cancel makes the wall.
- There is no hole, so no factor is shared. Put a in front: .The crossing and the wall fix the factors. They cannot fix the number in front, so it stays a letter for now.
- Plug in the point (0, −1): .The point is on the graph, so its input 0 and output −1 must make the formula true. This step finds the one value of a that does it.
- Multiply both sides by −2: . times −2 is 1, which leaves a alone. On the other side, (−1)(−2) = 2.
- Write the formula: .Every piece is now known. Multiplied out, the top is 2x − 2.
Ladder: from easy to exam-hard
Try each rung before you open its steps.
Rung 1 of 5
One wall, no crossing
The graph of a rational function has a vertical asymptote at x = 3 and a horizontal asymptote at y = 0. It never crosses the x-axis. It passes through (4, 2) and (5, 1). Write a formula. In plain words: find the fraction whose graph has this wall and passes through these points.
Show the steps and the answer
- Look for x-intercepts. There are none, so try the simplest top, with no x in it: only the number a.A factor such as (x − p) on the top would make the output 0 at p, and this graph never reaches height 0. A top that is only a number is the simplest choice that fits.
- The wall is at x = 3, so write (x − 3) on the bottom: .(x − 3) is 0 when x = 3, since 3 − 3 = 0. A bottom of 0 is what makes the wall.
- Plug in the point (4, 2): .The point is on the graph, so its input 4 and output 2 must make the formula true. This step finds the one value of a that does it.
- Write the formula with a = 2: .Every unknown is now filled in.
Rung 2 of 5
One crossing, one wall, and a negative a
The graph of a rational function has a vertical asymptote at x = 1, crosses the x-axis at (−3, 0), crosses the y-axis at (0, 6), and levels off at the horizontal asymptote y = −2. Write a formula. In plain words: build the fraction with this crossing and this wall that also passes through (0, 6).
Show the steps and the answer
- The x-intercept is at , so write () on the top.x − (−3) = x + 3, and −3 + 3 = 0, so this factor is 0 at the crossing.
- The wall is at x = 1, so write (x − 1) on the bottom: .(x − 1) is 0 when x = 1, since 1 − 1 = 0.
- Plug in the point (0, 6): .The y-intercept is on the graph and off the x-axis, so it can find a. 3 divided by −1 is −3.
- Solve −3a = 6 by dividing both sides by −3: .6 ÷ (−3) = −2. A positive divided by a negative is negative. A negative a is allowed: it flips the graph over.
- Write the formula: .Every piece is now known. Multiplied out, the top is −2x − 6.
Rung 3 of 5
Both sides of the wall go up
The graph of a rational function has a vertical asymptote at x = 1. On both sides of the wall the graph shoots up. It never crosses the x-axis, its horizontal asymptote is y = 0, and it passes through (2, 3) and (0, 3). Write a formula. In plain words: find the fraction whose graph climbs on both sides of the wall and passes through these points.
Show the steps and the answer
- There are no x-intercepts, so try the simplest top: only the number a.The graph never reaches height 0, so the top can never be 0.
- The wall is at , so the bottom needs the factor (). Try the first power: .(x − 1) is 0 when x = 1, which makes the wall.
- Test the trial against the two points. At the bottom is . At the bottom is . The bottoms have opposite signs, so the two outputs would have opposite signs. The graph shows both at height 3.A first power changes sign as x passes the wall, which sends one side up and the other side down. That is not this graph.
- Square the factor: .A square is never negative: (1 = 1 and (−1 = 1. Both sides of the wall now have the same sign, so both go the same way.
- Plug in the point (2, 3): . So .The point is on the graph, so it must make the formula true. This finds a.
- Write the formula: .Every piece is now known.
Rung 4 of 5
A hole in the graph
The graph of a rational function has a vertical asymptote at x = 2, crosses the x-axis at (1, 0), has a hole (an open circle, also called a removable discontinuity) at (−1, 2), and passes through (3, 6). Write a formula. In plain words: build the fraction with this crossing, this wall and this gap that also passes through (3, 6).
Show the steps and the answer
- The x-intercept is at , so write () on the top.1 − 1 = 0, so this factor makes the output 0 at the crossing.
- The wall is at , so write () on the bottom.2 − 2 = 0, so this factor makes the bottom 0 at the wall.
- The hole is at , so write () on both the top and the bottom.A factor on both top and bottom cancels, here with no copy of it left in the bottom, so it leaves a hole at the input that makes it 0: −1 + 1 = 0.
- Put a in front: .The features fix the factors but not the number in front.
- Plug in the point (3, 6): .Use a point that is not the hole and not on the x-axis. At the hole the uncanceled formula would read 0 over 0, which has no value.
- Solve 2a = 6 by dividing both sides by 2: .6 ÷ 2 = 3.
- Write the formula: . Keep () on both the top and the bottom, or cancel it and write beside the formula.If you cancel (x + 1) and write nothing more, the formula forgets the hole.
Rung 5 of 5
Two walls and two crossings
The graph of a rational function has vertical asymptotes at x = −2 and x = 3, and it goes opposite ways on the two sides of each wall. It crosses the x-axis at (−4, 0) and (1, 0), crosses the y-axis at (0, 2), passes through (−3, −2), and levels off at the horizontal asymptote y = 3. Write a formula. In plain words: build the fraction with both crossings and both walls that also passes through (0, 2).
walls: x = −2 and x = 3
crossings: (−4, 0) and (1, 0)
y-intercept: (0, 2)
another point: (−3, −2)
levels off at y = 3
Show the steps and the answer
- The crossings are at and , so the top is .x − (−4) = x + 4 is 0 at −4, and (x − 1) is 0 at 1. Each crossing needs its own factor.
- The walls are at and , so the bottom is .x − (−2) = x + 2 is 0 at −2, and (x − 3) is 0 at 3. The graph goes opposite ways at each wall, so neither factor is squared.
- Put a in front: .There is no hole, so no factor is shared. The number in front is still unknown.
- Plug in the point (0, 2): .A negative divided by a negative is positive, and 4 and 6 both divide by 2, so = .
- Solve . Multiply both sides by 3 to get , then divide both sides by 2: .Multiplying by 3 clears the bottom of the fraction. Dividing by 2 leaves a alone.
- Write the formula: .Every piece is now known. Multiplied out, the top is 3 + 9x − 12 and the bottom is − x − 6.
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- Memory device: crossings on top, walls below, holes on both, a out front.
- Check every factor by plugging its number in. The factor must come out 0: for a wall at −2, (x + 2) gives −2 + 2 = 0.
- The y-intercept is usually the most convenient point for finding a, because plugging in x = 0 leaves only the numbers inside the factors.
- Compare degrees against the horizontal asymptote, counting each factor like (x − p) once for each power. An asymptote at y = 0 means a lower degree on the top than on the bottom, or a top that is the constant 0. An asymptote at another height means equal degrees, and with factors like (x − p), that height equals a. A slant asymptote means the top's degree is one more than the bottom's.
- Hold one feature back. Build the formula from the crossings, the walls and one point, then test it on the horizontal asymptote or a second point.
- A sketch can fit more than one formula. Start with the simplest candidate, the one with the fewest factors, and raise a power or add a factor with no real zero only when the graph calls for it.
7 The trap
Stopping after the factors. has the right crossing and the right wall, but its graph passes through (0, −) and levels off at y = 1. The graph in the example passes through (0, −1) and levels off at y = 2. Always write a in front and use a point to find it, even when a turns out to be 1.
Flash cards
Say the answer out loud, then flip.
A graph has a hole (an open circle) at x = 5. Where does the factor (x − 5) go in the formula?
The graph goes up on both sides of the vertical asymptote at x = 4. How do you write that bottom factor?
The crossing and the wall give f(x) = a · . The graph passes through (0, −1). What is a?
- a = 2.
- Plug in x = 0 and y = −1: a · = −1, so a = 2.