How to Graph a Rational Function- Complete Tutorial
What Is a Rational Function?
A rational function is any function you can write as f(x) = P(x)/Q(x), where both P(x) and Q(x) are polynomials, and Q(x) is not zero. That's it. The graphing part is where most people get lost.
These functions show up constantly in precalculus and calculus. They produce graphs with curves that bend, break, and approach lines without ever touching them. If that sounds confusing, keep reading—it gets simpler once you know the steps.
The Anatomy of a Rational Function Graph
Before you start plotting points, you need to understand what you're looking at. Every rational function graph has three features that control almost everything about its shape.
Vertical Asymptotes
Vertical asymptotes are vertical lines where the function explodes toward infinity. They occur wherever the denominator equals zero—as long as the numerator isn't zero at the same point.
To find them: set the denominator equal to zero and solve. Those x-values are your asymptote locations. The graph will never cross these lines.
Horizontal Asymptotes
Horizontal asymptotes describe what happens to the function as x approaches positive or negative infinity. They're determined by comparing the degrees of the numerator and denominator.
- If the denominator's degree is higher than the numerator's, the horizontal asymptote is y = 0.
- If the degrees are equal, the asymptote is y = (leading coefficient ratio).
- If the numerator's degree is higher, there's no horizontal asymptote—instead you might have an oblique (slanted) asymptote.
Intercepts
The x-intercept is wherever the numerator equals zero (again, as long as the denominator isn't zero there). The y-intercept is simply f(0), if it exists.
Step-by-Step: How to Graph a Rational Function
Here's the process. Follow it in order.
Step 1: Factor Everything
Factor the numerator and denominator completely. This lets you see holes, intercepts, and asymptotes clearly.
Step 2: Find the Domain Restrictions
Set the denominator equal to zero. Those x-values are excluded from the domain. If any of these values also make the numerator zero, you have a hole instead of an asymptote.
Step 3: Identify Asymptotes
Calculate horizontal or oblique asymptotes using the degree comparison method above. Mark these as dashed lines on your graph—they're guides, not parts of the curve.
Step 4: Find Intercepts
Set x = 0 for the y-intercept. Set y = 0 and solve for x to find x-intercepts.
Step 5: Test Regions
Vertical asymptotes divide the graph into regions. Pick a test value from each region and plug it into the simplified function (after canceling common factors). This tells you whether the graph is positive or negative in that region.
Step 6: Plot Points and Sketch
Add a few points within each region. Then draw the curve, making sure it approaches asymptotes correctly and avoids restricted points.
Example: Graphing f(x) = (x² - 4)/(x² - 1)
Let's work through this together.
Step 1: Factor both parts.
f(x) = (x+2)(x-2)/(x+1)(x-1)
Step 2: Denominator zeros are x = -1 and x = 1. Neither makes the numerator zero, so both are vertical asymptotes.
Step 3: Both numerator and denominator have degree 2. The horizontal asymptote is y = 1/1 = 1.
Step 4: X-intercepts come from numerator zeros: x = -2 and x = 2. The y-intercept is f(0) = (-4)/(-1) = 4.
Step 5: Test regions: (-∞, -2), (-2, -1), (-1, 1), (1, 2), (2, ∞). Check sign in each region.
Step 6: Sketch it. The graph approaches y = 1 on both ends, shoots through the x-intercepts, and explodes near x = -1 and x = 1.
Common Mistakes That Ruin Your Graph
- Forgetting holes. If a factor cancels, there's a hole—not an asymptote—at that x-value.
- Crossing asymptotes. The curve never crosses horizontal or oblique asymptotes. If yours does, something's wrong.
- Ignoring sign changes. Always test each region. The graph must switch direction or maintain consistency at asymptotes.
- Skipping the y-intercept. It's the easiest point to find and anchors your sketch.
Graphing Tools Compared
| Tool | Best For | Limitations |
|---|---|---|
| Desmos | Quick visualization, free, no install | Less control over asymptote display |
| GeoGebra | Detailed analysis, classroom use | Steeper learning curve |
| TI-84 Calculator | Standardized tests, graphing by hand backup | Small screen, manual asymptote tracking |
| Wolfram Alpha | Checking work, advanced examples | Shows answers too quickly—doesn't help you learn |
Quick Reference: Graphing Checklist
Run through this before you finalize any rational function graph:
- ☐ Factored form written out
- ☐ Domain restrictions identified
- ☐ Vertical asymptotes marked (dashed lines)
- ☐ Horizontal or oblique asymptote marked
- ☐ X-intercepts plotted
- ☐ Y-intercept plotted
- ☐ Each region tested for sign
- ☐ Holes marked with open circles
When to Use an Oblique Asymptote
If the numerator's degree is exactly one higher than the denominator's, you'll have a slanted asymptote. Find it using polynomial long division—ignore the remainder. The quotient is your asymptote line.
Example: f(x) = (x² + 3x + 2)/(x + 1) simplifies to x + 2 (with a hole at x = -1). The oblique asymptote is y = x + 2.
The Bottom Line
Graphing rational functions comes down to three things: finding where the function is undefined, identifying where it goes to infinity, and understanding its end behavior. The step-by-step process exists because it works. Skip steps, get wrong graphs. Follow them consistently, and you'll graph any rational function correctly.