← MATH 161 MathScape 0 MATH161

Rational Functions

11 min read

Jump to a section

Textbook Reference

Primary source OpenStax Calculus Volume 1, Section 1.2: “Basic Classes of Functions”
Direct link https://openstax.org/books/calculus-volume-1/pages/1-2-basic-classes-of-functions
Supplementary OpenStax Precalculus 2e, Section 5.6: “Rational Functions”
Supplementary link https://openstax.org/books/precalculus-2e/pages/5-6-rational-functions

Both sources are free and openly licensed.


Try This First

Consider the function $f(x) = \dfrac{x-1}{x-2}$.

Fill in the table below -- predict first, then compute:

$x$ $1.5$ $1.9$ $1.99$ $2$ $2.01$ $2.1$ $3$
$f(x)$ ? ? ? ? ? ? ?

Before computing: what do you expect to happen at $x = 2$? What do you expect to happen as $x$ grows very large?

Keep your predictions. Two behaviors drive what you observe: the output near $x = 2$ and the output as $x$ grows large.


Key idea

Division by zero is the central feature of rational functions. At inputs where the denominator is zero, the function has no output -- the domain has a gap. But the interesting question is not just “where is the denominator zero?” It is “what does the function do near those gaps?” The output can either shoot off toward infinity (a vertical asymptote) or quietly cancel to a finite value (a removable hole). These are structurally different behaviors, and telling them apart requires factoring.

Similarly, the long-run behavior of a rational function -- what happens as $x$ grows large -- is controlled by the degrees of the numerator and denominator. Both behaviors come from the same source: where the denominator is small, and what dominates when $x$ is large.


Prerequisite Check

Before this lesson, make sure you can do all of the following:

If any of these is uncertain, review Polynomial Functions and Factoring Techniques first.


Quick Reference

Definition. A rational function has the form $$ f(x) = \frac{p(x)}{q(x)} $$ where $p$ and $q$ are polynomials and $q$ is not the zero polynomial.

Feature Rule
Domain All real $x$ where $q(x) \neq 0$
Vertical asymptote at $x = a$ $q(a) = 0$ but $p(a) \neq 0$ after full cancellation
Hole at $x = a$ Both $p(a) = 0$ and $q(a) = 0$ (common factor cancels)
Horizontal asymptote Determined by comparing degrees of $p$ and $q$ (see below)

Horizontal asymptote rules (let $n = \deg p$, $m = \deg q$):

Case Horizontal asymptote
$n < m$ $y = 0$
$n = m$ $y = \dfrac{\text{leading coefficient of } p}{\text{leading coefficient of } q}$
$n > m$ No horizontal asymptote (output grows without bound)

Key Concepts

1. Domain and Where the Denominator Is Zero

The domain of $f(x) = p(x)/q(x)$ is the set of all real numbers where $q(x) \neq 0$. Find the domain by setting $q(x) = 0$ and excluding those values.

Example. Find the domain of $f(x) = \dfrac{3x + 1}{x^2 - 5x + 6}$.

Factor the denominator: $x^2 - 5x + 6 = (x-2)(x-3)$.

Denominator is zero at $x = 2$ and $x = 3$.

Domain: all real numbers except $x = 2$ and $x = 3$.

In interval notation: $(-\infty, 2) \cup (2, 3) \cup (3, +\infty)$.

Two representations, one idea.

Algebraic: $q(x) = (x-2)(x-3) = 0$ at $x = 2$ and $x = 3$.

Graphical: The graph of $f$ has no points with $x$-coordinate $2$ or $x$-coordinate $3$. There are gaps in the curve at those $x$-values.

Translation prompt: Given only the graph with gaps (vertical dashed lines at $x = 2$ and $x = 3$), write the factored denominator. Then reverse: from the factored denominator $(x-2)(x-3)$, describe what you would see on the graph near those $x$-values before you know whether each gap is a vertical asymptote or a hole.


2. Vertical Asymptotes vs. Holes

After finding where $q(a) = 0$, the key question is: does $p(a)$ also equal zero?

Case 1: $q(a) = 0$ and $p(a) \neq 0$. The factor $(x - a)$ is in the denominator but not the numerator. Division by a number approaching zero produces outputs that grow without bound. The graph has a vertical asymptote at $x = a$.

Case 2: $q(a) = 0$ and $p(a) = 0$. Both numerator and denominator share the factor $(x - a)$. After cancellation, the output approaches a finite limit as $x \to a$. The graph has a hole (removable discontinuity) at $x = a$.

Predict-then-check. For $f(x) = \dfrac{x^2 - 1}{x - 1}$, predict: vertical asymptote or hole at $x = 1$?

Prediction: Both numerator and denominator are zero at $x = 1$ (since $1^2 - 1 = 0$). Expect a hole.

