In short
A rational function is f(x) = \dfrac{p(x)}{q(x)} where p and q are polynomials and q(x) \neq 0. The zeros of q create vertical asymptotes (the graph shoots off to \pm\infty). The degrees of p and q determine a horizontal or oblique asymptote (the value the function approaches as x \to \pm\infty). The function is undefined wherever q(x) = 0, so its domain excludes those points.
You and a friend split the cost of a ₹1{,}200 birthday gift equally — ₹600 each. If three people chip in, the share drops to ₹400. Four people: ₹300. The cost per person is C(n) = \frac{1200}{n}. Plot this on a graph and something interesting happens: as n grows, C(n) gets smaller and smaller, approaching zero but never reaching it. And at n = 0 — zero people — the expression blows up. There is no "cost per zero people."
That blowing-up and that flattening-out are the two signature behaviours of a rational function: a function built by dividing one polynomial by another. Polynomial functions are smooth and continuous everywhere. The moment you put a polynomial in the denominator, new phenomena appear — the function can have gaps in its domain, the graph can shoot off to infinity at certain x-values, and far from the origin the curve can flatten toward a horizontal line. This article is about reading all of that behaviour from the algebra.
Definition and domain
Rational function
A rational function is a function of the form
where p(x) and q(x) are polynomial functions and q(x) is not the zero polynomial.
The domain of f is all real numbers except the zeros of q(x).
The simplest rational function is f(x) = \frac{1}{x}. Here p(x) = 1 (degree 0) and q(x) = x (degree 1). The domain is all real numbers except x = 0.
A slightly more complex one: g(x) = \frac{x + 2}{x^2 - 9} = \frac{x + 2}{(x-3)(x+3)}. The denominator is zero when x = 3 or x = -3, so the domain is \mathbb{R} \setminus \{-3, 3\} — every real number except those two.
Finding the domain is always the first step: factor the denominator, set each factor equal to zero, and exclude those values.
Vertical asymptotes
A vertical asymptote is a vertical line x = a where the function value grows without bound — f(x) \to +\infty or f(x) \to -\infty — as x approaches a.
Vertical asymptotes occur at the zeros of the denominator (after any common factors with the numerator have been cancelled). The graph shoots off to \pm\infty on one or both sides of the asymptote.
Take f(x) = \frac{1}{x - 2}. The denominator is zero at x = 2. As x approaches 2 from the right (x \to 2^+), the denominator is a tiny positive number, so f(x) becomes a huge positive number — the graph rockets upward. As x approaches 2 from the left (x \to 2^-), the denominator is a tiny negative number, so f(x) plunges to -\infty.
How to find vertical asymptotes:
- Factor numerator and denominator completely.
- Cancel any common factors (these produce holes, not asymptotes — more on that below).
- The remaining zeros of the denominator are the vertical asymptotes.
Holes versus asymptotes
If the numerator and denominator share a common factor, that factor creates a hole (a removable discontinuity), not a vertical asymptote.
Consider h(x) = \frac{x^2 - 4}{x - 2} = \frac{(x-2)(x+2)}{x-2}. The factor (x-2) cancels, leaving h(x) = x + 2 for x \neq 2. The graph is the line y = x + 2 with a single point missing at x = 2. No explosion, no vertical asymptote — just a hole at (2, 4).
Horizontal asymptotes
A horizontal asymptote is a horizontal line y = L that the graph approaches as x \to +\infty or x \to -\infty. It describes the long-run behaviour — what happens far from the origin.
The rule is simple: compare the degree of the numerator (\deg p) with the degree of the denominator (\deg q).
| Condition | Horizontal asymptote |
|---|---|
| \deg p < \deg q | y = 0 |
| \deg p = \deg q | y = \dfrac{\text{leading coefficient of } p}{\text{leading coefficient of } q} |
| \deg p > \deg q | No horizontal asymptote (see oblique asymptotes below) |
Why this works. Divide numerator and denominator by x^n where n = \deg q:
As x \to \pm\infty, all the 1/x^k terms vanish. If m < n, the numerator goes to 0. If m = n, the ratio goes to a_m / b_n. If m > n, the numerator grows without bound.
Take f(x) = \frac{3x^2 + 1}{2x^2 - 5}. The degrees are equal (both 2). The horizontal asymptote is y = \frac{3}{2}. As x grows large, f(x) gets closer and closer to 1.5.
Take g(x) = \frac{x + 1}{x^2 + 4}. The numerator has lower degree. The horizontal asymptote is y = 0. The function value shrinks toward zero for large |x|.
Oblique (slant) asymptotes
When the degree of the numerator is exactly one more than the degree of the denominator (\deg p = \deg q + 1), the function does not level off to a horizontal line. Instead, it approaches a slanted line — an oblique asymptote.
To find it, perform polynomial long division:
The quotient is a degree-1 polynomial (a line), and the remainder fraction vanishes as x \to \pm\infty. That line is the oblique asymptote.
Take f(x) = \frac{x^2 + 2x + 3}{x + 1}. Dividing: x^2 + 2x + 3 = (x + 1)(x + 1) + 2, so f(x) = x + 1 + \frac{2}{x+1}. As x \to \pm\infty, the fraction \frac{2}{x+1} \to 0, so the graph approaches the line y = x + 1.
Graphing a rational function: the checklist
Here is a systematic approach to sketching the graph of any rational function.
- Factor numerator and denominator. Cancel common factors to find holes.
- Domain. Exclude the zeros of the (original) denominator.
- Vertical asymptotes. The remaining zeros of the denominator (after cancellation).
- Horizontal or oblique asymptote. Compare degrees.
- x-intercepts. Set the numerator equal to zero (the zeros of p that are in the domain).
- y-intercept. Evaluate f(0) (if 0 is in the domain).
- Sign analysis. Check the sign of f in each interval between the vertical asymptotes and zeros.
- Plot. Combine all the information.
Interactive: exploring asymptotes
Drag the red point along the curve f(x) = \frac{2x}{x - 3}. The readout shows the coordinates. Watch how f(x) grows rapidly near x = 3 (the vertical asymptote) and levels off near y = 2 (the horizontal asymptote) as x moves far from the origin.
Example 1: Graph $f(x) = \dfrac{x + 1}{x - 2}$
Step 1. Factor and check for holes. The numerator is (x + 1), the denominator is (x - 2). No common factors, so no holes.
Why: common factors produce holes (removable points), not asymptotes. Checking for them first avoids misidentifying a hole as an asymptote.
Step 2. Find the vertical asymptote. The denominator is zero at x = 2. Vertical asymptote: x = 2.
Why: the function value blows up as x \to 2 because the denominator shrinks to zero while the numerator approaches 3.
Step 3. Find the horizontal asymptote. Degree of numerator = 1, degree of denominator = 1. Equal degrees, so the horizontal asymptote is y = \frac{1}{1} = 1.
Why: the leading coefficients are both 1. For large |x|, \frac{x+1}{x-2} \approx \frac{x}{x} = 1.
Step 4. Find the intercepts. x-intercept: set x + 1 = 0, so x = -1. The graph crosses the x-axis at (-1, 0). y-intercept: f(0) = \frac{0 + 1}{0 - 2} = -\frac{1}{2}. The graph crosses the y-axis at (0, -\frac{1}{2}).
Why: the x-intercept is where f(x) = 0, which requires the numerator to be zero. The y-intercept is f(0).
Step 5. Sketch. The curve has two branches separated by the vertical asymptote at x = 2. On the left branch, the function rises from below y = 1 (the horizontal asymptote), passes through (-1, 0) and (0, -\frac{1}{2}), and plunges to -\infty as x \to 2^-. On the right branch, the function drops from +\infty and gradually settles toward y = 1 from above.
Result. Vertical asymptote x = 2, horizontal asymptote y = 1, x-intercept (-1, 0), y-intercept (0, -\frac{1}{2}).
The two dashed lines — one vertical, one horizontal — form a cross that the curve wraps around but never touches. Every rational function with equal-degree numerator and denominator follows this pattern: a hyperbola-like shape draped around its asymptotes.
Example 2: Find the asymptotes and sketch $g(x) = \dfrac{2x^2 - 8}{x^2 - x - 6}$
Step 1. Factor completely. Numerator: 2x^2 - 8 = 2(x^2 - 4) = 2(x-2)(x+2). Denominator: x^2 - x - 6 = (x-3)(x+2). Common factor: (x+2). After cancelling: g(x) = \frac{2(x-2)}{x-3} for x \neq -2.
Why: the common factor (x+2) means x = -2 is a hole, not an asymptote. The simplified form shows the true shape of the curve.
Step 2. Find the hole. At x = -2, the simplified function gives g(-2) = \frac{2(-2-2)}{-2-3} = \frac{2(-4)}{-5} = \frac{8}{5} = 1.6. So there is a hole at (-2, 1.6).
Why: the hole's y-value comes from the simplified function. The original function is undefined at x = -2, but the simplified function gives the "expected" value.
Step 3. Find the vertical asymptote. From the simplified denominator: x - 3 = 0, so x = 3.
Why: x = 3 makes the denominator zero in the simplified function, and the numerator is 2(3-2) = 2 \neq 0, confirming a true asymptote.
Step 4. Find the horizontal asymptote. In the simplified function, the degree of 2(x-2) = 2x - 4 is 1, and the degree of x - 3 is 1. Equal degrees. The horizontal asymptote is y = \frac{2}{1} = 2.
(Alternatively, use the original function: degrees are both 2, leading coefficients are 2 and 1, giving y = 2.)
Why: both methods agree — the horizontal asymptote depends only on the highest-degree terms, which are unaffected by cancellation.
Step 5. Find the intercepts. x-intercept: from the simplified numerator, 2(x-2) = 0 gives x = 2. So the curve crosses the axis at (2, 0). y-intercept: g(0) = \frac{2(0-2)}{0-3} = \frac{-4}{-3} = \frac{4}{3} \approx 1.33.
Result. Hole at (-2, 1.6). Vertical asymptote x = 3. Horizontal asymptote y = 2. x-intercept (2, 0).
The open circle at (-2, 1.6) is the visual signature of a hole: the curve passes through that y-value but the point itself is missing. If you computed g(-2) using the original (unfactored) expression, you would get \frac{0}{0} — undefined. The simplified form tells you what the function "wants" to be there.
Common confusions
-
"The graph of a rational function never crosses its horizontal asymptote." It can. The horizontal asymptote describes behaviour at the extremes (x \to \pm\infty), but in the middle the curve can cross the asymptotic line. For example, \frac{x}{x^2 + 1} has horizontal asymptote y = 0, and the curve crosses y = 0 at x = 0.
-
"Setting the denominator to zero gives you vertical asymptotes." Only after cancelling common factors. If the numerator and denominator share a factor, its zero produces a hole, not an asymptote. Always factor and simplify first.
-
"A rational function is undefined at its vertical asymptotes, so it has no value there." Correct — and this means those x-values are not in the domain. But some students confuse "undefined" with "equals infinity." The function does not equal infinity; it has no value at all.
-
"If the degree of the numerator is larger, there is no asymptote." There is no horizontal asymptote, but if the degree of the numerator exceeds the denominator by exactly 1, there is an oblique asymptote. If the excess is 2 or more, the end behaviour is polynomial-like (a parabolic or higher-degree curve).
-
"Vertical and horizontal asymptotes always come in pairs." There is no such rule. A rational function can have two vertical asymptotes and one horizontal one, or one vertical and none horizontal, or any combination.
If you understand how to find the domain, asymptotes, and intercepts, and can sketch a rational function from those pieces, you have the core of this topic — stop here if you like. What follows pushes into the algebraic structure behind the behaviour.
Why the graph splits into branches
Every vertical asymptote divides the real line into intervals, and the graph has a separate branch in each interval. Within each branch the function is continuous — no jumps or gaps. The "breaks" happen only at the asymptotes (and holes). A rational function with k vertical asymptotes has up to k + 1 branches.
Partial fractions (a preview)
Any proper rational function (numerator degree less than denominator degree) with a fully factored denominator can be decomposed into a sum of simpler fractions:
Solving for A and B by clearing denominators gives A = \frac{8}{3} and B = \frac{1}{3}. This decomposition is called partial fractions, and it is essential in integration (calculus) and in understanding the behaviour of the function near each asymptote separately. Each fraction \frac{A}{x - r} contributes one "hyperbola-like" piece to the overall graph.
Rational functions and polynomial long division
When \deg p \ge \deg q, polynomial long division splits the rational function into a polynomial part plus a proper fraction:
where \deg r < \deg q. The polynomial d(x) determines the large-|x| behaviour: if d(x) is constant, you have a horizontal asymptote; if linear, an oblique asymptote; if quadratic, a parabolic end behaviour. The remainder fraction \frac{r(x)}{q(x)} vanishes as |x| \to \infty and is responsible for the local drama near the vertical asymptotes.
Where this leads next
- Polynomial Functions — the numerator and denominator of every rational function are polynomials. Understanding their shapes is the foundation for this article.
- Domain and Range — rational functions are the first common family where the domain is not all of \mathbb{R}. This article gives you the general framework.
- Exponential Functions — another family with a horizontal asymptote, but built from a completely different mechanism (repeated multiplication rather than division).
- Graph Transformations and Translations — every rational function of the form \frac{a}{x - h} + k is a shifted and scaled version of \frac{1}{x}. Transformations make the connection precise.
- Polynomial Operations — long division, the remainder theorem, and factor theorem — the algebraic tools that make rational functions manageable.