How to Graph Rational Functions

Learn how to graph rational functions step by step. Covers vertical and horizontal asymptotes, holes, domain restrictions, end behavior, and sketching techniques.

What Is a Rational Function?

A rational function is a ratio of two polynomials: y = P(x)/Q(x), where P and Q are polynomials and Q is not the zero polynomial. The simplest example is y = 1/x, which divides the constant 1 by x. Rational functions can have breaks, gaps, and asymptotes in their graphs, making them more complex to graph than polynomials. The denominator Q(x) determines where the function is undefined, which creates asymptotes or holes. Rational functions appear in physics (inverse-square laws), chemistry (reaction rates), and engineering (transfer functions in control systems).

Domain and Undefined Points

The domain of a rational function y = P(x)/Q(x) excludes all x-values where Q(x) = 0. Set the denominator equal to zero and solve; those solutions are excluded from the domain. Whether each excluded point produces a vertical asymptote or a removable hole depends on whether the numerator shares that factor. If Q(c) = 0 and P(c) is not also zero, there is a vertical asymptote at x = c. If both P(c) = 0 and Q(c) = 0 (meaning (x - c) is a common factor), there is a removable hole at x = c. Always factor both P and Q completely before analyzing the domain.

Vertical Asymptotes

A vertical asymptote at x = c means the function grows without bound as x approaches c. After canceling common factors, any remaining roots of the denominator produce vertical asymptotes. Near a vertical asymptote, the function shoots up to positive infinity or down to negative infinity on each side. To determine which direction, evaluate the sign of the function just to the left and right of the asymptote by substituting a nearby test value. For example, y = 1/x has a vertical asymptote at x = 0. As x → 0+, y → +∞; as x → 0-, y → -∞. Draw the asymptote as a dashed vertical line and sketch the curve approaching it on each side.

Horizontal and Oblique Asymptotes

The horizontal asymptote describes the behavior of y as x → ±∞ and is determined by comparing the degrees of P and Q. If the degree of P is less than that of Q, the horizontal asymptote is y = 0. If the degrees are equal, the asymptote is y = (leading coefficient of P)/(leading coefficient of Q). If the degree of P exceeds that of Q by exactly 1, there is no horizontal asymptote but there is an oblique (slant) asymptote, found by performing polynomial long division on P(x)/Q(x). If the degree of P exceeds Q by more than 1, neither applies and the ends grow without bound. A rational function can cross its horizontal asymptote in the middle of the graph, but never its vertical asymptotes.

Finding Holes

A hole (removable discontinuity) occurs when a factor cancels from both numerator and denominator. For example, y = (x² - 4)/(x - 2) = (x+2)(x-2)/(x-2) = x + 2, except at x = 2. After canceling, the simplified function is the line y = x + 2, but with a hole at x = 2. To find the y-coordinate of the hole, substitute x = 2 into the simplified function: y = 2 + 2 = 4. The hole is at (2, 4). When graphing, draw the simplified function but mark the hole with an open circle at the excluded point. Holes are distinct from vertical asymptotes because the function can be continuously extended through a hole but not through a vertical asymptote.

x-Intercepts and y-Intercept

The x-intercepts of a rational function occur where the numerator is zero (after canceling common factors). Set P(x) = 0 and solve; any root that was not already canceled produces an x-intercept. The y-intercept is found by substituting x = 0 into the function (as long as 0 is in the domain). For y = (x - 1)(x + 3) / [(x - 2)(x + 4)], the x-intercepts are at x = 1 and x = -3. The y-intercept is y = (-1)(3) / [(-2)(4)] = -3 / (-8) = 3/8. If 0 is not in the domain (i.e., the denominator is zero at x = 0), there is no y-intercept.

Step-by-Step Graphing Process

To graph a rational function: first, factor numerator and denominator completely and cancel common factors, noting any holes. Second, identify vertical asymptotes from remaining denominator roots. Third, determine the horizontal or oblique asymptote by comparing degrees. Fourth, find x-intercepts and the y-intercept. Fifth, check the sign of the function in each interval between asymptotes and intercepts, using test points to determine whether the graph is above or below the x-axis. Sixth, draw dashed lines for all asymptotes. Seventh, sketch the curve in each region, approaching asymptotes correctly and passing through the intercepts. Mark any holes with open circles.

Try These Calculators

Put what you learned into practice with these free calculators.

Try It Yourself

Put what you learned into practice with our free graphing calculator.

Related Graphs