Skip to content
Tutorials Center
My learning

Topics

Lesson 14 of 37 · Polynomial and Rational Functions

Rational Functions and Asymptotes

Find vertical, horizontal and slant asymptotes and holes of rational functions, then sketch their graphs, with SymPy checks and Python plots.

A rational function is a ratio of two polynomials, f(x) = P(x) / Q(x), with Q not zero. Unlike polynomials, rational graphs can break apart and can approach lines they never reach. Those lines are asymptotes. Understanding them is excellent preparation for limits, because an asymptote is a statement about what happens "near" a value or "far out".

Domain and holes

The domain excludes every x with Q(x) = 0. At such an x, one of two things happens depending on whether the factor cancels:

  • If a factor (x - a) of the denominator does not cancel with the numerator, there is a vertical asymptote at x = a.
  • If it does cancel, there is a hole (a single missing point) at x = a.

Example: f(x) = (x² - 4) / (x - 2) = (x - 2)(x + 2)/(x - 2). After cancelling, it looks like x + 2, but x = 2 is still not in the domain. So the graph is the line y = x + 2 with a hole at (2, 4): the y-value comes from the simplified formula, 2 + 2 = 4.

Vertical asymptotes

At a vertical asymptote x = a, the function grows without bound: f(x) → ∞ or -∞ as x → a from either side. Check the sign on each side to know which. For f(x) = 1/(x - 3):

  • just right of 3 (say 3.01), f = 100, large positive;
  • just left of 3 (say 2.99), f = -100, large negative.

For 1/(x - 3)² the square makes both sides positive: both go to +∞.

Horizontal asymptotes

A horizontal asymptote y = L describes the end behavior as x → ±∞. Compare the degrees of numerator (n) and denominator (m):

Comparison Horizontal asymptote
n < m y = 0
n = m y = (leading coeff. of P) / (leading coeff. of Q)
n > m none

Example: f(x) = (3x² + 1)/(x² - 5) has n = m = 2, so y = 3/1 = 3.

Why? For huge x, only the leading terms matter: 3x²/x² = 3.

Slant asymptotes

If the numerator's degree is exactly one more than the denominator's, the graph approaches a slanted line. Find it by polynomial division; the quotient (ignoring the remainder) is the line.

Example: f(x) = (x² + 3x + 1)/(x + 1). Dividing: x² + 3x + 1 = (x + 1)(x + 2) - 1, so f(x) = x + 2 - 1/(x + 1). As |x| grows the last term fades, so the slant asymptote is y = x + 2. There is also a vertical asymptote at x = -1.

Python Asymptotes with SymPy

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Sketching a rational function

Use a checklist:

  1. Factor numerator and denominator; cancel common factors (holes).
  2. Find the domain and vertical asymptotes.
  3. Find intercepts: x-intercepts from the numerator's zeros; y-intercept f(0).
  4. Find the horizontal or slant asymptote.
  5. Use sign information on each interval between critical values.

Example: f(x) = (2x - 2) / (x² - 9).

  • Denominator (x - 3)(x + 3): vertical asymptotes at x = ±3.
  • Numerator zero at x = 1; y-intercept f(0) = -2/-9 = 2/9.
  • n = 1 < m = 2: horizontal asymptote y = 0.
Python Plot a rational function with its asymptotes

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A graph can cross a horizontal asymptote in the middle region; it describes only the far left and far right. Vertical asymptotes, however, can never be crossed.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. Where is the hole in f(x) = (x² - 9)/(x - 3)?

    The factor (x - 3) cancels, so x = 3 is a missing point rather than an asymptote.
  2. 2. What is the horizontal asymptote of (4x² + 1)/(2x² - 7)?

    The degrees are equal, so the asymptote is the ratio of leading coefficients, 4/2 = 2.
  3. 3. When does a rational function have a slant asymptote?

    Dividing then leaves a linear quotient, which is the slanted line the graph approaches.
  4. 4. What is the vertical asymptote of f(x) = 5/(x + 2)?

    The denominator is zero at x = -2 and the numerator is not, so there is a vertical asymptote there.

Summary

  • Uncancelled denominator zeros give vertical asymptotes; cancelled ones give holes.
  • Horizontal asymptote: compare degrees (smaller gives y = 0, equal gives the ratio of leading coefficients, larger gives none).
  • A slant asymptote appears when the numerator's degree is one more; find it by division.
  • Sketch with factors, intercepts, asymptotes and signs.

Next: Complex Numbers and the Fundamental Theorem