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

f(x) = \frac{p(x)}{q(x)}

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.

Graph of f(x) equals 1 over xThe graph of f(x) equals 1 over x, showing two branches. In the first quadrant the curve starts high near the y-axis and decreases toward zero as x grows. In the third quadrant the curve starts near zero for large negative x and drops steeply as x approaches zero from the left. A dashed vertical line at x equals 0 marks the vertical asymptote, and a dashed horizontal line at y equals 0 marks the horizontal asymptote. x y 1 2 −1 −2 vertical asymptote y → 0
$f(x) = \frac{1}{x}$: the parent rational function. The dashed vertical line at $x = 0$ is the vertical asymptote — the graph cannot cross it. The dashed horizontal line at $y = 0$ is the horizontal asymptote — the graph approaches it from above (right branch) and from below (left branch) but never touches it.

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:

  1. Factor numerator and denominator completely.
  2. Cancel any common factors (these produce holes, not asymptotes — more on that below).
  3. The remaining zeros of the denominator are the vertical asymptotes.
Two vertical asymptotes on a rational functionThe graph of f(x) equals 1 over (x minus 1)(x minus 4). There are vertical asymptotes at x equals 1 and x equals 4. The graph has three branches: one to the left of x equals 1 approaching zero, one between x equals 1 and x equals 4 forming a downward cup, and one to the right of x equals 4 approaching zero. x y 1 2 4 5 3 x = 1 x = 4
$f(x) = \frac{1}{(x-1)(x-4)}$. Two vertical asymptotes at $x = 1$ and $x = 4$ split the graph into three branches. Between the asymptotes the curve dips below the axis. Outside them, the curve hugs the $x$-axis.

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:

\frac{a_m x^m + \cdots}{b_n x^n + \cdots} = \frac{a_m x^{m-n} + \cdots + \frac{a_0}{x^n}}{b_n + \cdots + \frac{b_0}{x^n}}

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:

\frac{p(x)}{q(x)} = \text{quotient}(x) + \frac{\text{remainder}(x)}{q(x)}

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.

Rational function with an oblique asymptoteThe graph of f(x) equals (x squared plus 2x plus 3) over (x plus 1). There is a vertical asymptote at x equals negative 1 and an oblique asymptote along the line y equals x plus 1. The curve approaches the slanted line from above on the right and from below on the left. x y −1 1 2 3 −2 −3 y = x + 1 x = −1
$f(x) = \frac{x^2 + 2x + 3}{x + 1} = x + 1 + \frac{2}{x+1}$. The dashed slant line $y = x + 1$ is the oblique asymptote. On the right, the curve sits just above the line (the $\frac{2}{x+1}$ remainder is positive). On the left of $x = -1$, the curve is below the line. The vertical asymptote at $x = -1$ separates the two branches.

Graphing a rational function: the checklist

Here is a systematic approach to sketching the graph of any rational function.

  1. Factor numerator and denominator. Cancel common factors to find holes.
  2. Domain. Exclude the zeros of the (original) denominator.
  3. Vertical asymptotes. The remaining zeros of the denominator (after cancellation).
  4. Horizontal or oblique asymptote. Compare degrees.
  5. x-intercepts. Set the numerator equal to zero (the zeros of p that are in the domain).
  6. y-intercept. Evaluate f(0) (if 0 is in the domain).
  7. Sign analysis. Check the sign of f in each interval between the vertical asymptotes and zeros.
  8. 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.

Interactive exploration of f(x) equals 2x over x minus 3An interactive graph of f(x) equals 2x over (x minus 3). A draggable red point moves along the curve. A readout shows the x and f(x) values. The vertical asymptote at x equals 3 and horizontal asymptote at y equals 2 are shown as dashed lines. x = 3 y = 2 drag the red point along the curve
Drag the point along $f(x) = \frac{2x}{x - 3}$. Near $x = 3$ the values explode (vertical asymptote). Far from the origin, $f(x)$ settles toward $2$ (horizontal asymptote at $y = \frac{2}{1} = 2$, since both numerator and denominator have degree 1).

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}).

Graph of f(x) equals (x plus 1) over (x minus 2)The graph of f(x) equals (x plus 1) over (x minus 2). A vertical asymptote at x equals 2 splits the graph into two branches. A horizontal asymptote at y equals 1 shows the long-run value. The x-intercept is at negative 1, the y-intercept is at negative one-half. x y −1 1 2 3 4 (−1, 0) (0, −½) x = 2 y = 1
$f(x) = \frac{x+1}{x-2}$. The vertical asymptote at $x = 2$ is where the denominator is zero. The horizontal asymptote at $y = 1$ is the ratio of leading coefficients. The curve crosses the $x$-axis at $(-1, 0)$ and the $y$-axis at $(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).

Graph of g(x) equals (2x squared minus 8) over (x squared minus x minus 6)The graph of g(x) equals 2(x minus 2) over (x minus 3) with a hole at (negative 2, 1.6). The vertical asymptote at x equals 3 separates two branches. The horizontal asymptote at y equals 2 shows the long-run value. The curve crosses the x-axis at x equals 2. An open circle marks the hole at negative 2. x y −1 −2 1 2 3 4 5 hole (−2, 1.6) x = 3 y = 2 (2, 0)
$g(x) = \frac{2(x-2)}{x-3}$ (with a hole at $x = -2$). The open circle at $(-2, 1.6)$ marks the hole — the function is undefined there, but nearby values approach $1.6$. The vertical asymptote at $x = 3$ and horizontal asymptote at $y = 2$ structure the rest of the graph.

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

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:

\frac{3x + 5}{(x-1)(x+2)} = \frac{A}{x-1} + \frac{B}{x+2}

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:

\frac{p(x)}{q(x)} = d(x) + \frac{r(x)}{q(x)}

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