Asymptote Calculator

Find vertical, horizontal and slant asymptotes and holes of any rational function, with factoring and long-division steps and a graph of the result.

Asymptote Calculator

Calculate and visualize vertical, horizontal, and oblique asymptotes, holes and intercepts of rational functions. Enter a rational function in the form of f(x) = P(x) / Q(x) where P(x) and Q(x) are polynomials.

Only rational functions are accepted. Exponential, logarithmic, trigonometric and root functions (e^x, ln(x - 2), tan x, √x) have asymptotes too, but this calculator does not handle them.

Function Input

Use ^ for powers; * is optional (2x, (x-1)(x+2) work). Example: (2x^2 + 3x - 1) / (x^2 - 9)

Display Options

Asymptote Calculator: Find Vertical, Horizontal and Slant Asymptotes Instantly

Most students first hear that a graph never touches its asymptote. That is true for vertical ones, but a graph can cross a horizontal asymptote at finite x-values, the asymptote only controls what happens at the far ends. This asymptote calculator finds all three types for rational functions, shows you the working, and flags holes so you do not mistake one for an asymptote. Enter your function once and get vertical asymptote lines, horizontal or slant asymptote values, domain restrictions, and any removable discontinuities, all with enough detail to copy into your homework or check your own work.

  • Vertical Asymptote Rule: x = a is a vertical asymptote if denominator Q(a) = 0 and numerator P(a) ≠ 0.
  • Hole Condition: x = a is a hole if P(a) = 0 and Q(a) = 0, and the factor (x − a) cancels completely.
  • Horizontal Asymptote (n < m): y = 0
  • Horizontal Asymptote (n = m): y = (leading coefficient of P) ÷ (leading coefficient of Q)
  • Slant Asymptote Condition: Exists only if degree(P) = degree(Q) + 1 and no cancellation occurs.
  • Slant Asymptote Equation: Quotient from polynomial long division of P ÷ Q, ignoring the remainder.

How to Enter Your Function

Type your rational function into the input box in the form f(x) = P(x) / Q(x). Use ^ for exponents, so x² becomes x^2. Multiplication is optional: 2x, (x-1)(x+2) and 2*x all work. A single input mode accepts (2x^2 + 3x - 1) / (x^2 - 9) as one line. If you prefer, switch to separate numerator/denominator mode and enter P(x) and Q(x) in two boxes. After typing, set the decimal places for irrational values (0 to 4), pick a graph range between ±5 and ±50, and check 'Show calculation steps' to see the full polynomial long division and cancellation work. Click 'Calculate Asymptotes' to get your results.

Reading the Results: Vertical, Horizontal, Slant, Holes, Domain and Degree Comparison

The results panel lists vertical asymptotes as x = a, one per line. If the denominator has a squared factor at that x-value, the left and right sides of the graph both go to the same infinity (both +∞ or both −∞). An odd multiplicity flips the sign across the asymptote. Horizontal asymptotes show as y = b. If the calculator returns 'None', check the slant asymptote section, a slant line appears when the numerator degree is exactly one more than the denominator degree. For degree differences of two or more, neither horizontal nor slant exists; the end behaviour follows a polynomial (the quotient from long division, shown in the steps).

Holes and Domain

Holes appear as (x, y) coordinate pairs. The x-value is where a common factor cancelled; the y-value comes from plugging that x into the simplified function. If you see a hole at x = 1 with y = 2, the original function is undefined at (1, 2) but the limit exists. The domain line lists every x-value excluded from the real numbers, which includes both hole x-values and vertical asymptote x-values.

Degree Comparison Output

The calculator shows the degree of the numerator (n) and denominator (m) side by side, plus the decision: n < m → y = 0; n = m → y = ratio of leading coefficients; n > m → no horizontal asymptote (slant or polynomial end behaviour displayed instead). This is the single table from a standard precalculus text (OpenStax Precalculus 2e, section 5.6) that drives the algorithm.

