Rational function calculator

Type a fraction of two polynomials, such as (x^2 − 1) / (x^2 − x − 2), and get its domain, zeros, vertical asymptotes, holes, the asymptote for large x and the y-intercept.

A ratio of two polynomials in x, for example (2x + 1) / (x^2 − 4).

Fill in the fields; the answer appears here straight away.

How it works

  1. Enter the values

    Type the numbers or the formula. Decimals may use a point or a comma. No idea? Click Fill in an example.

  2. Instant answer

    The answer appears as you type, with the most important intermediate values.

  3. See the working

    Under "How it's worked out" you see the steps, handy for checking your own calculation.

What it finds

  • Domain: all x except the zeros of the denominator.
  • Zeros: where the numerator is 0 and the denominator isn't.
  • Vertical asymptotes: zeros of the denominator where the numerator isn't 0.
  • Holes: values where numerator and denominator are both 0, so a factor cancels.
  • Horizontal or oblique asymptote: depends on the degrees of numerator and denominator.

In the example, (x² − 1) / (x² − x − 2) = (x − 1)(x + 1) / ((x − 2)(x + 1)): there is a hole at x = −1, a vertical asymptote at x = 2 and a horizontal asymptote y = 1.

Degrees and asymptotes

If the numerator's degree is lower, the asymptote is y = 0; if equal, y = the ratio of the leading coefficients; one higher gives an oblique asymptote. Only polynomials are allowed, so no sin, roots or powers of e.

Three worked examples

f(x) Zeros Vertical asymptotes Asymptote for large x
1 / (x − 3) none x = 3 y = 0
(2x + 1) / (x² − 4) x = −1/2 x = −2 and x = 2 y = 0
(x² + 1) / x none x = 0 y = x (oblique)

For (2x + 1) / (x² − 4) the y-intercept is (0, −1/4), because f(0) = 1 / −4.

From the numbers to a sketch

Draw the asymptotes as dashed lines, mark the zeros and the y-intercept, and put an open circle at each hole. Then check the sign of f on each stretch between the special x-values: the sign can only change at a zero or a vertical asymptote. The rest of the sketch follows.

Related tools

To find where a quadratic denominator vanishes, use the quadratic equation solver; for slopes and extremes of the function, the derivative calculator.

Frequently asked questions

What is the difference between a hole and a vertical asymptote?

Both occur where the denominator is zero. If the numerator is also zero there, a factor cancels and you get a hole. If it is not, the function shoots off to infinity and you get a vertical asymptote.

Does the calculator draw the graph?

No. It gives you the numbers that matter for a sketch: where the graph crosses the axes, where it breaks and where it levels off.

When is the asymptote oblique instead of horizontal?

When the degree of the numerator is exactly one more than the degree of the denominator. (x² + 1) / x = x + 1/x has the oblique asymptote y = x.

Which functions can I enter?

Only polynomials in the numerator and denominator, such as `(2x + 1) / (x^2 − 4)`. Functions such as sin, roots or e^x are not rational.