Check: Factor: $\dfrac{x^2 - 1}{x - 1} = \dfrac{(x-1)(x+1)}{x-1} = x + 1$ for $x \neq 1$.

As $x \to 1$, the output approaches $1 + 1 = 2$. There is a hole at the point $(1, 2)$, not a vertical asymptote.

Now predict for $g(x) = \dfrac{x^2 - 4}{x - 1}$ at $x = 1$: $g(1) = (1-4)/(0)$, numerator $= -3 \neq 0$. This is a vertical asymptote, not a hole.


3. Behavior Near a Vertical Asymptote

Near a vertical asymptote $x = a$, the function output grows without bound. The direction (positive or negative) depends on the sign of the remaining expression after canceling common factors.

Example. Analyze $f(x) = \dfrac{1}{x - 2}$ near $x = 2$.

For $x$ slightly greater than $2$: $x - 2$ is small and positive, so $\dfrac{1}{x-2}$ is large and positive. $f(x) \to +\infty$.

For $x$ slightly less than $2$: $x - 2$ is small and negative, so $\dfrac{1}{x-2}$ is large and negative. $f(x) \to -\infty$.

Numerical check:

$x$ $1.9$ $1.99$ $1.999$ $2.001$ $2.01$ $2.1$
$f(x)$ $-10$ $-100$ $-1000$ $1000$ $100$ $10$

The values confirm the prediction: left side goes to $-\infty$, right side goes to $+\infty$.

Ask why: Does the graph ever actually reach $x = 2$? No -- $x = 2$ is not in the domain. The graph approaches the vertical line $x = 2$ but never touches it. The asymptote is a line that describes the graph’s trend, not a wall that the graph bounces off of (see the misconception below).


4. Horizontal Asymptotes and End Behavior

As $x \to \pm\infty$, the leading terms of numerator and denominator dominate all other terms. Divide numerator and denominator by the highest power of $x$ that appears.

Example: $n < m$ (numerator degree less than denominator degree).

$f(x) = \dfrac{3x + 1}{x^2 - 5x + 6}$.

As $x \to \infty$, numerator grows like $3x$ and denominator grows like $x^2$. The ratio $3x / x^2 = 3/x \to 0$.

Horizontal asymptote: $y = 0$.

Example: $n = m$ (equal degrees).

$f(x) = \dfrac{4x^2 - 3}{2x^2 + 7}$.

Divide numerator and denominator by $x^2$: $$ f(x) = \frac{4 - 3/x^2}{2 + 7/x^2} \to \frac{4}{2} = 2 \text{ as } x \to \pm\infty. $$

Horizontal asymptote: $y = 2$.

Two representations, one idea.

Algebraic: The ratio of leading coefficients $4/2 = 2$.

Graphical/numerical: Compute $f(100) = (40000 - 3)/(20000 + 7) = 39997/20007 \approx 1.9992$, and $f(1000) \approx 1.999992$. The output approaches 2.

Translation prompt: Explain in one sentence why the lower-degree terms become negligible as $x$ grows large. Then use that explanation to determine the horizontal asymptote of $\dfrac{5x^3 - 2x}{3x^3 + x^2 + 1}$ without computing anything beyond the leading terms.

Example: $n > m$ (numerator degree greater).

$f(x) = \dfrac{x^3}{x^2 + 1}$.

The output grows like $x^3/x^2 = x$ for large $x$. There is no horizontal asymptote. (There is an oblique asymptote; see the extension below.)


Named Misconception

Misconception ID: asymptote-as-wall

A vertical asymptote at $x = a$ is sometimes described as a “wall” that the graph cannot cross. This image is misleading for two reasons.

First, a vertical asymptote is a line that describes the graph’s behavior near $x = a$: the output grows without bound as $x$ approaches $a$ from one or both sides. It is a trend description, not a physical barrier.

Second, a horizontal asymptote can be crossed. The function $f(x) = \dfrac{\sin x}{x}$ has horizontal asymptote $y = 0$ but crosses it infinitely many times (at every $x = k\pi$ for nonzero integer $k$). Even simpler: $f(x) = \dfrac{x}{x^2+1}$ has horizontal asymptote $y = 0$ and equals $0$ at $x = 0$.

Why the wall image breaks: The asymptote $y = L$ means only that $f(x) \to L$ as $x \to \infty$. It says nothing about whether $f(x) = L$ is possible for finite $x$.

Correct image: Think of the asymptote as a trend line that the graph approaches but (for vertical asymptotes) cannot reach because that $x$-value is outside the domain. For horizontal asymptotes, the graph may or may not cross the asymptote for finite $x$; what matters is the long-run behavior.


Worked Example

Problem. Analyze $f(x) = \dfrac{x^2 - x - 6}{x^2 - 4}$.

Find: (a) domain, (b) holes, (c) vertical asymptotes, (d) horizontal asymptote, (e) zeros.