Degree Comparison Decides Horizontal or Slant Asymptote
Condition (n = degree of numerator, m = degree of denominator)Horizontal Asymptote (y = ...)Slant Asymptote?
n < my = 0No
n = my = (leading coefficient of P) ÷ (leading coefficient of Q)No
n = m + 1 (and no cancellation)NoneYes: quotient from long division of P ÷ Q
n > m + 1NoneNo: end behaviour is a polynomial of degree n − m

Worked Example: A Hole, a Vertical Asymptote and a Horizontal Asymptote Together

Consider f(x) = (x² + 3x + 2) / (x² + x − 2). Factor: the top is (x + 1)(x + 2), the bottom is (x + 2)(x − 1). The factor (x + 2) cancels completely, so x = −2 is a hole, not a vertical asymptote. Substitute x = −2 into the simplified function (x + 1)/(x − 1) to get y = (−2 + 1)/(−2 − 1) = (−1)/(−3) = 1/3. The hole sits at (−2, 1/3). After cancellation, the reduced bottom is (x − 1), which has a root at x = 1. The top at x = 1 is (1 + 1) = 2, which is not zero, so x = 1 is a vertical asymptote. Degrees: numerator degree = 1, denominator degree = 1, so horizontal asymptote is y = leading coefficient of numerator (1) ÷ leading coefficient of denominator (1) = 1. The graph approaches y = 1 as x goes to both +∞ and −∞, and it can cross that line at finite x, for example at x = 0, f(0) = 1/2, which is below y = 1. The calculator shows each step: factoring, cancellation, long division (if needed), and the final asymptote list.

What This Calculator Does Not Handle

This asymptote calculator accepts rational functions only, the quotient of two polynomials. Exponential functions (e^x), logarithmic functions (ln(x − 2)), trigonometric functions (tan x, sec x), root functions (√x), and combinations of these with rational parts are not supported. Those functions have asymptotes too: e^x has a horizontal asymptote at y = 0 as x → −∞; ln(x) has a vertical asymptote at x = 0; tan x has vertical asymptotes at x = π/2 + kπ. But the factoring, cancellation and degree-comparison method that this calculator uses does not apply to them. If you need asymptotes for a non-rational function, look for a limit-based tool or work the limits by hand. The calculator will return an error message explaining that it only handles rational functions.

Common Questions

Can a graph cross a horizontal asymptote?

Yes. A horizontal asymptote describes the limit as x → ±∞, not a barrier at finite x. For example, f(x) = (x² − 1)/(x² + 1) has horizontal asymptote y = 1, but f(0) = −1, which is well below the line. The graph crosses at x = 0 and still settles toward y = 1 at both ends.

Can a rational function have both a horizontal and a slant asymptote?

No, not for the same rational function. The degree of the numerator relative to the denominator decides which one appears: if numerator degree < denominator degree or equal, you get a horizontal asymptote; if numerator degree is exactly one more, you get a slant asymptote; if the difference is two or more, you get neither. A single function cannot satisfy two of those conditions simultaneously.

When does a vertical asymptote become a hole instead?

A hole occurs at x = a when both numerator and denominator equal zero at that point, and the common factor (x − a) cancels completely. If the denominator is zero but the numerator is not, it is a vertical asymptote. Always factor first: the cancelled factor indicates a hole; the remaining denominator zeros are vertical asymptotes.

What does it mean if the calculator shows 'slant asymptote: none' but the degree difference is 2?

A degree difference of 2 or more means no line asymptote exists. The end behaviour of the graph follows a polynomial curve, the quotient from long division.The calculator shows this polynomial in the calculation steps.

Is the y-intercept always defined if there is a hole at x = 0?

No. If x = 0 is a hole, the original function is undefined there, so no y-intercept exists. Use the simplified function to evaluate the limit at x = 0, that limit value is the y-coordinate of the hole, not an intercept. For example, f(x) = x/(x) has a hole at (0, 1), not a y-intercept.

Guides on this site