Step 1: Predict. Both numerator and denominator are degree 2. Expect a horizontal asymptote at $y = 1/1 = 1$ (ratio of leading coefficients).

Step 2: Factor. $$ \text{Numerator: } x^2 - x - 6 = (x-3)(x+2) $$ $$ \text{Denominator: } x^2 - 4 = (x-2)(x+2) $$

Step 3: Domain. Denominator is zero at $x = 2$ and $x = -2$. Domain: all reals except $x = 2$ and $x = -2$.

Step 4: Holes vs. vertical asymptotes.

At $x = -2$: both numerator and denominator are zero ($(x+2)$ is a common factor). Cancel: $$ f(x) = \frac{(x-3)(x+2)}{(x-2)(x+2)} = \frac{x-3}{x-2} \quad \text{for } x \neq -2. $$ As $x \to -2$: output $\to \dfrac{-2-3}{-2-2} = \dfrac{-5}{-4} = \dfrac{5}{4}$. Hole at $\left(-2, \dfrac{5}{4}\right)$.

At $x = 2$: denominator is zero, numerator (after cancellation) $= 2 - 3 = -1 \neq 0$. Vertical asymptote at $x = 2$.

Step 5: Horizontal asymptote. Degrees are equal; ratio of leading coefficients: $1/1 = 1$. Horizontal asymptote $y = 1$.

Check prediction: matches the prediction from Step 1.

Step 6: Zeros. Zeros of the simplified function $\dfrac{x-3}{x-2}$: numerator $= 0$ when $x = 3$. Check: $x = 3$ is in the domain (denominator at $x = 3$ is $3 - 2 = 1 \neq 0$). Zero at $x = 3$.

Step 7: Verify with a value. $f(10) = (10-3)/(10-2) = 7/8 = 0.875$. The horizontal asymptote $y = 1$ says $f(x) \to 1$ from below for large $x$. $0.875$ is below $1$, consistent.


Common Errors

Error Example Correction
Declaring a vertical asymptote without checking for cancellation $\dfrac{(x+2)}{(x+2)(x-1)}$: “asymptote at $x=-2$” Factor first: $(x+2)$ cancels; $x = -2$ is a hole, not an asymptote
Forgetting to exclude holes from the domain “Domain is all reals except $x = 1$” (above function) Domain excludes both $x = -2$ (hole) and $x = 1$ (asymptote)
Confusing $n < m$ and $n > m$ asymptote rules “Bigger denominator degree means bigger asymptote” $n < m$ gives $y = 0$; $n > m$ means no horizontal asymptote
Treating the horizontal asymptote as unreachable for finite $x$ “The graph can never equal $y = 2$” The graph may cross the horizontal asymptote for finite $x$
Forgetting that the hole is still not in the domain after cancellation “$\dfrac{x^2-1}{x-1} = x+1$, so domain is all reals” The cancellation is valid only for $x \neq 1$; the hole remains

Common Misconceptions

Common misconception

a horizontal asymptote is a line the graph can never touch or cross.

This is the asymptote-as-wall error. A horizontal asymptote $y = L$ is a statement about long-run behavior: $f(x) \to L$ as $x \to \pm\infty$. It says nothing about what happens for finite $x$. The graph of $f(x) = \dfrac{x \sin x}{x^2 + 1}$ has the horizontal asymptote $y = 0$ yet crosses the $x$-axis infinitely many times. The asymptote is a limit at infinity, not a barrier that the function must stay on one side of.


Leveled Practice

Level 1 -- Direct Application

Problem 1. Find the domain of $f(x) = \dfrac{2x + 3}{x^2 - 9}$ and identify all values excluded.

Show answer

Factor denominator: $x^2 - 9 = (x-3)(x+3)$. Denominator is zero at $x = 3$ and $x = -3$.

Domain: all reals except $x = 3$ and $x = -3$.

Check numerator at those values: $2(3)+3 = 9 \neq 0$ and $2(-3)+3 = -3 \neq 0$. Both are vertical asymptotes (not holes).


Problem 2. Find any holes and vertical asymptotes of $g(x) = \dfrac{x^2 - 4}{x^2 - x - 2}$.

Show answer

Factor: $x^2 - 4 = (x-2)(x+2)$ and $x^2 - x - 2 = (x-2)(x+1)$.

Cancel the common factor $(x-2)$: $$ g(x) = \frac{(x-2)(x+2)}{(x-2)(x+1)} = \frac{x+2}{x+1} \quad \text{for } x \neq 2. $$

At $x = 2$: hole at $\left(2, \dfrac{4}{3}\right)$ (since $g(x) \to (2+2)/(2+1) = 4/3$).

At $x = -1$: denominator zero, numerator $(-1+2)=1 \neq 0$. Vertical asymptote at $x = -1$.


Problem 3. Determine the horizontal asymptote (if any) of $h(x) = \dfrac{6x^3 - 1}{2x^3 + x - 5}$.

Show answer

Numerator degree: 3. Denominator degree: 3. Equal degrees.

Ratio of leading coefficients: $6/2 = 3$.

Horizontal asymptote: $y = 3$.


Level 2 -- Multiple Representations

Problem 4. For $f(x) = \dfrac{x^2 + x - 2}{x^2 - 1}$, find the domain, holes, vertical asymptotes, horizontal asymptote, and zeros. Then make a rough sketch consistent with your findings.

Show answer

Factor: $x^2 + x - 2 = (x+2)(x-1)$ and $x^2 - 1 = (x-1)(x+1)$.

Cancel $(x-1)$: $f(x) = \dfrac{x+2}{x+1}$ for $x \neq 1$.

Domain: all reals except $x = 1$ and $x = -1$.

Hole at $x = 1$: $f(x) \to (1+2)/(1+1) = 3/2$. Hole at $(1, 3/2)$.

Vertical asymptote at $x = -1$ (denominator zero, numerator $(-1+2)=1 \neq 0$).

Horizontal asymptote: equal degrees, ratio $1/1 = 1$, so $y = 1$.

Zero: numerator of simplified form $= 0$ when $x = -2$. Check: $-2 \neq -1$, so in domain. Zero at $x = -2$.

Sketch: graph of $\dfrac{x+2}{x+1}$ with a hole at $(1, 3/2)$ and a vertical asymptote at $x = -1$.


Problem 5. For large positive $x$, is $f(x) = \dfrac{3x^2 - 2x}{x^2 + 1}$ approaching $y = 3$ from above or below? Explain algebraically and confirm numerically.

Show answer

Write $f(x) = \dfrac{3x^2 - 2x}{x^2 + 1}$. Subtract 3: $$ f(x) - 3 = \frac{3x^2 - 2x - 3(x^2+1)}{x^2+1} = \frac{-2x - 3}{x^2+1} $$

For large positive $x$, the numerator $-2x - 3 < 0$ and the denominator $x^2 + 1 > 0$, so $f(x) - 3 < 0$. The graph approaches $y = 3$ from below.

Numerical check: $f(100) = (30000 - 200)/(10000+1) = 29800/10001 \approx 2.9797 < 3$. Confirmed.


Level 3 -- Extension

Problem 6 (Low Floor, High Ceiling). Determine the oblique (slant) asymptote of $f(x) = \dfrac{x^2 + 3x - 1}{x + 1}$ and explain why it is an asymptote.

Show answer

Perform polynomial long division: $$ \frac{x^2 + 3x - 1}{x+1} = x + 2 + \frac{-3}{x+1} $$

As $x \to \pm\infty$, the remainder term $\dfrac{-3}{x+1} \to 0$.

Therefore $f(x) \approx x + 2$ for large $|x|$.

The line $y = x + 2$ is the oblique asymptote: the graph of $f$ approaches this line as $x \to \pm\infty$.

Why it works: whenever the numerator degree exceeds the denominator degree by exactly 1, polynomial long division produces a linear quotient plus a remainder fraction. The remainder fraction goes to zero for large $|x|$, so the linear part is the asymptote.


Mastery Checklist

You have mastered this skill when you can do all of the following without referring to notes:


Mental Model

Think of a rational function as a polynomial that has been “divided in half” by another polynomial. Where the denominator is zero, the function has a gap. The gap is either a hole (if the numerator also vanishes there, and the factors cancel) or a vertical asymptote (if the numerator does not vanish there). Near the asymptote, the output surges toward $\pm\infty$ as the denominator shrinks toward zero.

At the far ends (large $|x|$), the function behaves like the ratio of its leading terms. A smaller numerator degree means the denominator wins and the output flattens to zero. Equal degrees mean the outputs balance at the ratio of leading coefficients. A larger numerator degree means the numerator wins and the output grows without bound (giving an oblique asymptote when the degrees differ by exactly 1).

The graph of a rational function is like a polynomial graph that has been stretched, compressed, and cut wherever the denominator fails.


Connections

Within Chapter 1

Toward Later Calculus

Audience Notes

For students who find the hole vs. asymptote distinction tricky: The key is always to factor first. After full cancellation, check the simplified expression at the excluded $x$-value. If the simplified expression gives a finite number, it is a hole. If the denominator is still zero in the simplified expression, it is a vertical asymptote.

For students who want to go further: A rational function over the real numbers is completely determined (up to a constant) by its zeros, poles (vertical asymptotes), and the degree comparison. This idea generalizes to complex analysis, where rational functions on the complex plane (called rational maps) are classified by their poles and zeros, and the study of their global behavior is a rich area of mathematics.


Back to Chapter 1 Skills | Previous: Polynomial Functions | Next: Power Functions